NSClient++ Help (#1) - Help writing a new Check (#77) - Message List
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.
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?
ChuckChuck01/12/08 23:17:43 (5 years ago)
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, ;)
ChuckChuck01/13/08 12:47:17 (5 years ago)