That doesn't look like a Solaris script to me but as far as your coding is concerned, my thoughts are

(i) get yourself a book on the k-shell 'cause it's a lot more powerful that the bourne (/bin/sh) shell.
(ii) you can say
vmstat -dp | awk '/sda/ {print $2}'
instead of
vmstat -dp | grep sda | awk '{print $2}'
(iii) if you were using bash or ksh your could say
readdiff=$(( $currreads - $prevreads ))
instead of
readdiff=$(expr $currreads - $prevreads)
(iv) for security you ought to use full paths to all of your binaries:
i.e.
/usr/bin/echo
instead of
echo

Otherwise I guess it'll work in Nagios (although most Nagios plugins can give warnings or critical alerts by exiting with exit codes 0 for OK, or 1 for WARNING, or 2 for CRITICAL.

Have fun,
Alex


On 10/16/06, August Simonelli <[EMAIL PROTECTED]> wrote:
Hi Alexander and list folks,

I set up two little shell scripts for disk i/o calculations for mrtg which i hope to use for nagios down the track. I'm still learning shell scripting /nagios / etc so i welcome corrections to my logic, coding, anything! :-)

It's not really fancy, just uses vmstat to get disk reads and writes, stores it, then compares that the next time.

As i said, it's just for mrtg now so dunno if it will work for nagios, but soon i'll play with it and find out.

August



On 10/15/06, Alexander Harvey < [EMAIL PROTECTED]> wrote:
Hi All,

I wonder if anyone out there is using Nagios to monitor disk I/O on UNIX servers and if so I'm curious as to how they're doing it, what plugins they're using, are they calling iostat from a shell script? What options of iostat are they calling etc?

Many thanks in advance,

Alex Harvey
UNIX Administrator
Sydney, Australia

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Reply via email to