Check_connections

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Re: Check_connections

Post 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.
You do not have the required permissions to view the files attached to this post.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check_connections

Post 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.
Former Nagios Employee
ednaldojta
Posts: 103
Joined: Tue Apr 07, 2015 7:52 am

Re: Check_connections

Post 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!
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check_connections

Post 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!
Former Nagios Employee
Locked