12345678910111213141516171819202122232425262728293031323334353637 |
- #!/usr/bin/perl -w
- # asr - Gaetan Ryckeboer - 2014
- #
- # Nagios notification to irssi handler
- # Based on capture_plugin.pl v1.0 from Wolfgang Wagner, 2007.
- #
- use strict;
- my $FIFO="/home/tc-14/var/nagios-fifo";
- $FIFO = shift;
- # This plugin does not need any nagios utils. It just interfaces the original plugin.
- my ($cmd, $ret_code, $output);
- # First display all arguments
- my ($numArgs, $argnum);
- $numArgs = $#ARGV + 1;
- # create the command-line
- $cmd = "";
- $cmd = join " ", @ARGV;
- #print "$cmd\n";
- # log the start, output, retcode & end
- my $LogFile;
- # open could be better: check success later; if unsuccessful return UNKNWON to Nagios
- open (LogFile, ">>$FIFO") || die ("Cannot open logfile");
- print LogFile "$cmd\n";
- close(LogFile);
- # avoid access problems for others.
- #chmod 0777, $LOG_FILE;
- exit 1;
|