/****************************************************************************** * Icinga 2 * * Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/) * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software Foundation * * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * ******************************************************************************/ /** * main snmp-manubulon template */ template CheckCommand "snmp-manubulon-command" { import "ipv4-or-ipv6" arguments = { "-H" = { value = "$snmp_address$" description = "Name or IP address of host to check" } "-C" = { set_if = "$snmp_nocrypt$" value = "$snmp_community$" description = "Community name for the host's SNMP agent (implies v1 protocol)" } "-p" = { value = "$snmp_port$" description = "SNMP port (Default 161)" } "-2" = { set_if = "$snmp_v2$" description = "Use snmp v2c" } "-l" = { set_if = "$snmp_v3$" value = "$snmp_login$" description = "Login and auth password for snmpv3 authentication" } "-x" = { set_if = "$snmp_v3$" value = "$snmp_password$" description = "Priv password" } "-L" = { set_if = "$snmp_v3_use_authprotocol$" value = "$snmp_authprotocol$" description = ", - ," } "-X" = { set_if = "$snmp_v3_use_privpass$" value = "$snmp_privpass$" description = "Priv password for snmpv3 (AuthPriv protocol)" } "-w" = { value = "$snmp_warn$" } "-c" = { value = "$snmp_crit$" } "-t" = { value = "$snmp_timeout$" description = "Timeout for SNMP in seconds (Default: 5)" } } vars.snmp_address = "$check_address$" vars.snmp_nocrypt = true vars.snmp_community = "public" vars.snmp_v2 = false vars.snmp_v3 = false vars.snmp_login = "snmpuser" vars.snmp_v3_use_privpass = false vars.snmp_v3_use_authprotocol = false vars.snmp_authprotocol = "md5,des" vars.snmp_timeout = "5" } /** * snmp env * Url reference: http://nagios.manubulon.com/snmp_env.html */ object CheckCommand "snmp-env" { import "snmp-manubulon-command" command = [ ManubulonPluginDir + "/check_snmp_env.pl" ] arguments += { "-T" = { value = "$snmp_env_type$" description = "Environment Type [cisco|nokia|bc|iron|foundry|linux]" } "-F" = { value = "$snmp_env_fan$" description = "Minimum fan rpm value (only needed for 'iron' & 'linux')" } "-c" = { value = "$snmp_env_celsius$" description = "Maximum temp in degrees celsius (only needed for 'iron' & 'linux')" } "-f" = { set_if = "$snmp_perf$" description = "Perfparse compatible output" } } vars.snmp_env_type = "cisco" vars.snmp_perf = true } /** * snmp load * Url reference: http://nagios.manubulon.com/snmp_load.html */ object CheckCommand "snmp-load" { import "snmp-manubulon-command" command = [ ManubulonPluginDir + "/check_snmp_load.pl" ] arguments += { "-T" = { value = "$snmp_load_type$" description = "CPU check" } "-f" = { set_if = "$snmp_perf$" description = "Perfparse compatible output" } } vars.snmp_load_type = "stand" vars.snmp_warn = 85 vars.snmp_crit = 95 vars.snmp_perf = true } /** * Memory and swap usage on Linux given by Net-snmp * Memory usage on cisco routers or Pix * For other systems use check_snmp_storage.pl * Url reference: http://nagios.manubulon.com/snmp_mem.html */ object CheckCommand "snmp-memory" { import "snmp-manubulon-command" command = [ ManubulonPluginDir + "/check_snmp_mem.pl" ] arguments += { "-f" = { set_if = "$snmp_perf$" description = "Performance data output" } "-I" = { set_if = "$snmp_is_cisco$" description = "check cisco memory (sum of all memory pools)" } "-E" = { set_if = "$snmp_is_hp$" description = "check HP / Procurve memory" } } vars.snmp_warn = "94,50" vars.snmp_crit = "98,80" vars.snmp_perf = true vars.snmp_is_cisco = false } /** * snmp storage - Disk/Memory * Url reference: http://nagios.manubulon.com/snmp_storage.html */ object CheckCommand "snmp-storage" { import "snmp-manubulon-command" command = [ ManubulonPluginDir + "/check_snmp_storage.pl" ] arguments += { "-m" = { value = "$snmp_storage_name$" description = "Name in description OID (can be mounpoints '/home' or 'Swap Space'...)" } "-f" = { set_if = "$snmp_perf$" description = "Perfparse compatible output" } } vars.snmp_storage_name = "^/$$" vars.snmp_warn = 80 vars.snmp_crit = 90 vars.snmp_perf = true } /** * snmp network interfaces * Url reference: http://nagios.manubulon.com/snmp_int.html */ object CheckCommand "snmp-interface" { import "snmp-manubulon-command" command = [ ManubulonPluginDir + "/check_snmp_int.pl" ] arguments += { "-n" = { value = "$snmp_interface$" description = "Name in description OID (eth0, ppp0 ...). This is treated as a regexp : -n eth will match eth0,eth1,..." } "-k" = { set_if = "$snmp_interface_perf$" description = "Check the input/ouput bandwidth of the interface" } "--label" = { value = "$snmp_interface_label$" description = "Add label before speed in output : in=, out=, errors-out=, etc..." } "-Y" = { set_if = "$snmp_interface_bits_bytes$" description = "Output performance data in bits/s or Bytes/s" } "-y" = { set_if = "$snmp_interface_percent$" description = "Output performance data in % of max speed" } "-B" = { set_if = "$snmp_interface_kbits$" description = "Make the warning and critical levels in K|M|G Bits/s instead of K|M|G Bytes/s" } "-M" = { set_if = "$snmp_interface_megabytes$" description = "Make the warning and critical levels in Mbps" } "--64bits" = { set_if = "$snmp_interface_64bit$" description = "Use 64 bits counters instead of the standard counters when checking bandwidth & performance data for interface >= 1Gbps" } "-e" = { set_if = "$snmp_interface_errors$" description = "Add error & discard to Perfparse output" } "-i" = { set_if = "$snmp_interface_inverse$" description = "Make critical when up" } "-r" = { set_if = "$snmp_interface_noregexp$" description = "Do not use regexp to match NAME in description OID" } "-d" = { value = "$snmp_interface_delta$" description = "Make an average of seconds (default 300=5min)" } "-u" = { set_if = "$snmp_interface_warncrit_percent$" description = "Make the warning and critical levels in % of reported interface speed" } "-N" = { set_if = "$snmp_interface_ifname$" } "-A" = { set_if = "$snmp_interface_ifalias$" } "-f" = { set_if = "$snmp_perf$" description = "Perfparse compatible output (no output when interface is down)" } } vars.snmp_interface = "eth0" vars.snmp_interface_perf = true vars.snmp_interface_bits_bytes = true vars.snmp_interface_percent = false vars.snmp_interface_kbits = true vars.snmp_interface_megabytes = true vars.snmp_interface_64bit = false vars.snmp_interface_errors = true vars.snmp_interface_noregexp = false vars.snmp_interface_delta = 300 vars.snmp_interface_warncrit_percent = false vars.snmp_interface_ifname = false vars.snmp_interface_ifalias = false vars.snmp_warn = "300,400" vars.snmp_crit = "0,600" vars.snmp_perf = true } /** * snmp process * Url reference: http://nagios.manubulon.com/snmp_process.html */ object CheckCommand "snmp-process" { import "snmp-manubulon-command" command = [ ManubulonPluginDir + "/check_snmp_process.pl" ] arguments += { "-n" = { value = "$snmp_process_name$" description = "Regex service name eg. ^apache2$" } "-F" = { set_if = "$snmp_perf$" description = "Add performance output (outputs : memory_usage, num_process, cpu_usage)" } "-A" = { set_if = "$snmp_process_use_params$" description = "Add parameters to select processes (ex : 'named.*-t /var/named/chroot' will only select named process with this parameter)" } "-m" = { set_if = "$snmp_process_mem_usage$" value = "$snmp_process_mem_threshold$" description = "Checks memory usage. Values warning and critical in Mb eg. 512,1024" } "-u" = { set_if = "$snmp_process_cpu_usage$" value = "$snmp_process_cpu_threshold$" description = "Checks CPU usage. Values warning and critical in % (value can be > 100% : 100%=1 CPU) eg. 15,50" } } vars.snmp_process_name = ".*" vars.snmp_warn = 0 vars.snmp_crit = 0 vars.snmp_perf = true vars.snmp_process_use_params = false vars.snmp_process_mem_usage = false vars.snmp_process_mem_threshold = "0,0" vars.snmp_process_cpu_usage = false vars.snmp_process_cpu_threshold = "0,0" }