I am trying to delete all downtimes for a hostgroup. I would like to avoid looping over each host in the group, finding downtime IDs and deleting them individually. I found the command "CMD_DEL_DOWNTIME_BY_HOSTGROUP_NAME", but cannot get it to work.
My curl command looks like this:
curl -sS http://nagios-server/nagios/cgi-bin/cmd.cgi -u user:pass \
--data cmd_typ=171 \
--data cmd_mod=2 \
--data hostgroup=Linux_Servers \
--data btnSubmit=Commit
It fails with a 500 error:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
root@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>
I found a similar post from 2011 without any answers: https://support.nagios.com/forum/viewto ... AME#p18166.
Is it possible to use this command with cmd.cgi?
Deleting all downtimes for hostgroup
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Deleting all downtimes for hostgroup
That isn't an actual command (maybe was something someone was hoping was there), the whole list of external commands can be found here
https://assets.nagios.com/downloads/nag ... ernalcmds/
https://assets.nagios.com/downloads/nag ... ernalcmds/
Re: Deleting all downtimes for hostgroup
Thanks for the link - useful to know. I was going by the list here: https://github.com/NagiosEnterprises/na ... e/common.h.
There are useful-looking del_downtime_* commands in the 'new commands in Nagios 3.x' section. They seem to be processed like all the other commands in 'commands.c'. Will they be implemented as external commands at some point in the future?
There are useful-looking del_downtime_* commands in the 'new commands in Nagios 3.x' section. They seem to be processed like all the other commands in 'commands.c'. Will they be implemented as external commands at some point in the future?
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Deleting all downtimes for hostgroup
Unfortunately only those found here are implimented at this time
https://github.com/NagiosEnterprises/na ... cmd.c#L739
Other may be added in future releases.
https://github.com/NagiosEnterprises/na ... cmd.c#L739
Other may be added in future releases.