send_nsca scripts

Jan Scholten Jan.Scholten at iconz.net
Sun Nov 28 23:49:11 CET 2004


StinkyBob wrote:
> Does anyone have any example scripts for sending the output of plugins
> from a remote machine to the nagios server?  I have been successful at
> manually sending data to the server using send_nsca, but would like to
> see if anyone has any scripts that would help out.
I have a found a script in some mailinglist or boards:

#!/bin/bash
send_nsca=/usr/sbin/send_nsca
send_nsca_cfg=/etc/send_nsca.cfg
nagioshost=192.168.0.110
host=$1
service=$2
plugin=$3
warn=$4
crit=$5
output=`$plugin -w $warn -c $crit `
rc=$?
echo -e "$host\t$service\t$rc\t$output"|$send_nsca -H $nagioshost –c 
$send_nsca_cfg
exit 0



use it with
transmitdata.sh ConfigHostname ConfigService 
/usr/local/nagios/libexec/check_disk 10 5

Feel free to change or rewrite it!

Jan



> Thanks,
> -Stinky
> 
> ps.  i'm running nagios 1.2 on Solaris 8 monitoring other Solaris
> boxes and some FreeBSD machines.
> 
> 



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list