Hi Team,
We are using Nagios core and being an open source tool, we dont have a direct integration with the ticketing tool.
We do see options to schedule a particular service or a Host under downtime from the settings. However we are looking for options to set bulk services (100-200 servers) into maintenance as a group rather than doing it individually from each service.
As we have both prod and non-prod servers configured under a same host, we are not able to put the entire Host into maintenance as we are looking to put only selected prod servers into maintenance mode. Kindly assist us on the possible options for getting this done.
Many Thanks !!
Scheduling Downtime for Bulk services in Nagios core
-
ramakrishnan.a
- Posts: 1
- Joined: Thu Nov 05, 2020 5:13 am
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Scheduling Downtime for Bulk services in Nagios core
Hi,
Thanks for joining the Nagios Community Forum. Glad to have ya! In regards to your questions, here goes
SCHEDULE_HOSTGROUP_HOST_DOWNTIME
Might be an opportunity to use parent-child relationships to help administer these servers in Nagios.
Determining Status and Reachability of Network Hosts
Hope that helps answer your questions.
Benjamin
Thanks for joining the Nagios Community Forum. Glad to have ya! In regards to your questions, here goes
Honestly, Nagios XI really shines in this area. That said, I would create host groups for the 100-200 servers and use the command to schedule downtime for entire the host groups.However we are looking for options to set bulk services (100-200 servers) into maintenance as a group rather than doing it individually from each service.
SCHEDULE_HOSTGROUP_HOST_DOWNTIME
I'd have to see the configurations but if you have multiple hosts created for single IP address, again you might just use host groups to schedule downtime for those groups.As we have both prod and non-prod servers configured under a same host, we are not able to put the entire Host into maintenance as we are looking to put only selected prod servers into maintenance mode. Kindly assist us on the possible options for getting this done.
Might be an opportunity to use parent-child relationships to help administer these servers in Nagios.
Determining Status and Reachability of Network Hosts
Hope that helps answer your questions.
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Scheduling Downtime for Bulk services in Nagios core
Check the external command reference regarding
Basically, you need a (Bash, Perl, Python) loop iterating through your list of hosts and services, writing the appropriate downtime command to the Nagios command pipe (nagios.cmd, check nagios.cfg for the "command_file" setting).
A Perl example would be
NAGCMD is the file handle pointing to your nagios.cmd command pipe.
The downtimes from this example would start immediately (because of the 2nd occurence of "time" with Perl "time" being the current time), you can use any Unix timestamp instead.
$end is the end time (Unix timestamp)
$name and $text are optional (downtime comment)
Code: Select all
SCHEDULE_SVC_DOWNTIME
SCHEDULE_HOST_DOWNTIME
DEL_SVC_DOWNTIME
DEL_HOST_DOWNTIMEA Perl example would be
Code: Select all
foreach my $service (@list) {
print NAGCMD "[".time."] SCHEDULE_SVC_DOWNTIME;".$host.";".$service.";".time.";".$end.";1;0;0;".$name.";".$text."\n";
}The downtimes from this example would start immediately (because of the 2nd occurence of "time" with Perl "time" being the current time), you can use any Unix timestamp instead.
$end is the end time (Unix timestamp)
$name and $text are optional (downtime comment)
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Scheduling Downtime for Bulk services in Nagios core
Thanks @pomtomm!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!