Notes On Nagios Configurations
- by Joe Jr Yamut
The last 2 days I was setting up Nagios to monitor a few local and public servers on both Linux and Windows OS. For Linux, everything was smooth-sailing. Other than some typos in the configuration file, I hardly encountered any issues at all. Most of the issues I’ve encountered so far were on Windows servers. These are the few things I’ve found out.
(1) When you explicitly set a command (with parameters) for one of the plugins, DO NOT use the same name as the plugin name in the command_name value.
define command{command_name    check_ntcommand_line    /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -p 12489 -s BukitBatok23 -v USEDDISKSPACE -l C -w 80 -c 90}
The above always caused an error after you restart the Nagios service. Name it to something else, like on #2 below. Â While not using the same name may be common sense, some guides I have read actually are using the same name in their examples which can be a cause for confusion.
(2) During the installation, if you placed a password for NSClient++ on the Windows server, that means you have to use that password whenever you are trying to do any of the check_nt commands. Some tutorials are not very clear on this or leave it out at the last part where it can be easily missed.
You can individually define a custom check_nt command in the configuration file like below:
define command{command_name   check_nt_diskusagecommand_line    /usr/lib/nagios/plugins/check_nt -H $HOSTADDRESS$ -p 12489 -s PASSWORD -v USEDDISKSPACE -l C -w 80 -c 90}
*Make sure to change the password to the one you set during the NSClient++ installation.
*Note that I am using the full path to the check_nt plugin executable to avoid getting that error where Nagios cannot find the command. On some guides I have read, they say that you have to give ownership of these plugins to Nagios user to solve the issue. Others prefer to just include the full path. I opted for the latter.
(3) Gives an error when using a “\” in the service_description.
define service{
use           generic-service
host_name        windows-2k8-1
service_description   Drive Space C:\
check_command      check_nt_diskusage
}
A backslash at the end of the line causes an error from my tests. Â However if you put some text after it, there are no issues, like so:
service_description   Drive Space C:\ SOME_TEXT_AFTER
The servers I used are Ubuntu 12.04, CentOS 6 and Windows 2008 R2 with Nagios 3.
Similar Posts:
- > “PROGRAM_NAME” Is Not Recognized As An Internal Or External Command, Operable Program Or Batch File December 20, 2013
- > When Remmina Can No Longer Connect To Remote Server October 2, 2013
- > password-less ssh logins June 8, 2007
- > I Forgot My Linux Desktop Password! June 17, 2022
- > Error: uncaught exception: Permission denied to call method XMLHttpRequest.open February 7, 2007
The last 2 days I was setting up Nagios to monitor a few local and public servers on both Linux and Windows OS. For Linux, everything was smooth-sailing. Other than some typos in the configuration file, I hardly encountered any issues at all. Most of the issues I’ve encountered so far were on Windows servers.…