首页 > 代码库 > nginx环境下配置nagios-关于commands.cfg
nginx环境下配置nagios-关于commands.cfg
nagios监控Linux/windows常用配置,以snmp、nrpe实现
1 # ‘process-host-perfdata‘ command definition
2 define command{
3 command_name process-host-perfdata
4 #command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out
5 command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
6 #command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/host-perfdata
7 }
8
9
10 # ‘process-service-perfdata‘ command definition
11 define command{
12 command_name process-service-perfdata
13 #command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out
14 command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl
15 #command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/service-perfdata
16 }
17 ###nrpe
18 #‘check_nrpe ‘ command definition
19 define command{
20 command_name check_nrpe
21 command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
22 }
23
24 ###linux commond
25
26 # ‘check_snmp_load‘ command definition
27 define command{
28 command_name check_snmp_load
29 #command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C jd $ARG1$ $ARG2$
30 command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C jd -w $ARG1$ -c $ARG2$ -T netsl -f
31 }
32
33 # ‘check_snmp_proc" command definition
34 define command{
35 command_name check_snmp_proc
36 command_line /usr/local/nagios/libexec/check_snmp_process.pl -H $HOSTADDRESS$ -C jd $ARG1$ $ARG2$ -f
37 }
38
39 # ‘check_snmp_cpu‘ command definition,check cpu usage
40 define command {
41 command_name check_snmp_cpu
42 command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C jd -w $ARG1$ -c $ARG2$ -T netsc -f
43 }
44
45 # ‘check_snmp_memory‘ command definition
46 define command{
47 command_name check_snmp_memory
48 command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C jd -w $ARG1$ -c $ARG2$ -f
49 }
50
51 # ‘check_snmp_netio‘ command definition
52 define command{
53 command_name check_snmp_trafic
54 command_line $USER1$/check_traffic.sh -V 2c -C jd -H $HOSTADDRESS$ -I 0 -w $ARG1$ -c $ARG2$ -M -b
55 }
56
57 # ‘check_snmp_disk_linux‘ command definition
58 define command{
59 command_name check_snmp_disk_linux
60 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m "^/" -w 80% -c 90% -f
61 }
62
63 # ‘check_snmp_disk_win‘ command definition
64 define command{
65 command_name check_snmp_disk_win
66 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m "^C:" -w 80% -c 90% -f
67 }
68
69 # ‘check_snmp_mem‘ command definition
70 define command{
71 command_name check_snmp_mem
72 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m "memory|Memory" -w 80% -c 90% -f
73 }
74
75 # ‘snmp_cpustats‘ command definition
76 define command{
77 command_name snmp_cpustats
78 command_line /usr/local/nagios/libexec/check_snmp -H $HOSTADDRESS$ -C jd -o .1.3.6.1.4.1.2021.11.9.0 -w $ARG1$ -c $ARG2$ -l "user CPU time:" -u "%" -o .1.3.6.1.4.1.2021.11.10.0 -w $ARG3$ -c $ARG4$ -l "system CPU time:" -u "%" -o .1.3.6.1.4.1.2021.11.11.0 -w $ARG5$ -c $ARG6$ -l "idle CPU time:" -u "%"
79 }
80 ###windows command
81
82 # ‘check_snmp_win_cpu‘
83 define command{
84 command_name check_snmp_win_cpu
85 command_line $USER1$/check_snmp_cpu.sh -H $HOSTADDRESS$ -C jd -w $ARG1$ -c $ARG2$
86 }
87
88 # ‘check_snmp_win_service‘
89 define command{
90 command_name check_snmp_win_service
91 command_line $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ -C jd -n $ARG1$ -N $ARG2$
92 }
93
94 # ‘check_snmp_win_disk_c‘
95 define command{
96 command_name check_snmp_win_disk_c
97 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m ^C: -w $ARG1$ -c $ARG2$ -f
98 }
99
100 # ‘check_snmp_win_mem‘
101 define command{
102 command_name check_snmp_win_mem
103 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m Memory -w $ARG1$ -c $ARG2$ -f
104 }
105
106 # ‘check_snmp_win_net‘
107 #define command{
108 # command_name check_snmp_win_net
109 # command_line $USER1$/check_traffic.sh -V 2c -H $HOSTADDRESS$ -C jd -I 0 -w $ARG1$ -c $ARG2$ -M -b
110 #}
111
112 ###os command
113 define command{
114 command_name check_snmp_os_info
115 command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C jd -o sysDescr.0
3 command_name process-host-perfdata
4 #command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out
5 command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
6 #command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/host-perfdata
7 }
8
9
10 # ‘process-service-perfdata‘ command definition
11 define command{
12 command_name process-service-perfdata
13 #command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out
14 command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl
15 #command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl --bulk=/usr/local/pnp4nagios/var/service-perfdata
16 }
17 ###nrpe
18 #‘check_nrpe ‘ command definition
19 define command{
20 command_name check_nrpe
21 command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
22 }
23
24 ###linux commond
25
26 # ‘check_snmp_load‘ command definition
27 define command{
28 command_name check_snmp_load
29 #command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C jd $ARG1$ $ARG2$
30 command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C jd -w $ARG1$ -c $ARG2$ -T netsl -f
31 }
32
33 # ‘check_snmp_proc" command definition
34 define command{
35 command_name check_snmp_proc
36 command_line /usr/local/nagios/libexec/check_snmp_process.pl -H $HOSTADDRESS$ -C jd $ARG1$ $ARG2$ -f
37 }
38
39 # ‘check_snmp_cpu‘ command definition,check cpu usage
40 define command {
41 command_name check_snmp_cpu
42 command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C jd -w $ARG1$ -c $ARG2$ -T netsc -f
43 }
44
45 # ‘check_snmp_memory‘ command definition
46 define command{
47 command_name check_snmp_memory
48 command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C jd -w $ARG1$ -c $ARG2$ -f
49 }
50
51 # ‘check_snmp_netio‘ command definition
52 define command{
53 command_name check_snmp_trafic
54 command_line $USER1$/check_traffic.sh -V 2c -C jd -H $HOSTADDRESS$ -I 0 -w $ARG1$ -c $ARG2$ -M -b
55 }
56
57 # ‘check_snmp_disk_linux‘ command definition
58 define command{
59 command_name check_snmp_disk_linux
60 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m "^/" -w 80% -c 90% -f
61 }
62
63 # ‘check_snmp_disk_win‘ command definition
64 define command{
65 command_name check_snmp_disk_win
66 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m "^C:" -w 80% -c 90% -f
67 }
68
69 # ‘check_snmp_mem‘ command definition
70 define command{
71 command_name check_snmp_mem
72 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m "memory|Memory" -w 80% -c 90% -f
73 }
74
75 # ‘snmp_cpustats‘ command definition
76 define command{
77 command_name snmp_cpustats
78 command_line /usr/local/nagios/libexec/check_snmp -H $HOSTADDRESS$ -C jd -o .1.3.6.1.4.1.2021.11.9.0 -w $ARG1$ -c $ARG2$ -l "user CPU time:" -u "%" -o .1.3.6.1.4.1.2021.11.10.0 -w $ARG3$ -c $ARG4$ -l "system CPU time:" -u "%" -o .1.3.6.1.4.1.2021.11.11.0 -w $ARG5$ -c $ARG6$ -l "idle CPU time:" -u "%"
79 }
80 ###windows command
81
82 # ‘check_snmp_win_cpu‘
83 define command{
84 command_name check_snmp_win_cpu
85 command_line $USER1$/check_snmp_cpu.sh -H $HOSTADDRESS$ -C jd -w $ARG1$ -c $ARG2$
86 }
87
88 # ‘check_snmp_win_service‘
89 define command{
90 command_name check_snmp_win_service
91 command_line $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ -C jd -n $ARG1$ -N $ARG2$
92 }
93
94 # ‘check_snmp_win_disk_c‘
95 define command{
96 command_name check_snmp_win_disk_c
97 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m ^C: -w $ARG1$ -c $ARG2$ -f
98 }
99
100 # ‘check_snmp_win_mem‘
101 define command{
102 command_name check_snmp_win_mem
103 command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C jd -m Memory -w $ARG1$ -c $ARG2$ -f
104 }
105
106 # ‘check_snmp_win_net‘
107 #define command{
108 # command_name check_snmp_win_net
109 # command_line $USER1$/check_traffic.sh -V 2c -H $HOSTADDRESS$ -C jd -I 0 -w $ARG1$ -c $ARG2$ -M -b
110 #}
111
112 ###os command
113 define command{
114 command_name check_snmp_os_info
115 command_line $USER1$/check_snmp -H $HOSTADDRESS$ -C jd -o sysDescr.0
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。