That doesn't look like a Solaris script to me but as far as your coding is concerned, my thoughts are<br><br>(i) get yourself a book on the k-shell 'cause it's a lot more powerful that the bourne (/bin/sh) shell.<br>(ii) you can say
<br>vmstat -dp | awk '/sda/ {print $2}' <br>instead of<br>vmstat -dp | grep sda | awk '{print $2}'<br>(iii) if you were using bash or ksh your could say<br>readdiff=$(( $currreads - $prevreads ))<br>instead of<br>readdiff=$(expr $currreads - $prevreads)
<br>(iv) for security you ought to use full paths to all of your binaries:<br>i.e.<br>/usr/bin/echo<br>instead of<br>echo<br><br>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.
<br><br>Have fun,<br>Alex<br><br><br><div><span class="gmail_quote">On 10/16/06, <b class="gmail_sendername">August Simonelli</b> <<a href="mailto:augusts@gmail.com">augusts@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Alexander and list folks,<br><br>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! :-)
<br><br>It's not really fancy, just uses vmstat to get disk reads and writes, stores it, then compares that the next time. <br><br>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.
<br><br>August<br><br><br><br><div><div><span class="e" id="q_10e4e325d142c1c5_1"><span class="gmail_quote">On 10/15/06, <b class="gmail_sendername">Alexander Harvey</b> <<a href="mailto:alexh19740110@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
alexh19740110@gmail.com</a>> wrote:</span></span></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><span class="e" id="q_10e4e325d142c1c5_3">

Hi All,<br><br>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?
<br><br>Many thanks in advance,<br><br>Alex Harvey<br>UNIX Administrator<br>Sydney, Australia<br>

<br></span></div>-------------------------------------------------------------------------<br>Using Tomcat but need to do more? Need to support web services, security?<br>Get stuff done quickly with pre-integrated technology to make your job easier
<br>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo<br><a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642</a><br><br>_______________________________________________<br>Nagios-users mailing list<br><a href="mailto:Nagios-users@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">

Nagios-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">https://lists.sourceforge.net/lists/listinfo/nagios-users
</a><br>::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br>::: Messages without supporting info will risk being sent to /dev/null<br><br></blockquote></div><br>

<br clear="all"></blockquote></div><br>