Re: [Nagios-users] shell script not working properly as Nagios plugin

2012-07-20 Thread vishesh kumar
Thanks for reply , I am able to run command as nagios and its returning right value 120 to me -- [nagios@monitor ~]$ /usr/bin/sudo /sbin/iptables -vL|/bin/grep ':ssh'|/bin/awk '{print $1}' 120

Re: [Nagios-users] shell script not working properly as Nagios plugin

2012-07-20 Thread Mike Clark
Second that response. From: vishesh kumar [mailto:linuxtovish...@gmail.com] Sent: Friday, July 20, 2012 6:42 AM To: Nagios Users List Subject: [Nagios-users] shell script not working properly as Nagios plugin Hi Members, I wrote below script to monitor ssh traffic

Re: [Nagios-users] shell script not working properly as Nagios plugin

2012-07-20 Thread Voigt, Thomas
Hi, is your nagios user allowed to run the sudo command from the first line in your script? Please login as and execute the command /usr/bin/sudo /sbin/iptables -vL|/bin/grep ':ssh'|/bin/awk '{print $1}' directly. Do you see any output? -- Regards Thomas Voigt --

Re: [Nagios-users] shell script not working properly as Nagios plugin

2012-07-20 Thread vishesh kumar
Yes , Its defined and script running fine when i run it via bash from user nagios . On Fri, Jul 20, 2012 at 5:47 PM, Assaf Flatto wrote: > ** > On 20/07/12 12:41, vishesh kumar wrote: > > Hi Members, > > I wrote below script to monitor ssh traffic > > ++

Re: [Nagios-users] shell script not working properly as Nagios plugin

2012-07-20 Thread Assaf Flatto
On 20/07/12 12:41, vishesh kumar wrote: Hi Members, I wrote below script to monitor ssh traffic +++ a=$(/usr/bin/sudo /sbin/iptables -vL|/bin/grep ':ssh'|/bin/awk '{print $1}') if [ $a -gt 3 ]; then echo "SSH aatempt is TOO High | $a" exit 2 else if [ $

[Nagios-users] shell script not working properly as Nagios plugin

2012-07-20 Thread vishesh kumar
Hi Members, I wrote below script to monitor ssh traffic +++ a=$(/usr/bin/sudo /sbin/iptables -vL|/bin/grep ':ssh'|/bin/awk '{print $1}') if [ $a -gt 3 ]; then echo "SSH aatempt is TOO High | $a" exit 2 else if [ $a -gt 2 ]; then echo "SSH aatempt is Average