check_snmp监控服务器信息的脚本

发布时间:2019-11-24编辑:脚本学堂
check_snmp监控服务器信息的脚本

check_snmp监控服务器信息的脚本
 

复制代码 代码如下:

# 'check_system' command definition
define command{
   command_name    check_system
   command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o sysDescr.0
}
    
# 'snmp_load' command definition
define command{
    command_name    snmp_load
    command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.10.1.5.1,.1.3.6.1.4.1.2021.10.1.5.2,.1.3.6.1.4.1.2021.10.1.5.3 -w :'$ARG2$',:'$ARG3$',:'$ARG4$' -c :'$ARG5$',:'$ARG6$',:'$ARG7$' -l load
}
    
# 'snmp_cpustats' command definition
define command{
   command_name    snmp_cpustats
   command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.11.9.0,.1.3.6.1.4.1.2021.11.10.0,.1.3.6.1.4.1.2021.11.11.0 -l 'CPU usage (user system idle)' -u '%'
}

# 'snmp_procname' command definition
define command{
   command_name    snmp_procname
   command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.2.1.5.'$ARG2$' -w '$ARG3$':'$ARG4$' -c '$ARG5$':'$ARG6$'
}

# 'snmp_disk' command definition
define command{
  command_name    snmp_disk
  command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.9.1.7.'$ARG2$',.1.3.6.1.4.1.2021.9.1.9.'$ARG2$' -w '$ARG3$':,:'$ARG4$' -c '$ARG5$':,:'$ARG6$' -u 'kB free (','% used)' -l 'disk space'
}
    
# 'snmp_mem' command definition
define command{
   command_name    snmp_mem
   command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.4.6.0,.1.3.6.1.4.1.2021.4.5.0 -w '$ARG2$': -c '$ARG3$':
}
    
     # 'snmp_uptime' command definition
     define command{
         command_name    snmp_uptime
         command_line /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o sysUpTime.0
             }
    
     # 'snmp_swap' command definition
     define command{
         command_name    snmp_swap
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.2021.4.4.0,.1.3.6.1.4.1.2021.4.3.0 -w '$ARG2$': -c '$ARG3$':
         }
    
    
     # 'snmp_procs' command definition
     define command{
         command_name    snmp_procs
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrSystem.hrSystemProcesses -w :'$ARG2$' -c :'$ARG3$' -l processes
         }
    
    
     # 'snmp_users' command definition
     define command{
         command_name    snmp_users
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrSystem.hrSystemNumUsers -w :'$ARG2$' -c :'$ARG3$' -l users
         }
    
    
     # 'snmp_mem2' command definition
     define command{
         command_name    snmp_mem2
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$',host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.'$ARG2$' -w '$ARG3$' -c '$ARG4$'
         }
    
    
     # 'snmp_swap2' command definition
     define command{
         command_name    snmp_swap2
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$',host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.'$ARG2$' -w '$ARG3$' -c '$ARG4$'
         }
    
    
     # 'snmp_mem3' command definition
     define command{
         command_name    snmp_mem3
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$',host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.'$ARG2$' -w '$ARG3$' -c '$ARG4$'
         }
    
    
     # 'snmp_swap3' command definition
     define command{
         command_name    snmp_swap3
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$',host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.'$ARG2$' -w '$ARG3$' -c '$ARG4$'
         }
    
    
     # 'snmp_disk2' command definition
     define command{
         command_name    snmp_disk2
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.'$ARG2$' -w '$ARG3$' -c '$ARG4$'
         }
    
    
     # 'snmp_tcpopen' command definition
     define command{
         command_name    snmp_tcpopen
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o tcp.tcpCurrEstab.0 -w '$ARG2$' -c '$ARG3$'
         }
    
    
     # 'snmp_tcpstats' command definition
     define command{
         command_name    snmp_tcpstats
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o tcp.tcpActiveOpens.0,tcp.tcpPassiveOpens.0,tcp.tcpInSegs.0,tcp.tcpOutSegs.0,tcp.tcpRetransSegs.0 -l 'TCP stats'
         }
    
    
     # 'check_snmp_bgpstate' command definition
     define command{
         command_name    check_snmp_bgpstate
         command_line    /usr/lib/nagios/plugins/check_bgpstate '$HOSTADDRESS$' -c '$ARG1$'
         }
    
    
     # 'check_netapp_uptime' command definition
     define command{
         command_name    check_netapp_uptime
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.2.1.1.3.0 --delimiter=')' -l "Uptime is"
         }
    
    
     # 'check_netapp_cpuload' command definition
     define command{
         command_name    check_netapp_cpuload
         command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.789.1.2.1.3.0 -w 90 -c 95 -u '%' -l "CPU LOAD "
         }
    
    
# 'check_netapp_numdisks' command definition
define command{
  command_name    check_netapp_numdisks
  command_line    /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.789.1.6.4.1.0,.1.3.6.1.4.1.789.1.6.4.2.0,.1.3.6.1.4.1.789.1.6.4.8.0,.1.3.6.1.4.1.789.1.6.4.7.0 -u 'Total Disks','Active','Spare','Failed' -l ""
}
    
# 'check_compaq_thermalCondition' command definition
define command{
   command_name    check_compaq_thermalCondition
   command_line     /usr/lib/nagios/plugins/check_snmp -H '$HOSTADDRESS$' -C '$ARG1$' -o .1.3.6.1.4.1.232.6.2.1.0,.1.3.6.1.4.1.232.6.2.2.0,.1.3.6.1.4.1.232.6.2.3.0,.1.3.6.1.4.1.232.6.2.4.0 -u 'ThermalCondition','ThermalTemp','ThermalSystem','ThermalCPUFan' -w 2:2,2:2,2:2,2:2 -c 1:2,1:2,1:2,1:2 -l "Thermal status "
}