best way to run remote shell on critical

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: best way to run remote shell on critical

Post by agriffin »

Does your command print any output to stdout? If it only prints to stderr this message is expected. It looks like the command is getting run successfully; it's just not receiving the output from the command.
lraymond
Posts: 29
Joined: Thu Jul 12, 2012 10:14 am

Re: best way to run remote shell on critical

Post by lraymond »

Wish it was the case. There is text that get's output to the screen by default saying it's restarting, but there is nothing being written to the log. I even removed the restart process, so the local restart script looks like this;

Code: Select all

#!/bin/bash
case "$1" in
    CRITICAL )
        : 
         ts=`date "+%F - %H:%M"`
          echo restart:  $ts >> /home/nagios/glassfish_restart.log
        ;;
    * )
        exit
esac
I made that file r+w by everyone, put it in the nagios home folder, ran the check script from the server, same error and that log file not written to. I run it local as root and as nagios;
restart: 2012-08-22 - 18:17

instantly appears.... this will be the death of me!
Locked