[collectd] Collectd Nagios IP Socket

Lindsay Holmwood lindsay at holmwood.id.au
Fri Feb 15 05:15:49 CET 2013


On Friday, February 15, 2013, Crowder, Travis wrote:

>  Is there a way for Collectd and Nagios to play together over an IP
> socket instead of a Unix socket?
>
>  Nagios and Collectd live on different boxes in my setup.
>
>  Thanks!
>

I'm guessing you want your collectd-nagios Nagios checks to execute against
a remote collectd?

I have tackled this problem in two ways:

1. use socat to expose the unixsock over TCP on the collectd box, then do
the reverse on the Nagios box, e.g.

collectd-nagios => (socat unixsock to tcp client) => (socat tcp server to
collectd unixsock) => collectd unixsock => collectd

This works pretty well and is fairly straightforward to set up, but you'll
need to hack collectd's init script to reliably kill old socat processes
and start up new ones, lest you receive 1,000's of failing collectd-nagios
checks when you trigger a race condition.

It also starts getting tricky if you start needing to scale your Nagios
instances horizontally.

2. Use Visage* to expose the RRDs as JSON over HTTP, and write custom
monitoring checks to query this data and alert appropriately.

This gives you a lot of flexibility to alert more intelligently (e.g. alert
if >60% of the  CPU cores have been pegged at >95% for the last 5 minutes),
at the cost of having to write your own checks every time you want to
monitor something.

HTH,
Lindsay

* I am the primary author of Visage, so take anything I say with a grain of
salt


-- 
w: http://holmwood.id.au/~lindsay/
t: @auxesis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20130215/aa4ce88f/attachment.html>


More information about the collectd mailing list