Skip to content

Instantly share code, notes, and snippets.

@MiLk
Created January 22, 2014 12:39
Show Gist options
  • Save MiLk/8558047 to your computer and use it in GitHub Desktop.
Save MiLk/8558047 to your computer and use it in GitHub Desktop.
Use Nagios query handler with Node.js
var net = require('net');
var test_message = "TestMessage";
var client = net.connect({ path: '/var/nagios/rw/nagios.qh' }, function() {
client.write('@echo ' + test_message + '\0');
});
client.on('data', function(data) {
console.log(data.toString());
client.end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment