[Nagiosplug-help] Nagios plugins , IFS

Subhendu Ghosh sghosh at sghosh.org
Wed Dec 17 09:32:06 CET 2003


On Wed, 3 Dec 2003, Garrett, Matt M SITI-ITDIEEE wrote:

> Folks
> 
> Note sure if this is possible or not.
> 
> All Nagios plugins return there text with spaces in between the text fields.
> Which is great to be able to read.
> 
> However my Automated logging system (Service Centre , via PEM)
> Require the test to be in one line e.g have a underscore character in it
> 
> Is there are easy way to change the plugins to support different Internal Field Separators IFS
> 
> 
> The way I have round it is to have a shell script do something like
> #!/bin/ksh
> 
> # Script to just get the ssh bits we need and use IFS _ for Service Center.
> 
> SSH=`/local/nagios/libexec/check_ssh $1`
> STATUS=$?
> echo "$SSH " | awk '{print $2"_"$3}'
> exit $STATUS
> 
> While the above works fine.
> It does mean making shell scripts for each check plugin that I need to use.
> 
> Is there a better way of doing this ?
> 

No the script is the best way to do it. 

You might just sed the line s/\s/_/g

-- 
-sg





More information about the Help mailing list