Problems encountered during nagios installation and solutions

Source: Internet
Author: User
When nagios is installed in the source code, the following Error occurs: Couldnotopencommandfile '/usr/local/nagios/var/rw/nagios. cmd' forupdate! Thenitmeansthatthepermissionsonthefolderaremessedup. Don't 'tbotherse

1. an error occurred while installing nagios in the source code

1 Error: cocould not open command file '/usr/local/nagios/var/rw/nagios. cmd' for update!

Then it means that the permissions on the folder aremessed up. Don't bother setting up the permissions on the fileitself, nagios. cmd, since that file

Gets recreated very often, so

Chown nagios. nagcmd/usr/local/nagios/var/rw

Chmod g + rwx/usr/local/nagios/var/rw

Chmod g + s/usr/local/nagios/var/rw

2. restart apache and nagios, and the premise is that the nagios and apache users are in the nagcmd group.

II. special configurations of nagios warning emails

By default, nagios uses the local machine to send mail alerts.SendmailThe server sends an email. You do not need to use this machine when sending mail alertsSendmailThe email server uses the email server in the network. This requires a third party.

Software sendEmail

1 First Download sendEmail Software official website: http://caspian.dotconf.net/menu/Software/SendEmail/

2 # tar-xvf sendEmail-v1.55.tar.gz

# Cd sendEmail-v1.55

# Cp sendEmail/usr/local/bin

# Chmod a + x/usr/local/bin/sendEmail

3 sendEmail command details

-F indicates the sender's email address.

-T indicates the recipient's email address.

-S indicates the domain name or ip address of the SMTP server

-U indicates the subject of the email.

-Xu indicates the SMTP authentication User name

-Xp indicates the password for SMTP verification. (Note that this password seems to be restricted. for example, I use d! 5neyland cannot be correctly identified)

-M indicates the Mail content

4. configure the nagios mail sending command. the configuration file defines the mail command in commands. cfg.

Define notify-host-by-email, notify-service-by-email

Define command {

Command_name sort Y-host-by-email

Command_line/usr/bin/printf "% B" "****** Frank ****** nnNotification Type: $ icationicationtype

$ NHost: $ HOSTNAME $ nState: $ HOSTSTATE $ nAddress: $ HOSTADDRESS $ nInfo: $ HOSTOUTPUT $ nnDate/Time: $ LONG

DATETIME $ n "|/usr/local/bin/sendEmail-f monitor@frank.org-t $ CONTACTEMAIL $-s smtp.frank.org

-U "** $ icationicationtype $ Host Alert: $ HOSTNAME $ is $ HOSTSTATE $ **"

}

Related Article

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.