Status Information length

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
stijnB
Posts: 3
Joined: Thu Mar 14, 2013 4:44 am

Status Information length

Post by stijnB »

I have a problem with the status length of Nagios it only displays about 80 chars of the message I specified in my script, if I select the specific service I can see the full message.
This is not really a problem but in the email I get send it's the same problem and if event happened when I wasn't looking and has been solved already I have the same problem when checking the log but without the possibility to see the full message?

How can I make the message displayed longer?

Kind regards
Stijn
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Status Information length

Post by slansing »

Lets open up your commands.cfg file and take a look at your Host/Service notification commands:

Code: Select all

vi /usr/local/nagios/etc/commands.cfg
Within this file search for notify-service-by-email.. for instance an example is this:

Code: Select all

define command {
       command_name                             notify-service-by-email
       command_line                             /usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
You will want to add longserviceoutput into the command to show the extended lines you are unable to see normally.. You would simply add it next to the regular serviceoutput like so:

Code: Select all

$SERVICEOUTPUT$$LONGSERVICEOUTPUT$
And this should work properly. Then save the file, verify the configuration, and restart Nagios for good measure.
stijnB
Posts: 3
Joined: Thu Mar 14, 2013 4:44 am

Re: Status Information length

Post by stijnB »

this works for the email notifications but where can I change it to make sure it is properly displayed in the alert history?

kind regards
Stijn
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Status Information length

Post by slansing »

This is not something that can be easily configured through the normal CGI's, you would need to change them and reconfigure Nagios for this information to display as it is not a default option.
Locked