设置如下:
[root@centreon log]# cat /etc/snmp/snmpd.conf | grep -v '^#'|sed /^$/d
com2sec notConfigUser 127.0.0.1 public
com2sec notConfigUser 192.168.198.250 public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact all none none
view all included .1 80
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root (configure /etc/snmp/snmp.local.conf)
dontLogTCPWrappersConnects yes
以check_centreon_snmp_remote_storage为例:
[root@centreon libexec]# ./check_centreon_snmp_remote_storage --help
##############################################
# Copyright (c) 2004-2013 Centreon #
# Bugs to http://forge.centreon.com/ #
##############################################
Usage:
./check_centreon_snmp_remote_storage
-H (--hostname) Hostname to query (required)
-C (--community) SNMP read community (defaults to public)
used with SNMP v1 and v2c
-v (--snmp-version) 1 for SNMP v1 (default)
2 for SNMP v2c
3 for SNMP v3
-P (--snmp-port) SNMP port (default: 161)
-k (--authkey) snmp V3 key
-u (--username) snmp V3 username
-p (--password) snmp V3 password
--authprotocol protocol MD5/SHA (v3)
--privprotocol encryption system (DES/AES)(v3)
--privpassword passphrase (v3)
--64-bits Use 64 bits OID
--maxrepetitions To use when you have the error: 'Message size exceeded buffer maxMsgSize'
Work only with SNMP v2c and v3 (Example: --maxrepetitions=1)
--snmp-timeout SNMP Timeout
-d (--disk) Set the disk (number expected) ex: 1, 2,... (default: 2 )
-n (--name) Allows to use disk name with option -d instead of disk oid index
(ex: -d "C:" -n, -d "E:" -n, -d "Swap Memory" -n, -d "Real Memory" -n
(choose an unique expression for each disk)
-s (--show) Lists all disks (debug mode)
-w (--warn) Minimum fill level at which a warning message will be generated
(default 80)
By using the optional suffixes MB/GB the argument is interpreted as absolute size
and it becomes a threshold for free space. (ex. 100MB; 3GB)
-c (--crit) Minimum fill level at which a critical message will be generated
(default 95)
By using the optional suffixes MB/GB the argument is interpreted as absolute size
and it becomes a threshold for free space. (ex. 50MB; 1GB)
ex.: -w 1GB -c 256MB generates a warning when free space reaches 1GB
and critical when there are less than 256MB left
-V (--version) Plugin version
-L add Windows drive label to output
-M Shows the size in output in MB instead of GB
-t To use for AIX or AS/400 (ex. 'AIX' or 'AS/400')
-a (--cache) Updates cache file every n hours instead of doing snmpwalk for every check (default: 3)
-h (--help) usage help
查看这198.1这台window主机的所以存储设备
[root@centreon libexec]# ./check_centreon_snmp_remote_storage -H 192.168.198.1 -s
hrStorage 1 :: C:\ Label: Serial Number 9067daf7
hrStorage 2 :: D:\ Label: Serial Number 82944
hrStorage 3 :: E:\ Label: Serial Number ab609
hrStorage 4 :: F:\ Label: Serial Number 8c504
hrStorage 5 :: G:\ Label: Serial Number e0aa9
hrStorage 6 :: H:\
hrStorage 7 :: I:\
hrStorage 8 :: Virtual Memory
hrStorage 9 :: Physical Memory