Hi,
I have a NRPE check on a Windows-server which is checking the size of files.
Unfortunately the returned string "C:\folder\archive1\archive.zip" contains \a which is interpreted as BEL.
And so the notify-service-by-email does not send the text, it sends an attachment.
I've seen this only for this check.
Is there a way to modify the string or to make a mail-notify just for this case?
The check_nrpe is a binary file, so I can not make changes in this check.
Thanks.
Notify by Email sends attachment AT00001.bin
-
- Posts: 4
- Joined: Fri Jun 23, 2023 10:54 pm
-
- Posts: 4
- Joined: Fri Jun 23, 2023 10:54 pm
Re: Notify by Email sends attachment AT00001.bin
OK, I could solve it!
Before the | to the mail, I pipe it through sed...
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTNAME$\nAlias: $HOSTALIAS$\n Address: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n\n" | sed 's/\a/\\a/g' | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Before the | to the mail, I pipe it through sed...
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTNAME$\nAlias: $HOSTALIAS$\n Address: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n\n" | sed 's/\a/\\a/g' | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
-
- Posts: 108
- Joined: Wed Aug 23, 2023 11:29 am
Re: Notify by Email sends attachment AT00001.bin
I'm glad you could solve your issue!
If you need help with anything else, please let us know.
Thank you!
If you need help with anything else, please let us know.
Thank you!