Page 2 of 2

Re: Check_connections

Posted: Thu Mar 31, 2016 1:45 pm
by ednaldojta
Hello donald,
He gave no last criticism, but reported the following critical.

CRITICAL - There are NO established or listening connections on port 5666

As follows in the attached image.

But, I can not hear the door with netsat as below.

Re: Check_connections

Posted: Thu Mar 31, 2016 4:22 pm
by rkennedy
I was running into issues getting this script working as well...so I re-wrote it. Performance data, and warning / critical thresholds have been added as well.

https://github.com/rcknag/nagios-plugin ... netstat.sh

Code: Select all

[root@localhost libexec]# ./check_netstat.sh -h
This plugin will check netstat (netstat -an|grep :port|wc -l) for the specified port.
Flags:
-p        Port to check
-w        Warning value
-c        Critical Value
-h        Help menu

Example:
check_netstat.sh -p 80 -w 5 -c 10
This will report OK if less than 5 connections, WARNING if 5-10, and CRITICAL if greater than 10.
As an example -

Code: Select all

[root@localhost libexec]# ./check_netstat.sh -w 6 -c 10 -p 22
OK: 5|count=5

Code: Select all

[root@localhost libexec]# ./check_netstat.sh -w 5 -c 10 -p 22
WARNING: 5|count=5

Code: Select all

[root@localhost libexec]# ./check_netstat.sh -w 1 -c 4 -p 22
CRITICAL: 5|count=5
Let me know if you run into any issues with it, and I'll get them fixed.

Re: Check_connections

Posted: Fri Apr 01, 2016 7:16 am
by ednaldojta
Face with all due respect, you guys are Zika brat!
I mean you guys are very good! Thank you guys, Galera show, show Showwwwwwwww

Thank you so! Goal achieved!

Re: Check_connections

Posted: Fri Apr 01, 2016 10:18 am
by rkennedy
You're welcome! Let me know if you run into any issues with it and I'll get them worked out.

Closing this one out now, but feel free to create a new thread if you need any assistance in the future!