Hi ;)<br>Sorry, this plugin is correct for Linux but don't work on MAC, why?<br>--------------------------------------------------------------<br>#!/bin/sh<br>STATE_OK=0<br>STATE_WARNING=1<br>STATE_CRITICAL=2<br>STATE_UNKNOWN=3<br><br><br>if [ $# -lt 1 ] ; then<br> echo -e "Unknown - Usage $0 argument"<br> exit $STATE_UNKNOWN<br>fi<br><br># this cicle control if a name user is inserted (example: <br># check_processes03 root or check_processes03 nameuser)<br># in this case appear: "You have inserted a name user: it is not correct"<br><br>for lista in $(cat /etc/passwd |tr ":" " " |awk {'print $1'})<br>do<br>if [ $lista == "$1" ]; then<br>echo "You have inserted a name user: it is not correct"<br>exit<br>fi<br>done<br><br>lsof |grep $1 > /dev/null # lsof to test if a program is open and redirect the output in dev/null<br><br>RC=$? # put the state in
variable RC<br><br> if [ $RC -eq 0 ]; then # if RC is equal to 0 the state is OK<br> lsof | grep $1 | awk '{printf("%s STATO OK\n",$1)}' # output with costruct awk e to filter the output<br> exit $STATE_OK<br><br> else<br> echo -e "Critical - $1 is not running" # if state is different to 0 the state is CRITICAL<br> exit $STATE_CRITICAL<br> fi<br>fi<br>-----------------------------------------------------------------<br><br>Thank you very much ;)<p>
<hr size=1><font face="Arial" size="2"><a href="http://us.rd.yahoo.com/mail_it/taglines/*http://it.messenger.yahoo.com"><b>Yahoo! Messenger with Voice</b></a>: chiama da PC a telefono a tariffe esclusive</font>