bash shell script as plugin?
Gerald Wichmann
gwichman at zantaz.com
Thu Nov 14 02:23:45 CET 2002
Funny I couldn't get it to work using -norc --.. didn't like the "-" and got
the same error without the "-" but with the "-norc". Anyways in reading the
docs I noticed -norc is automatic if you do #!/bin/sh instead of #!/bin/bash
and changed it. Works perfectly now.
Gerald Wichmann
Senior Systems Development Engineer
Zantaz, Inc.
925.598.3099 (w)
-----Original Message-----
From: Michael Loftis [mailto:mloftis at wgops.com]
Sent: Wednesday, November 13, 2002 4:48 PM
To: Nagios (E-mail)
Subject: Re: [Nagios-users] bash shell script as plugin?
You have to tell bash not to try loading the profile information...
#!/bin/bash --norc --
That or give the user it's running as an invalid homedir.
--On Wednesday, November 13, 2002 3:49 PM -0800 Gerald Wichmann
<gwichman at zantaz.com> wrote:
>
>
> Just trying a simple bash script as a plugin.. doesn't seem to work. What
> am I doing wrong or is this even possible?
>
>
>
> [root at PS-NAT etc]# ../libexec/check_nrpe 10.1.82.30 -c check_mailsend
>
> /.bashrc: Permission denied
>
>
>
> [root at PS-NAT etc]#
>
>
>
>
>
>
>
> the script:
>
>
>
> [root at ps-sm-poly-00 libexec]# cat calc_speed
>
># !/bin/bash
>
>
>
> MPS=0
>
> TMPS=0
>
> AMS=0
>
> TNP=0
>
> cd /usr/local/mailSend/out
>
> for i in *; do
>
> [ $i == "*" ] && break
>
> END_FILE=`tail -7 $i`;
>
> MPS=`echo "$END_FILE"|grep "sec:"|awk '{print $4}'`
>
> [ -z $MPS ] || TMPS=`echo "$TMPS+$MPS"|bc`
>
> AVGSIZE=`echo "$END_FILE"|grep "Size:"|awk '{print $4}'`
>
> [ -z $AVGSIZE ] || AMS=`echo "$AMS+$AVGSIZE" | bc`
>
> TNP=`echo "$TNP+1"|bc`
>
> done
>
>
>
> echo "Total MPS = $TMPS mps"
>
> TMPSINT=`echo "$TMPS/1" | bc`
>
> if [ "$TMPSINT" -lt 1 ]
>
> then
>
> exit 1
>
> fi
>
>
>
>
>
>
>
> Gerald Wichmann
>
> Senior Systems Development Engineer
>
> Zantaz, Inc.
>
> 925.598.3099 (w)
>
>
>
>
> This e-mail has been captured and archived by the ZANTAZ Digital Safe(tm)
> service. For more information, visit us at www.zantaz.com.
>
> IMPORTANT: This electronic mail message is intended only for the use of
> the individual or entity to which it is addressed and may contain
> information that is privileged, confidential or exempt from disclosure
> under applicable law. If the reader of this message is not the intended
> recipient, or the employee or agent responsible for delivering this
> message to the intended recipient, you are hereby notified that any
> dissemination, distribution or copying of this communication is strictly
> prohibited. If you have received this communication in error, please
> notify the sender immediately by telephone or directly reply to the
> original message(s) sent. Thank you.
-------------------------------------------------------
This sf.net email is sponsored by: Are you worried about
your web server security? Click here for a FREE Thawte
Apache SSL Guide and answer your Apache SSL security
needs: http://www.gothawte.com/rd523.html
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
This e-mail has been captured and archived by the ZANTAZ Digital Safe(tm)
service. For more information, visit us at www.zantaz.com.
IMPORTANT: This electronic mail message is intended only for the use of the
individual or entity to which it is addressed and may contain information
that is privileged, confidential or exempt from disclosure under applicable
law. If the reader of this message is not the intended recipient, or the
employee or agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have received
this communication in error, please notify the sender immediately by
telephone or directly reply to the original message(s) sent. Thank you.
-------------------------------------------------------
This sf.net email is sponsored by: Are you worried about
your web server security? Click here for a FREE Thawte
Apache SSL Guide and answer your Apache SSL security
needs: http://www.gothawte.com/rd523.html
More information about the Users
mailing list