You are here

find where time periods are used?

2 posts / 0 new
Last post
Gary Dohmeier II
gary.dohmeier@siriuscomservices.com's picture
find where time periods are used?

Is there a way to search using the name of the custom timeperiod .. to find what services or hosts its attached to for notifications.? I need to be able to find all services using a specific timeperiod.

Duncan Ferguson
dferguson's picture
The easiest way to do this is

The easiest way to do this is probably via the Rest API

$ opsview_rest --username=admin --password=initial --pretty --data-format=json GET config/timeperiod | jq '.list[] | select(.name=="workhours")'

This will list all host and service check periods, as well as notifications periods for the 'workhours' timeperiod.

To get a list of timeperiod names via the Rest API, use:

$ opsview_rest --username=admin --password=initial --pretty --data-format=json GET config/timeperiod | jq '.[].name'

 

You may need to install the 'jq' utility first, a command line JSON parser.

  Duncs