I need to monitor Linux host using NSCA, I have done it for Windows host and it works great. I have installed NSclient++ and then configured nsclient.ini (example commands below) and objects on Nagios server. I have installed NSclient++ for Linux but cannot figure out what commands I should use for Linux host in nsclient.ini as if I use Drive Usage that works fine for windows host I get below error on Linux host. Is there any sample commands for Linux nsclient.ini?
Host Name: 'localhost2', Service Description: 'Drive Usage', Return Code: '3', Output: 'Unknown command(s): checkdrivesize'
[/settings/scheduler/schedules]
CPU Load = checkCPU warn=80 crit=90 time=5m time=1m time=30s
Memory Usage = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical type=virtual type=paged type=page
Drive Usage = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED ShowAll=long
Thanks!
NSCA client Linux Host
Re: NSCA client Linux Host
In the newer version of NSClient, the checkdrivesize command was changed to check_drivesize
Try changing that in the config file and see if that fixes it for you.
Try changing that in the config file and see if that fixes it for you.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NSCA client Linux Host
Also, can you run this command and post the output?
This is the default location the NSClient installs the modules and if the check drive library isn't there, then that command will not work.
Code: Select all
ls -l /usr/lib/nsclient/modules/Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NSCA client Linux Host
Ok, I've installed NSclient++ below are the nsclient/modules. Seems I cannot monitor Disk using NSCA the same way I can do on Windows client. Is there any documentation/guide on how to Monitor Linux server using Passive checks via NSCA? or is there any example command that I can put in nsclient.ini on Linux host that works, at least it would give me starting point? Basic check for host alive or CPU usage as whichever command I try it says unknown command, log at the end.Thanks, indeed that was it, no check_drivesize or diskcheck module in there. I'll try again installing Agent.
libCauseCrashes.so libCommandClient.so libPythonScript.so
libCheckExternalScripts.so libGraphiteClient.so libSamplePluginSimple.so
libCheckHelpers.so libLUAScript.so libScheduler.so
libCheckLogFile.so libNRDPClient.so libSimpleCache.so
libCheckMKClient.so libNRPEClient.so libSimpleFileWriter.so
libCheckMKServer.so libNRPEServer.so libSMTPClient.so
libCheckNet.so libNSCAClient.so libSyslogClient.so
libCheckNSCP.so libNSCAServer.so libWEBServer.so
libCheckSystemUnix.so libNSClientServer.so
Example of My Windows nsclient.ini
[/settings/scheduler/schedules]
CPU Load = checkCPU warn=80 crit=90 time=5m time=1m time=30s ShowAll=long
Memory Usage = checkMem MaxWarn=80% MaxCrit=90% ShowAll=long type=physical
Drive Usage = CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED
Operating System Version = CheckWMI "Query=Select Version,Caption from win32_OperatingSystem"
[root@nagios ~]# tail -f /var/log/messages | grep nsca
May 7 21:00:39 nagios nsca[4055]: SERVICE CHECK -> Host Name: 'xxxxxxxxx', Service Description: 'Drive Usage', Return Code: '3', Output: 'Unknown command(s): check_drivesize'
May 7 21:00:39 nagios nsca[4055]: Attempting to write to nagios command pipe
May 7 21:00:39 nagios nsca[4055]: End of connection...
May 7 21:00:39 nagios xinetd[1413]: EXIT: nsca status=0 pid=4055 duration=0(sec)
May 7 21:00:41 nagios xinetd[1413]: START: nsca pid=4056 from=::ffff:xxxxxxxx
May 7 21:00:41 nagios nsca[4056]: Handling the connection...
May 7 21:00:41 nagios nsca[4056]: Time difference in packet: 0 seconds for host xxxxx.xxxxx
May 7 21:00:41 nagios nsca[4056]: SERVICE CHECK -> Host Name: 'xxxx.xxxxx', Service Description: 'Memory Usage', Return Code: '3', Output: 'Unknown command(s): checkmem'
May 7 21:00:41 nagios nsca[4056]: Attempting to write to nagios command pipe
May 7 21:00:41 nagios nsca[4056]: End of connection...
May 7 21:00:41 nagios xinetd[1413]: EXIT: nsca status=0 pid=4056 duration=0(sec)
May 7 21:00:46 nagios xinetd[1413]: START: nsca pid=4057 from=::ffff:xxxxxxxxxx
May 7 21:00:46 nagios nsca[4057]: Handling the connection...
May 7 21:00:46 nagios nsca[4057]: Time difference in packet: 0 seconds for host xxxxx.xxxxxxx
May 7 21:00:46 nagios nsca[4057]: SERVICE CHECK -> Host Name: 'xxxxxxx.xxxxxx', Service Description: 'CPU Load', Return Code: '3', Output: 'Unknown command(s): checkcpu'
May 7 21:00:46 nagios nsca[4057]: Attempting to write to nagios command pipe
May 7 21:00:46 nagios nsca[4057]: End of connection...
May 7 21:00:46 nagios xinetd[1413]: EXIT: nsca status=0 pid=4057 duration=0(sec)
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: NSCA client Linux Host
I played around with the Linux version of NSClient++ a while ago and from memory there wasn't modules that did disk checks. I think at this point the Linux version is still in it's infancy.superhik wrote:Seems I cannot monitor Disk using NSCA the same way I can do on Windows client. Is there any documentation/guide on how to Monitor Linux server using Passive checks via NSCA? or is there any example command that I can put in nsclient.ini on Linux host that works, at least it would give me starting point?
I would look at using NRDP instead if you are interested in passive checks in linux.
https://support.nagios.com/kb/article.php?id=262
Does this help?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: NSCA client Linux Host
I will check NRDP setup as it seems way forward. I have quite few Windows servers monitored using NSCA, is it possible to have both NRDP & NSCA on Nagios Core without breaking it? For now I'm monitoring Linux (Apache web server) using external IP and check_http which at least tells me the server is alive.
Thanks for the help!
Thanks for the help!
Re: NSCA client Linux Host
Absolutely! They both use different ports so there is no issue.superhik wrote:is it possible to have both NRDP & NSCA on Nagios Core without breaking it?
Former Nagios employee