NSCA client Linux Host

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
superhik
Posts: 19
Joined: Sun Sep 06, 2015 8:10 am

NSCA client Linux Host

Post by superhik »

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!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NSCA client Linux Host

Post by tgriep »

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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: NSCA client Linux Host

Post by tgriep »

Also, can you run this command and post the output?

Code: Select all

ls -l /usr/lib/nsclient/modules/
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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
superhik
Posts: 19
Joined: Sun Sep 06, 2015 8:10 am

Re: NSCA client Linux Host

Post by superhik »

Thanks, indeed that was it, no check_drivesize or diskcheck module in there. I'll try again installing Agent.
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.

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)
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: NSCA client Linux Host

Post by Box293 »

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 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.

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.
superhik
Posts: 19
Joined: Sun Sep 06, 2015 8:10 am

Re: NSCA client Linux Host

Post by superhik »

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!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NSCA client Linux Host

Post by tmcdonald »

superhik wrote:is it possible to have both NRDP & NSCA on Nagios Core without breaking it?
Absolutely! They both use different ports so there is no issue.
Former Nagios employee
Locked