define service{
use generic-service
host_name BTP
service_description SQL
check_command check_mssql_database.py -H BTP -U nagios -P XXXX -T XXXXXX -p 1433 --cpu -w 50 -c 80
}
not working. I use Nagios Core.
Please,can someone give me an example of how to define the service of this plugins?
mssql_server.py
Thanks
mssql_server.py
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: mssql_server.py
First you need to make a command definition
See:
such as
then you would change your check_command to something like this
The plugin I have has the following usage, but yours may vary
See:
Code: Select all
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/objectdefinitions.html#command
Code: Select all
define command {
command_name check_mssql_database
command_line $USER1$/check_mssql_database.py -H $HOSTADDRESS$ $ARG1$
}
Code: Select all
check_command check_mssql_database!-U nagios -P XXXX -T XXXXXX -p 1433 -w 50 -c 80 --activetrans
Code: Select all
# /usr/local/nagios/libexec/check_mssql_database.py -h
Usage: check_mssql_database.py -H hostname -U user -P password -T table --mode
Options:
-h, --help show this help message and exit
Required Options:
-H HOSTNAME, --hostname=HOSTNAME
Specify MSSQL Server Address
-U USER, --user=USER
Specify MSSQL User Name
-P PASSWORD, --password=PASSWORD
Specify MSSQL Password
-T TABLE, --table=TABLE
Specify the table to check
Optional Connection Information:
-I INSTANCE, --instance=INSTANCE
Specify instance
-p PORT, --port=PORT
Specify port.
Nagios Plugin Information:
-w WARNING, --warning=WARNING
Specify warning range.
-c CRITICAL, --critical=CRITICAL
Specify critical range.
Mode Options:
--logshrinks Log Shrinks
--transpsec Transactions Per Second
--logfileusage Log File Usage
--logwait Log Flush Wait Time
--datasize Database Size
--activetrans Active Transactions
--logflushes Log Flushes Per Second
--logcachehit Log Cache Hit Ratio
--loggrowths Log Growths
--test Run tests of all queries against the database.
--time2connect Time to connect to the database.
--logtruncs Log Truncations