Nagios XI monitoring Mac OS X via agent

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
adny
Posts: 11
Joined: Tue Oct 28, 2014 3:05 pm

Nagios XI monitoring Mac OS X via agent

Post by adny »

I've successfully compiled and installed the agent on one OS X instance, but hoped I'd be able to use Casper Composer to capture the installed files and create a .pkg installer that would be able to distribute it to the other 200+ OS X installs it'll need to be on.

And that's where this plan comes undone. Launchctl on the machine I've attempted the installer on reports that nrpe is running, however any attempts to monitor services are met with "(Return code of 255 is out of bounds)"

Is there a package installer available anywhere, or am I perhaps missing dependencies? I'm hoping I don't have to install Xcode and the CLI Tools on all these servers, as it's absolutely not required for anything else.

Edit:

The command below works to at least force the config on, but I'm still getting one or two services showing out of bounds.

Code: Select all

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
adny
Posts: 11
Joined: Tue Oct 28, 2014 3:05 pm

Re: Nagios XI monitoring Mac OS X via agent

Post by adny »

Attempted to change the launchDaemon to load at a timed interval, to no avail.

Here are some console logs from the system:

Code: Select all

10/28/14 1:48:09.500 PM com.apple.launchd[1]: (org.nagios.nrpe[101]) getpwnam("nagios") failed
10/28/14 1:48:09.502 PM com.apple.launchd[1]: (org.nagios.nrpe[101]) Job failed to exec(3). Setting up event to tell us when to try again: 3: No such process
10/28/14 1:48:09.502 PM com.apple.launchd[1]: (org.nagios.nrpe[101]) Job failed to exec(3) for weird reason: 3
10/28/14 1:50:59.748 PM com.apple.launchd[1]: (org.nagios.nrpe[273]) getpwnam("nagios") failed
10/28/14 1:50:59.749 PM com.apple.launchd[1]: (org.nagios.nrpe[273]) Job failed to exec(3). Setting up event to tell us when to try again: 3: No such process
10/28/14 1:50:59.749 PM com.apple.launchd[1]: (org.nagios.nrpe[273]) Job failed to exec(3) for weird reason: 3
If I run the command

Code: Select all

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
it absolutely starts working.



…But obviously, I *need* this to work after reboots.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios XI monitoring Mac OS X via agent

Post by abrist »

Which agent and what version of the agent are you running?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
adny
Posts: 11
Joined: Tue Oct 28, 2014 3:05 pm

Re: Nagios XI monitoring Mac OS X via agent

Post by adny »

Downloaded with the 'Agent Download' link from an XI VM running 2014R1.5:

Code: Select all

http://assets.nagios.com/downloads/nagiosxi/agents/macosx-nrpe-agent.tar.gz
According to the index of that directory, the version last updated 12-Aug-2014 10:38.

I'm not sure how to find the version from the OS X agent itself, but it seems as though I'm using the latest one.

The test VM is 10.9.5, but I'm going to be testing this - and intend to roll it out - on 10.6.8 and 10.8.5 Server installs.
adny
Posts: 11
Joined: Tue Oct 28, 2014 3:05 pm

Re: Nagios XI monitoring Mac OS X via agent

Post by adny »

While setting up other VMs I've noticed that one of my two 10.9 tests are working.

10.9.5 VM1: Installed and compiled on this, which after reboots is still running nrpe fine.
10.9.5 VM2: Installed via created pkg. Works fine if manually started, but seems unable to run on boot.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagios XI monitoring Mac OS X via agent

Post by sreinhardt »

When you say it works fine when manually started, is that via the bin directly or an init script like linux service or init commands? I'm not sure of an alternative route for mac in terms of installation, but NCPA might be a worthwhile agent to checkout. If you need to build on newer mac systems, the https://github.com/NagiosEnterprises/ncpabuild should have all the needed instructions!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios XI monitoring Mac OS X via agent

Post by lmiltchev »

We always recommend using our documentation (methods) for installing agents. Did you actually follow the document, listed below?

http://assets.nagios.com/downloads/nagi ... _Agent.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
adny
Posts: 11
Joined: Tue Oct 28, 2014 3:05 pm

Re: Nagios XI monitoring Mac OS X via agent

Post by adny »

sreinhardt wrote:When you say it works fine when manually started, is that via the bin directly or an init script like linux service or init commands? I'm not sure of an alternative route for mac in terms of installation, but NCPA might be a worthwhile agent to checkout. If you need to build on newer mac systems, the https://github.com/NagiosEnterprises/ncpabuild should have all the needed instructions!
My last 'working fine' was via launchd. I now have nrpe working fine over 10.8, 10.9 and 10.10. Just needing to get it working on 10.6, but it's not starting correctly.

Is NCPA intended as a replacement for nrpe? Is there a pre-packaged installer available? As mentioned, I'm needing to monitor hundreds of Mac OS X servers, many with SSDs, and hopefully, without having to set up Xcode and the command line developer tools on every machine just to be able to monitor. Hence setting up an installer package of my own if one isn't publicly available.

lmiltchev wrote:We always recommend using our documentation (methods) for installing agents. Did you actually follow the document, listed below?

http://assets.nagios.com/downloads/nagi ... _Agent.pdf
Yes. I've followed it successfully for 10.8, 10.9 and 10.10, however I'm unable to make it work on 10.6.8.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios XI monitoring Mac OS X via agent

Post by abrist »

adny wrote:10.6.8.
As we do not have a mac system of this version in house, it will be hard to fix the install for it - posting the current error on install or service start would help.

NCPA was necessarily developed as a replacement to NRPE, but it can definitely be used as such. It relies on python and should not require the whole dev sdk/kit that nrpe requires on the mac OS 10.x platforms.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
adny
Posts: 11
Joined: Tue Oct 28, 2014 3:05 pm

Re: Nagios XI monitoring Mac OS X via agent

Post by adny »

abrist wrote:
adny wrote:10.6.8.
As we do not have a mac system of this version in house, it will be hard to fix the install for it - posting the current error on install or service start would help.
There's no specific error. The daemon appears to be running, however I get

Code: Select all

(Return code of 255 is out of bounds)
...for all 10.6.8 monitored services.

Do you have access to a 10.6 installer DMG or DVD? If so, licensing allows for installing in VMware or Parallels on an OS X host.

abrist wrote:
adny wrote:NCPA was necessarily developed as a replacement to NRPE, but it can definitely be used as such. It relies on python and should not require the whole dev sdk/kit that nrpe requires on the mac OS 10.x platforms.
I've delved in to attempting to install both NCPA via ncpabuild and via the DMG. Neither work.

As an example:
https://github.com/NagiosEnterprises/nc ... tobuild.sh

...is unfinished. There are hard links to a 'techteam' user and missing files/dependencies. Looking in to the autobuild.sh file, we see it's looking for 'build' and other files not present in the download from Github.

At this stage I'm wondering if XI is suitable as both NRPE and NCPA are, in their own ways, half-baked on the most common platform my client uses (well in to the hundreds) - and they've purchased a license already. I'd love to see an installer that could be silently rolled out (such as I've successfully created for 10.8, 10.9 and 10.10 for NRPE) but what are the chances?

It's unrealistic to install the OS X development tools on each of these servers, as previously mentioned. Perhaps the best thing is to spend time writing SSH checks (instead of attempting agent setup/install) to at least get them up and running, and actually using their purchase the way it was intended?
Locked