NSClient++ Help (#1) - Help writing a new Check (#77) - Message List

Help writing a new Check

I've written a simple Windows exe (using c#), which reads a file, compiles some info, and then returns the values (return code and message). The exe is invoked by a DOS BAT file, which NSCP invokes. My numeric return code seems to be making it back to the Monitor. However, the Monitor reports, "(No output returned from plugin)". The exe is simply doing a Console.WriteLine? for the string message and a return of the int value. I suspect that my problem is more of an issue between the exe and DOS, but am not sure. Any help is appreciated.

Thanks,

Chuck

  • Message #188

    I've continued to pick away at this, and am making my life a little easier by pulling out the BAT file portion of the equation. I am not invoking my exe directly via NRPE, which I probably should have done in the first place.

    In any event, I am still seeing only the effect of the numeric return code come back to the monitor, but not the status message. Again, I am performing a System.Console.WriteLine?("message") in my exe, but the string message doesn't seem to be making it's way back. Any ideas?

    Thanks,

    Chuck

    • Message #189

      Yes, I do talk to myself, and occasionally it's good conversation...<g>

      I've figured out my problem. In my exe, as I am creating the string to return to the nagios monitor, I was using newline characters between multiple messages. In any scenario (one line of message or multiple lines of messages), I had a leading newline character.

      I have since learned that nagios takes only one line for it's return value, i.e. up to the first newline character. Since mine was leading, all I returned was "no output".

      I have since changed my newline character to a html break, and all is well. Thanks for listening, ;)

      Chuck

      • Message #190

        haha...

        Yes indeed you have to have the output on a "single line", with nagios 3 (?) you can hame multiple lines returned but the first line have to be non-empty. But "old" nagios only supports a single line.

        MickeM

Subscriptions