Add recurring downtime
Opsview does not currently have the functionality to set recurring downtime within the product, but you may use a script to do this via the crontab.
Prerequisites
-
Opsview support scripts must be installed on the orchestrator:
[Opsview - Install support scripts](https://support.itrsgroup.com/hc/en-us/articles/4922901644445-Opsview-Install-support-scripts?source=search&auth_token=eyJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjoxMTM1MDE4LCJ1c2VyX2lkIjoxOTA0NDMxMjc3NjEzLCJ0aWNrZXRfaWQiOjI3ODA0MCwiY2hhbm5lbF9pZCI6NjMsInR5cGUiOiJTRUFSQ0giLCJleHAiOjE2NzgyMzk0ODV9.KolTLvh9l47n5pq0WnMvQIqSx6FPFi4xs6aBaCHF8Wo) -
Ensure these are up-to-date:
[Opsview - Update support scripts](https://support.itrsgroup.com/hc/en-us/articles/4922932284445-Opsview-Update-support-scripts?source=search&auth_token=eyJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjoxMTM1MDE4LCJ1c2VyX2lkIjoxOTA0NDMxMjc3NjEzLCJ0aWNrZXRfaWQiOjI3ODA0MCwiY2hhbm5lbF9pZCI6NjMsInR5cGUiOiJTRUFSQ0giLCJleHAiOjE2NzgyMzk0ODV9.KolTLvh9l47n5pq0WnMvQIqSx6FPFi4xs6aBaCHF8Wo)
Files of interest
/opt/opsview/supportscripts/bin/recur_downtime
/opt/opsview/supportscripts/etc/recur_downtime.yml.
Process
-
Run the following command to create the necessary configuration file.
- importantly, the *.yml.in file must be preserved.
# cd /opt/opsview/supportscripts # cp -p etc/recur_downtime.yml.in etc/recur_downtime.yml -
Modify
/opt/opsview/supportscripts/etc/recure_downtime.ymlMake changes appropriately to this file including or excluding/removing references to the hostgroups or hosts section/lines. e.g. use the hostgroups section for setting downtime for a host group. Once completed, it may now be incorporated within the opsview crontab.
Note: If the Opsview UI is not using HTTPS please replace “https” in the url directive with “http”.
Example
opsview:
url: http://localhost/
ssl_verify_hostname: 0
username: (please supply with opsview username)
password: (please supply with opsview password)
debug: 0
downtime:
- comment: Scheduled recurring downtime
frequency: 3rd Tuesday of every month
start_time: 22:00
duration: 4h
hostgroups:
- MyHostgroup
hosts:
- Host_1
- Host_2