Page 1 of 2
Nagios XI monitoring Mac OS X via agent
Posted: Tue Oct 28, 2014 3:17 pm
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
Re: Nagios XI monitoring Mac OS X via agent
Posted: Tue Oct 28, 2014 4:15 pm
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.
Re: Nagios XI monitoring Mac OS X via agent
Posted: Tue Oct 28, 2014 5:00 pm
by abrist
Which agent and what version of the agent are you running?
Re: Nagios XI monitoring Mac OS X via agent
Posted: Wed Oct 29, 2014 9:11 am
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.
Re: Nagios XI monitoring Mac OS X via agent
Posted: Wed Oct 29, 2014 9:36 am
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.
Re: Nagios XI monitoring Mac OS X via agent
Posted: Wed Oct 29, 2014 5:02 pm
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!
Re: Nagios XI monitoring Mac OS X via agent
Posted: Wed Oct 29, 2014 5:03 pm
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
Re: Nagios XI monitoring Mac OS X via agent
Posted: Mon Nov 03, 2014 2:41 pm
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.
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.
Re: Nagios XI monitoring Mac OS X via agent
Posted: Mon Nov 03, 2014 5:07 pm
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.
Re: Nagios XI monitoring Mac OS X via agent
Posted: Tue Nov 04, 2014 1:31 pm
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?