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
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
++
I'll second that!
Randal, Phil wrote:
> Can't help but think that using pnp4nagios would be easier :-)
>
> Phil
>
> --
> Phil Randal
> Infrastructure Engineer
> Hoople Ltd | Thorn Office Centre | Hereford HR2 6JT
> Tel: 01432 260415 | Email: phil.ran...@hoopleltd.co.uk
>
> -Original Message---
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
--
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
>
> ++
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 [ $
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
Can't help but think that using pnp4nagios would be easier :-)
Phil
--
Phil Randal
Infrastructure Engineer
Hoople Ltd | Thorn Office Centre | Hereford HR2 6JT
Tel: 01432 260415 | Email: phil.ran...@hoopleltd.co.uk
-Original Message-
From: nelson [mailto:tnels...@comcast.net]
Sent: 20 Jul
I am in the process of building a Centos 6.2 system to run Nagios and n2rrd. It
is a virtual machine / sandbox. Centos 6.2 is installed as is Nagios 3.4.1
and Nagios Plugins 1.4.15. Nagios and the Nagios Plugins were installed
following the Fedora Quick Start instructions at
http://nagios.sour