Page 1 of 1

Persistent Comment Default on

Posted: Thu Apr 14, 2011 11:43 am
by JarrodHardy
When acknowledging a service alarm, the "Persistent Comment:" is unchecked by default. Is there a setting somewhere to make this check box checked by default?

VMware - Nagios XI 2009R1.4B
nagiosxi_ack_comment.JPG
Thank you,
Jarrod

Re: Persistent Comment Default on

Posted: Thu Apr 14, 2011 12:14 pm
by tonyyarusso
Sadly, no. That particular view is actually coming straight out of the Nagios Core code, unlike the rest that has been replaced by XI-specific stuff. In order to change it you would need to edit a printf statement in cgi/cmd.c in the Nagios source and recompile that file.

Re: Persistent Comment Default on

Posted: Thu Apr 14, 2011 4:03 pm
by JarrodHardy
tonyyarusso wrote:Sadly, no. That particular view is actually coming straight out of the Nagios Core code, unlike the rest that has been replaced by XI-specific stuff. In order to change it you would need to edit a printf statement in cgi/cmd.c in the Nagios source and recompile that file.
in the cgi/cmd.c file, would it just be changing the following 2 lines for both host and service?

ORIGINAL: Lines 958 & 984

Code: Select all

printf("<INPUT TYPE='checkbox' NAME='persistent' %s>",(cmd==CMD_ACKNOWLEDGE_HOST_PROBLEM)?"":"CHECKED");
printf("<INPUT TYPE='checkbox' NAME='persistent' %s",(cmd==CMD_ACKNOWLEDGE_SVC_PROBLEM)?"":"CHECKED");
Proposed Modification: Lines 958 & 984

Code: Select all

printf("<INPUT TYPE='checkbox' NAME='persistent' CHECKED>");
printf("<INPUT TYPE='checkbox' NAME='persistent' CHECKED>");
...or would you recommend something different?

Thanks,
Jarrod

Re: Persistent Comment Default on

Posted: Fri Apr 15, 2011 1:13 pm
by JarrodHardy
I went ahead and tested this out, and it works perfectly.

ORIGINAL: Lines 958 & 984

Code: Select all

printf("<INPUT TYPE='checkbox' NAME='persistent' %s>",(cmd==CMD_ACKNOWLEDGE_HOST_PROBLEM)?"":"CHECKED");
printf("<INPUT TYPE='checkbox' NAME='persistent' %s",(cmd==CMD_ACKNOWLEDGE_SVC_PROBLEM)?"":"CHECKED");
MODIFIED: Lines 958 & 984

Code: Select all

printf("<INPUT TYPE='checkbox' NAME='persistent' CHECKED>");
printf("<INPUT TYPE='checkbox' NAME='persistent' CHECKED>");
Then perform these steps to backup the original cmd.cgi and then make and install just the cmd.cgi with the changes:

Code: Select all

# cd /<--source code location-->/nagios-3.2.3/
# ./configure
# make cgis
# cp /usr/local/nagios/sbin/cmd.cgi /usr/local/nagios/sbin/cmd.cgi.orig
# cp cgi/cmd.cgi /usr/local/nagios/sbin/cmd.cgi

Note: To backout just copy the cmd.cgi.orig back over the cmd.cgi


Thanks,
Jarrod

Re: Persistent Comment Default on

Posted: Fri Apr 15, 2011 2:41 pm
by rdedon
Excellent Jarrod and I am glad this worked out and we appreciate you sharing the information as well. :-)