Nagios Mail alarm sent in Chinese, Nagios monitoring page garbled resolution

Source: Internet
Author: User

monitoring configuration-configuration of notifications

Notify by email when there is a problem with the service

1, configure the command to send mail

Edit/usr/local/nagios/etc/objects/commands.cfg

The default output macros $hostoutput$ and $serviceoutput$ only output the first line of information, and we use $longhostoutput$ and $longserviceoutput$ to output the complete information.

in order to accept the format of a good, and Chinese text-free hypertext message, you can set the SendEmail "-o message-content-type=html-omessage-charset=utf8" option.

# ' notify-host-by-email ' command definition

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$longhostoutput$\n\ndate/time: $LONGDATETIME $\n "| /usr/bin/mutt-s "* * $NOTIFICATIONTYPE $ Hostalert: $HOSTNAME $ is $HOSTSTATE $ * *" $CONTACTEMAIL $

}

# ' Notify-service-by-email ' commanddefinition

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\ nadditionalinfo:\n\n$serviceoutput$\n$longserviceoutput$ "| /usr/bin/mutt-s "* * $NOTIFICATIONTYPE $ Service Alert: $HOSTALIAS $/$SERVICEDESC $ is $SERVICESTATE $**" $CONTACTEMAIL $

}

...



Nagiosian Monitoring Page Garbled resolution: Modify the Monitor host/usr/local/apache2/conf last line increase

Adddefaultcharset Utf-8

Modify/usr/local/nagios/etc/cgi.cfg

Escape_html_tags=0


Restart Apache using the following command

#/usr/local/apache2/bin/apachectlrestart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.