<br><br>On Friday, February 15, 2013, Crowder, Travis wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>Is there a way for Collectd and Nagios to play together over an IP socket instead of a Unix socket?</div>
<div><br>
</div>
<div>Nagios and Collectd live on different boxes in my setup.</div>
<div><br>
</div>
<div>Thanks!</div></div></blockquote><div><br></div><div>I'm guessing you want your collectd-nagios Nagios checks to execute against a remote collectd?</div><div><br></div><div>I have tackled this problem in two ways:</div>
<div><br></div><div>1. use socat to expose the unixsock over TCP on the collectd box, then do the reverse on the Nagios box, e.g. </div><div><br></div><div>collectd-nagios => (socat unixsock to tcp client) => (socat tcp server to collectd unixsock) => collectd unixsock => collectd</div>
<div><br></div><div>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. <span></span></div>
<div><br></div><div>It also starts getting tricky if you start needing to scale your Nagios instances horizontally. </div><div><br></div><div>2. Use Visage* to expose the RRDs as JSON over HTTP, and write custom monitoring checks to query this data and alert appropriately. </div>
<div><br></div>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. <div>
<br></div><div>HTH,</div><div>Lindsay</div><div><br></div><div>* I am the primary author of Visage, so take anything I say with a grain of salt</div><br><br>-- <br>w: <a href="http://holmwood.id.au/~lindsay/">http://holmwood.id.au/~lindsay/</a><br>
t: @auxesis<br><br>