Persistent Comment Default on

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
JarrodHardy
Posts: 18
Joined: Wed Mar 09, 2011 5:44 pm

Persistent Comment Default on

Post 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
You do not have the required permissions to view the files attached to this post.
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Persistent Comment Default on

Post 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.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
JarrodHardy
Posts: 18
Joined: Wed Mar 09, 2011 5:44 pm

Re: Persistent Comment Default on

Post 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
JarrodHardy
Posts: 18
Joined: Wed Mar 09, 2011 5:44 pm

Re: Persistent Comment Default on

Post 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
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Persistent Comment Default on

Post by rdedon »

Excellent Jarrod and I am glad this worked out and we appreciate you sharing the information as well. :-)
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
Locked