Net::NSCA::Client Introduction

I have realized that I’ve never announced my Perl module Net::NSCA::Client. This module was created to make it easy for Perl applications to report to a NSCA server. NSCA (which stands for NetSaint Check Acceptor) is not very good at it’s job, but there is no replacement for it that I am aware of (though I hope to change this in the future).

I needed to be able to send reports back to NSCA easily from Perl programs (and without needing to go through the send_nsca program that comes with NSCA). I came across Net::Nsca, which mostly works, besides for the fact that I need to change the packet version in the code to 3 (which is not easy to do since it wasn’t made to be changed).

I decided to make my own NSCA client, using Moose and would be hopefully more flexible. A sort example of sending a report in some routine in a server would be:

sub nsca_heart_beat {
    my ($self) = @_;
        hostname => $self->hostname,
        service  => 'server',
        message  => 'Running',
        status   => $Net::NSCA::Client::STATUS_OK,

This is good and all, but not really a killer feature by any means. What really is a winner here is the Net::NSCA::Client::ServerConfig class that was added in version 0.007. One of the biggest problems with NSCA is that what is sent over the network is not portable. Yes, the data is made to be aligned in network order, but it actually sends a native C structure over the network. The problem is what happens when the server and client happen to compile different structures? This is what ServerConfig is for. It also makes it easy if it any of the constants defined in the NSCA source files were changed when NSCA was built. This client is the only one of the currently three others on the CPAN to support this.

I’ve currently been working on this module in my spare time and coming up is support for encryption methods besides XOR (like AES) as well as complete support for the standard send_nsca.cfg configuration file, plus much more.

Leave a Reply