Monitoring MAC OS

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Monitoring MAC OS

Post by paulol »

Im monitoring some MAC machines with NRPE. I created the host and services with the wizard "MAC OS X" but the memory usage doesnt show anything, only swap.

Follows the image.
You do not have the required permissions to view the files attached to this post.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitoring MAC OS

Post by hsmith »

What version of NRPE / Nagios Plugins are you using?
Former Nagios Employee.
me.
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Re: Monitoring MAC OS

Post by paulol »

User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitoring MAC OS

Post by hsmith »

Can you run this from the command line?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H IPADDRESSOFYOUROSXMACHINE -c check_mem -a '-w 10 -c 5'
Former Nagios Employee.
me.
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Re: Monitoring MAC OS

Post by paulol »

[root@DOUAI libexec]# ./check_nrpe -H 192.168.0.71 -c check_mem -a '-w 10 -c 5'
OK: Memory Usage - % RAM, 19.82% Swap | phyUsed=%;10;5;0;100 swpUsed=19.82%;;;0;100
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring MAC OS

Post by lmiltchev »

The "check_mem" uses the "check_osx_mem.sh" plugin. As far as I remember, this used to work. I am not sure what changed, i.e. a new version of "top" or "bc"... Log into the OSX box, run the following command, and show us the output:

Code: Select all

/usr/local/nagios/libexec/check_osx_mem.sh -v
Be sure to check out our Knowledgebase for helpful articles and solutions!
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Re: Monitoring MAC OS

Post by paulol »

Following the result.
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring MAC OS

Post by lmiltchev »

I was able to recreate the issue:

Code: Select all

sh-3.2# ./check_osx_mem.sh -v
expr: syntax error
(standard_in) 1: parse error
pctPhyUsed=
(standard_in) 1: parse error
pctPhyAllUsed=
pctSwpUsed=60.05
rawOutput=0
pctWarning=
pctCritical=
pctSwpWarning=
pctSwpCritical=
OK: Memory Usage - % RAM, 60.05% Swap | phyUsed=%;;;0;100  swpUsed=60.05%;;;0;100
I spoke to one of our developers, and I was told that the plugin no longer shows the correct output, because of some changes made by apple. It will take some time before the plugin is fixed/patched.

I noticed that in addition to the issues I see (in my output), you also have an "illegal character: M" error. Did you try to modify this plugin in a text editor?
Be sure to check out our Knowledgebase for helpful articles and solutions!
paulol
Posts: 159
Joined: Wed Jul 02, 2014 11:39 am

Re: Monitoring MAC OS

Post by paulol »

No, i didnt make any change in this files. I just downloaded and installed.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Monitoring MAC OS

Post by lmiltchev »

I see. I filed an internal bug report to our system (TASK ID 7839). It is up to our developers now to fix/patch the plugin. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked