Please post/attach your commands.cfg file.tmcdonald wrote:[...] sreinhardt was talking about your notify-service-by-email and notify-host-by-email commands in commands.cfg [...]
Nagios Output file
Re: Nagios Output file
Former Nagios employee
-
amitdaniel
- Posts: 25
- Joined: Mon Jul 01, 2013 9:17 am
Re: Nagios Output file
Code: Select all
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$ [email protected]
}
# 'notify-service-by-email' command definitioni
#$CONTACTEMAIL$
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ [email protected]
}
Re: Nagios Output file
Did you try replacing $HOSTOUTPUT$ and $SERVICEOUTPUT$ with $LONGHOSTOUTPUT$ and $LONGSERVICEOUTPUT$ as sreinhardt suggested?
sreinhardt wrote:As slansing mentioned, this isn't totally a size issue, but more of after a newline in standard output, the rest is only returned if you request longoutput to be appended to your commands. I would suggest by adding $LONGSERVICEOUTPUT$ to your notification command so that the data after is correctly added to your emails.
Former Nagios employee
-
amitdaniel
- Posts: 25
- Joined: Mon Jul 01, 2013 9:17 am
Re: Nagios Output file
It's worked !!!!!
Thanks a lot guys !!! you are the best !
Thanks a lot guys !!! you are the best !
Re: Nagios Output file
You are quite welcome. I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee