Page 1 of 1

Common Error I find with Many Plugins - Desperate to solve..

Posted: Wed Jul 17, 2019 11:15 am
by LAINFOSEC
So far, Nagios XI has been a stellar project. After working for a very large billion dollar corp working in their DC, using many different custom monitoring tools, Nagios has really shined in my eyes.

However, I do run into a lot of bumps, but fortunately, there is usually a solution.

This particular issue though, I come across it in many many plugins and its becoming a bit frustrating. Here is the error:

Code: Select all

(No output on stdout) stderr: /bin/sh: -c: line 0: unexpected EOF while looking for matching `''

/bin/sh: -c: line 1: syntax error: unexpected end of file
Now, the error is obvious in someways especially if you code. I noticed that sometimes when installing a new plugin, somehow in the $ARG$ the string you write out gets chopped off. In my experience its like the last 3 character, one of those character usually being and en quote. So I just add it back in, save, and viola, it works.

Sometimes though, like today, I installed the NRDP agent, got it configured, force checked all the services and they returned what I needed, all is looking good...then a few minutes later, they all take a dump and pop this alert. I checked the $ARG$ where the token was spelled out to be passed, and everything seemed fine. No missing characters or quotes.

So why does this happen in various different plugins and how do I mitigate it? Its quite the headache.

Thank you for your time!

Re: Common Error I find with Many Plugins - Desperate to sol

Posted: Wed Jul 17, 2019 11:40 am
by LAINFOSEC
Update:

I changed the token to a one that doesnt have special characters in it and it seems fine. Is this a sensitive matter in Nagios plugins because various languages require special character to be escaped?

Re: Common Error I find with Many Plugins - Desperate to sol

Posted: Wed Jul 17, 2019 1:40 pm
by tgriep
When using special characters in Nagios Arguments, they do need to be escaped for the command to function.

This KB article has some examples that you can try.
https://support.nagios.com/kb/article/n ... s-580.html

For me, putting the string with the special characters between single quotes '' works for most of the commands.