Configuring Nagios object definitions
- Refer Here for the default Nagios configuration
Understanding how checks work
- Nagios requires all plugins to follow a specific, easy to follow behaviour
- Nagios relies on exit codes of the Nagios plugins
| Exit code | Status | Description |
|---|---|---|
| 0 | OK | Working correctly |
| 1 | WARNING | Working but needs attention |
| 2 | CRITICAL | Not working or requires attention |
| 3 | UNKNOWN | Plugin was unable to determine the status of host or service |
- Standard output from command is not parsed by Nagios and is usually formatted in the following way
PLUGIN STATUS - status description
-
Nagios plugins use options for their configuration
- -h, –help: This provides help
- -V, –version: This prints the version
- -v , –verbose: This prints the detailed information on what plugin is doing
- -t , –timeout
- -w, –warning
- -c, –critical
- -H, –hostname
- -4, –use-ipv4
- -6, –use-ipv6
-
All the network related plugins have the following standard option
- -p, –port
- -w, –warning
- -c, –critical
- -s, –send: This provides the string that will be sent to server
- -e, –expect: This provides the string that should be sent back from server
- -q, –quit: This provides the string to be sent to close the connection
- -S, –ssl
- -D, –certificate
Testing the connection to remote host
- For this we have check_ping plugin Refer Here for official documentation
- Creating the command for the host-alive
define command {
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 2000,50% -c 5000,60% -p 5
}
Testing the connectivity using TCP and UDP
- Refer Here for the official documentation
Testing the websites
- Refer Here for the official documentation of check_http plugin
Testing the databases
-
MySQL
- check_mysql Refer Here
- check_mysql_query Refer Here
-
PostgreSQL
- check_pgsql Refer Here
-
Oracle: Refer Here
-
For installing plugins Refer Here
-
Now we have a basic idea on how to use plugins to fetch the basic connectivity
-
Refer Here for sample commands written
Area of concern
- If we need to alert/notify the user on some details such as
- free disk space
- process
- CPU stress
