Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageperl
titlecheck-nagios-alive.pl
#!/usr/bin/perl
        $vHostName = "ks-monitor-1";
        $vServiceDescription = "Nagios Alive";
        $vNagiosServer = "monitor-a.gutzmann.com";
        $vResult = `/usr/local/nagios/libexec/check_procs -C nagios -c 1:-1``;
        $vStatus = $?;
        if ($vStatus == 0) {
                $vCode = "0";
        } else {
                $vCode = "2";
        }
        $vMessage = "$vHostName\t$vServiceDescription\t$vCode\t$vResult\n";
        open(SEND,"|/usr/sbin/send_nsca $vNagiosServer -c /etc/nagios/send_nsca.cfg") || die "Could not run $send_nsca: $!\n";
        print SEND $vMessage;
        close SEND;
        printf $vMessage;

...