Date of release: 22.04.2014
OEM Vutlan partners can change the names of the scripts and functions. In file check_element_table.pl there's a line with Vendor identification. OEM Vutlan partners need to change this vendor identification to match their own: 39052 - This is Vutlan ID |
Usage:
./check_element.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd) -i <ID> [-P <port>] [-t <timeout>] [-V]
Command line options:
-v, --verbose
print extra debugging information
-h, --help
print this help message
-H, --hostname=HOST
name or IP address of host to check
-C, --community=COMMUNITY NAME
community name for the host's SNMP agent (implies v 1 protocol)
-P, --port=PORT
SNMPD port (Default 161)
-2, --v2c
use SNMP v2 (instead of SNMP v1)
-t, --timeout=INTEGER
timeout for SNMP in seconds (Default : 5)
-V, --version
prints version number
-i, --id=INTEGER
element's id
Nagios command configuration example:
define command { command_name check_snmp_element command_line $USER1$/check_element.pl -H $HOSTADDRESS$ $ARG1$ } |
Nagios command using the example (community name: read; element ID: 201001):
define service{ use generic-service # host_name test190 hostgroup_name sc-hosts contact_groups admins service_description Unit Service for element with ID=201001 check_command check_snmp_element! -C read -i 201001 normal_check_interval 1 retry_check_interval 1 process_perf_data 1 } |
Download:
Nagios plugin for checking single element (sensor) |
---|
This plugin generates the alarm if at least one element is in the alarm, and the warning if at least one element is in the warning.
This plugin generates the performance data only for sensors with valid value field (as sensors with analog and discrete output)
Usage:
./check_element_table.pl [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd) [-P <port>] [-t <timeout>] [-V]
-v, --verbose
print extra debugging information
-h, --help
print this help message
-H, --hostname=HOST
name or IP address of host to check
-C, --community=COMMUNITY NAME
community name for the host's SNMP agent (implies v 1 protocol)
-P, --port=PORT
SNMPD port (Default 161)
-2, --v2c
use SNMP v2 (instead of SNMP v1)
-t, --timeout=INTEGER
timeout for SNMP in seconds (Default : 5)
-V, --version
prints version number
Nagios command configuration example:
define command { command_name check_snmp_element_table command_line $USER1$/check_element_table.pl -H $HOSTADDRESS$ $ARG1$ } |
Nagios command using example (community name: read):
# SNMP Table of Elements for devices define service{ use generic-service # host_name test190 hostgroup_name sc-hosts service_description Unit Table of Elements Service check_command check_snmp_element_table! -C read normal_check_interval 1 retry_check_interval 1 process_perf_data 1 } |
Download:
Nagios plugin for checking all elements (sensors) |
---|
This script takes parameters from SNMPTT (SNMP Trap Translator) or others, and appends this to the Nagios passive checking pipe.
For installation put this script to the Nagios plugins/eventhandlers folder
You must add a template for passive testing to the Nagios configuration file, and associate this template, for example, with a group of hosts:
## # Trap ## define service{ name trap-service use generic-service register 0 is_volatile 1 check_command check-host-alive ; Used to reset the status to OK when 'Schedule an immediate check of this service' is selected flap_detection_enabled 0 ; Flap detection is disabled process_perf_data 0 ; Do not Process performance data max_check_attempts 1 normal_check_interval 1 retry_check_interval 1 passive_checks_enabled 1 active_checks_enabled 0 ; Prevent active checks from occuring as we are only using passive checks check_period none notification_interval 31536000 notification_options w,u,c ; Notify on warning, unknown and critical contact_groups admins } define service{ use trap-service service_description Trap1 hostgroup_name sc-hosts } |
Download:
Script for Nagios passive checking |
---|
This script provides sending notifications from Nagios by by GSM modem of the master module.
Usage:
./sendsms -H <host> -p <password> -P <phone number> -m <message>
-H=hostname
name or IP address of the host to check
-u=user name
user name of mater module
-p=password
password for the user of the main module
-P=phone
phone number of the recipient
-m=message
message for sending
For installation, put this script in the Nagios plugins folder.
Add commands for SMS notification to Nagios commands file:
define command{ command_name notify-service-by-sms command_line $USER1$/sendsms -H 192.168.1.190 -p guest -P $CONTACTPAGER$ -m "Nagios – $NOTIFICATIONTYPE$ : $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" } define command{ command_name notify-host-by-sms command_line $USER1$/sendsms -H 192.168.1.190 -p guest -P $CONTACTPAGER$ -m "Nagios – $NOTIFICATIONTYPE$ : Host $HOSTALIAS$ is $HOSTSTATE$" } |
Add the notify command for contact to the Nagios configuration file as below:
define contact{ contact_name nagiosadmin ; Short name of user use generic-contact ; Inherit default values from generic-contact template (defined above) alias Nagios Admin ; Full name of user service_notification_options w,u,c,r host_notification_options d,u,r service_notification_commands notify-service-by-email,notify-service-by-sms host_notification_commands notify-host-by-email,notify-host-by-sms email nagios@localhost ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ****** pager +329999999999 ; <<***** CHANGE THIS TO YOUR PHONE NUMBER ****** } |
Download:
Script for Nagios notified by GSM modem |
---|
To allow us better support please leave your comments below or on our forum.