Home Directory Plugins Others check_inivalue.pl

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_inivalue.pl

Rating
0 votes
Favoured:
0
Current Version
0.2.3
Hits
92709
Files:
FileDescription
check_inivalue.pl-v0.2.3.tar.gzcheck_inivalue.pl-v0.2.3.tar.gz
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
If you have to verify a value in an ini foramted file, feel free to try check_inivalue.pl (actual version 0.2.3 for tests only). With check_inivalue.pl you can verify the value for a defined key in a defined section of an ini file.
If the value is a number (float) it is possible to get performance data with a label defined by you.

This Plugin comes AS IS with ABSOLUTELY NO WARRANTY! You may redistribute copies of the plugin 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.

check_inivalue.pl - HowTo:
-----------------------------------------------------

Usage: $PROGNAME [-i infile] [-s section] [-k key] [-o OK_Value] [-w or -W WARNING_Value] [-c or -C CRTICAL_Value ] [-l LABEL]

Options:

-i --infile STRING
Path and file name to the ini/config file.
-s --section STRING
String to identify the ini/config Section.
-k --key STRING
String to identify the key of the value.
-o --ok STRING
Value for OK.
-w --warning STRING
Value for WARNING.
-c --critical STRING
Value for CRITICAL.
-W --WarnFloat FLOAT
Threshold for WARNING.
-C --CritFloat FLOAT
Threshold for CRITICAL.
-l --label STRING
String for label the performance data.
-h --help
Using this option to show this help info.

Attention:

-i, -s and -k are necessary!

The options -o and/or -w and/or -c are necessary if you want to check for a string value.
If only -w or -c are defined all other values end in OK State.
If -o and/or -w are defined (not -c) all values other then in this defined options end in CRITICAL State.
If -o and -c are defined (not -w) all values other then in this defined options end in WARNING State.
If -o and -w and -c are defined all values other then in this defined options end in UNKNOWN State.
(While checking for a string the options --WarnFloat and --CritFloat will be ignored)!

The options -W and/or -C are necessary if you want to check for a float value.
If only -W is defined, all values higher or equal will end in WARNING State.
If only -C is defined, all values higher or equal will end in CRITICAL State.
If -W and -C are defined and the value is between, it end in WARNING State.
If the option for -W is higher then for -C :
A value higher then the option defined by -W end in OK State.
Is the value less or equal the option defined by -C it end in CRITICAL State.
(Do not use -o, -w and/or -c if you want to check for float values)!


[Command Definition Examples - start]
# 'check_inivalue_string' command definition
define command{
command_name check_inivalue_string
command_line /usr/lib/nagios/plugins/custom/check_inivalue.pl -i $ARG1$ -s $ARG2$ -k $ARG3$ -o $ARG4$ -w $ARG5$
}

# 'check_inivalue_float' command definition
define command{
command_name check_inivalue_float
command_line /usr/lib/nagios/plugins/custom/check_inivalue.pl -i $ARG1$ -s $ARG2$ -k $ARG3$ -W $ARG4$ -C $ARG5$ -l $ARG6$
}
[Command Definition Examples - end]

[Service Check Definition Examples - start]
# 'Ini Value String' service check definition
define service{
use local-service
host_name localhost
service_description Ini Value String
check_command check_inivalue_string!/data/example.ini!Server-01!Cluster!Primary!Secondary
}

# 'Ini Value Float' service check definition
define service{
use local-service
host_name localhost
service_description Ini Value Float
check_command check_inivalue_float!/data/example.ini!Server-02!Temp!28.5!33.5!Temperature
}
[Service Check Definition Examples - end]

[INI File Example - start]
[Server-01]
Cluster=Secondary

[Server-02]
Temp=34.7
[INI File Example - end]

[check_inivalue.pl Output Example - start]
WARNING: Cluster=Secondary

CRITICAL: Temp=34.7|Temperature=34.7;28.5;33.5;;
[check_inivalue.pl Output - end]