Deleting all downtimes for hostgroup
Posted: Mon Jun 10, 2019 6:07 pm
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?
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?