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
Status Information length
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Status Information length
Lets open up your commands.cfg file and take a look at your Host/Service notification commands:
Within this file search for notify-service-by-email.. for instance an example is this:
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:
And this should work properly. Then save the file, verify the configuration, and restart Nagios for good measure.
Code: Select all
vi /usr/local/nagios/etc/commands.cfgCode: 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$
}
Code: Select all
$SERVICEOUTPUT$$LONGSERVICEOUTPUT$Re: Status Information length
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
kind regards
Stijn
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Status Information length
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.