send_nsca without Perl


Hello guys,

I’have a trouble with send_nsca.
I’d like to run send_nsca plugin without perl because my box is hardened, so there isn’t perl and gcc :frowning: .

Exist a little .sh client ? how can i perform that task?

Thank you in advanced :cry:


I’m a bit confused, send_nsca is a compiled c program, no need for perl. Are you looking for an example of invoking it using a shell script? If so, here you go:


/usr/local/nagios/libexec/check_somecommand | /usr/local/nagios/bin/send_nsca -H -c /usr/local/nagios/etc/send_nsca.cfg 2>&1 >> /dev/null

and then for libexec/check_somecommand, for example, one that counts the number of processes and warns if less than 5 and goes critical if less then 2 (example only, doesn’t take into account that some ps’s throw in a header line):


SERVNAME=“Bogus Service Name”

numprocs=ps ax | wc -l


if “$numprocs” -lt 2 ]] ; then

outtext=“Critical! Not many processes at all!”

elif “$numprocs” -lt 5 ]] ; then

outtext=“Warning! Too few processes, run some more!”


outtext=“Ahh, just right.”


echo -e “$HOST\t$SERVNAME\t${outcode}\t${outtext}\n”


Edited Wed Dec 28 2005, 11:24PM ]


Thank you mh720,

There are three version of send_nsca , .pl .c and .exe.
I done a little bash script with all paramenters to send to nscad but the client doesn’t works because I can’t use perl fo or gcc to compile nsca.c.