Back to Opsview FAQ

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

Files of interest

/opt/opsview/supportscripts/bin/recur_downtime

/opt/opsview/supportscripts/etc/recur_downtime.yml.

Process

  1. 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
    
  2. Modify /opt/opsview/supportscripts/etc/recure_downtime.yml

    Make 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
["Geneos"] ["FAQ"]

Was this topic helpful?