10 月 252014
 

安装后libexec目录无check_mysql命令插件

nagios-check-mysql-install-01

[root@monitor plugins-scripts]# rpm -q mysql-devel
package mysql-devel is not installed
[root@monitor plugins-scripts]#

Description : MySQL is a multi-user, multi-threaded SQL database server. This
: package contains the libraries and header files that are needed
: for developing MySQL client applications.

nagios-check-mysql-install-02 nagios-check-mysql-install-03

10 月 252014
 

SSH登录提示慢

centos-sshd-login-01

[root@localhost ~]# vi /etc/ssh/sshd_config

centos-sshd-login-02
# GSSAPI options
#GSSAPIAuthentication no
#GSSAPIAuthentication yes
GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

centos-sshd-login-03
#UseDNS yes
UseDNS no
[root@localhost ~]# service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
[root@localhost ~]#

10 月 252014
 

使用Cacti查看已监控的Juniper SRX接口的MIB信息

juniper-srx-snmp-interface-status-01

Data Query Debug Information

juniper-srx-snmp-interface-status-02

juniper-srx-snmp-interface-status-03

通过Nagios手动执行动态检测

[root@monitor libexec]# ./check_snmp -H 192.168.152.1 -C public -o ifOperStatus.510 -r 1 -m IF-MIB
 SNMP OK - up(1) |
[root@monitor libexec]#

Nagios中默认监控交换机接口状态的配置

[harveymei@monitor objects]$ cat switch.cfg
# Monitor Port 1 status via SNMP
define service{
use generic-service ; Inherit values from a template
host_name linksys-srw224p
service_description Port 1 Link Status
check_command check_snmp!-C public -o ifOperStatus.1 -r 1 -m RFC1213-MIB
}


juniper-srx-snmp-interface-status-04

10 月 242014
 

发送失败的日志消息

Oct 24 18:37:27 monitor nagios: SERVICE ALERT: USA;PING;CRITICAL;HARD;3;PING CRITICAL - Packet loss = 0%, RTA = 176.76 ms
Oct 24 18:37:27 monitor nagios: SERVICE NOTIFICATION: nagiosadmin;USA;PING;CRITICAL;notify-service-by-email;PING CRITICAL - Packet loss = 0%, RTA = 176.76 ms
Oct 24 18:37:27 monitor nagios: Warning: Attempting to execute the command "/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: PROBLEM\n\nService: PING\nHost: USA\nAddress: 50.7.103.90\nState: CRITICAL\n\nDate/Time: Fri Oct 24 18:37:27 CST 2014\n\nAdditional Info:\n\nPING CRITICAL - Packet loss = 0%, RTA = 176.76 ms\n" | /bin/mail -s "** PROBLEM Service Alert: USA/PING is CRITICAL **" nagios@localhost,harvey.mei@sample.cn,harvey.mei@msn.com,1882528****@139.com" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...

查看是否安装邮件程序

[root@monitor objects]# ls /bin/mail
ls: cannot access /bin/mail: No such file or directory
[root@monitor objects]# yum install mailx

再次查看成功发送的日志

Oct 24 18:47:29 monitor postfix/pickup[11720]: 13D3C6406B6: uid=503 from=<nagios>
Oct 24 18:47:29 monitor postfix/cleanup[12911]: 13D3C6406B6: message-id=<20141024104729.13D3C6406B6@monitor.localdomain>
Oct 24 18:47:29 monitor postfix/qmgr[11721]: 13D3C6406B6: from=<nagios@monitor.localdomain>, size=777, nrcpt=4 (queue active)
Oct 24 18:47:29 monitor postfix/local[12919]: 13D3C6406B6: to=<nagios@localhost.localdomain>, orig_to=<nagios@localhost>, relay=local, delay=0.04, delays=0.02/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)
Oct 24 18:47:29 monitor postfix/smtp[12921]: connect to mxbiz1.qq.com[240e:ff:f040:28::c]:25: Network is unreachable
Oct 24 18:47:29 monitor postfix/smtp[12921]: 13D3C6406B6: to=<harvey.mei@sample.cn>, relay=mxbiz1.qq.com[113.108.16.61]:25, delay=0.54, delays=0.02/0.03/0.1/0.39, dsn=5.0.0, status=bounced (host mxbiz1.qq.com[113.108.16.61] said: 550 Mail content denied. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 (in reply to end of DATA command))
Oct 24 18:47:35 monitor postfix/smtp[12920]: 13D3C6406B6: to=<1882528****@139.com>, relay=mx1.mail.139.com[221.176.66.188]:25, delay=6.2, delays=0.02/0.03/6.1/0.11, dsn=2.0.0, status=sent (250 ok)
Oct 24 18:52:29 monitor postfix/smtp[12922]: 13D3C6406B6: conversation with mx2.hotmail.com[65.55.33.119] timed out while performing the EHLO handshake