[Nagiosplug-help] Nonprintable characters in check_tcp

Earl C. Ruby III earl at switchmanagement.com
Wed Apr 23 17:18:13 CEST 2003


Since Nagios is just sending whatever is on the command line to the plugin, if 
your OS supports null characters on the command line you should be able to 
send the character to Nagios.

I just tried:

perl -e 'print chr(255)'

... and that put something on my screen. Can't say for sure that it was a null 
character, but it may have been.

Anyhow, on a Linux/UNIX system if you pass the above line to your plugin 
enclosed in back-ticks Linux will shell out, run Perl, Perl will run 'print 
chr(255)', and the output will end up in your command line being passed to 
the plugin.

See if that works.

Alternately you could just use Perl to write a custom plugin that attaches to 
your IP:port and sends whatever characters you want, then returns "OK" or 
"CRITICAL".


On Wednesday 23 April 2003 09:28 am, Darren Gamble wrote:
> Good day,
>
> > On Wed, 23 Apr 2003, Darren Gamble wrote:
> > > Good day,
> > >
> > > I am attempting to configure the check_tcp plugin to check
> >
> > a custom TCP
> >
> > > service of ours.
> > >
> > > However, the string that the check needs to send to the
> >
> > service contains
> >
> > > nonprintable characters.  I've experimented with a number
> >
> > of ways to escape
> >
> > > them through the shell on the command line, but nothing works.
> > >
> > > I don't think there's any way to do this with the plugin,
> >
> > but, I thought
> >
> > > that there might be something that I haven't thought of (or
> >
> > if someone can
> >
> > > confirm that there is indeed no way to do this with the
> >
> > existing plugin).
> >
> > > Thanks in advance,
> >
> > Have you tried the url encoded string.
>
> I believe that you misread my message.  As I said, the service check is for
> a custom TCP service, not a HTTP get/post.  URL-encoded characters are
> useless to me.
>
> I need to send actual nonprintable characters, e.g. the null character.  Is
> there any way that this can be done?
>
> Thanks,
>
> ============================
> Darren Gamble
> Planner, Regional Services
> Shaw Cablesystems GP
> 630 - 3rd Avenue SW
> Calgary, Alberta, Canada
> T2P 4L4
> (403) 781-4948
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
>
> ::: Please include plugins version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null

-- 
Earl C. Ruby III <earl at switchmanagement.com>
Senior System Engineer / Developer
Switch Management




More information about the Help mailing list