Hi there,
Do you know if there is an way to check the amount of connections on a remote host/port? Let's say I want to know how many connections on port 1723 (VPN) on "server x" are active?
I tried a couple of "check connections" plugins on the Nagios Exchange but I can't make them check an remote host.
Thanks.
How to check amount of connections on remote port
-
- Posts: 11
- Joined: Wed May 27, 2015 3:39 pm
Re: How to check amount of connections on remote port
You need to use an agent on the remote host to run the check and return results back to Nagios, or else use passive checks. Google for NRPE, or wrap checks in the check_by_ssh wrapper, or Google for Nagios passive checks.
Re: How to check amount of connections on remote port
To supplement eloyds post,
Download NRPE: https://exchange.nagios.org/directory/A ... or/details
Official NRPE documentation: http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
Passive Checks: http://nagios.sourceforge.net/docs/3_0/ ... hecks.html
Let us know if you have any questions!
Download NRPE: https://exchange.nagios.org/directory/A ... or/details
Official NRPE documentation: http://nagios.sourceforge.net/docs/nrpe/NRPE.pdf
Passive Checks: http://nagios.sourceforge.net/docs/3_0/ ... hecks.html
Let us know if you have any questions!
Re: How to check amount of connections on remote port
Sorry for my terseness. Was writing from smartphone.
Re: How to check amount of connections on remote port
@eloyd: terse, but correct nonetheless
@OP: eloyd is correct, you need to run the connections check from the remote host in order to collect the desired info.
@OP: eloyd is correct, you need to run the connections check from the remote host in order to collect the desired info.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
-
- Posts: 11
- Joined: Wed May 27, 2015 3:39 pm
Re: How to check amount of connections on remote port
Thanks guys.
I use the plugin "check_connections.sh" to count the amount of connections on a to be determined port. The command to run the plugin is specified as following:
In NRPE.cfg, I specified the following:
Something strange, is that the first 3 lines are yellow and red, but my line for the conncetions stays red.
command[check_dell_alertlog]=/usr/lib64/nagios/plugins/check_openmanage –only alertlog
command[check_dell_critical]=/usr/lib64/nagios/plugins/check_openmanage –only critical
command[check_dell_warning]=/usr/lib64/nagios/plugins/check_openmanage –only warning
command[check_vpn_connections]=/usr/lib64/nagios/plugins/check_connections.sh -s all '( dport = :1723 )' -w $ARG1$ -c $ARG2$
Afterwards, I restarted the NRPE service
The output is as following:
I guess the color indicates I'm doing something wrong, as the output says the same. Does anyone have a clue?
Thanks
I use the plugin "check_connections.sh" to count the amount of connections on a to be determined port. The command to run the plugin is specified as following:
Code: Select all
define command{
command_name check_vpn_connections
command_line $USER1$/check_connections.sh -s all '( dport = :1723 )' -w 200 -c 300
}
Code: Select all
command[check_vpn_connections]=/usr/lib64/nagios/plugins/check_connections.sh -s all '( dport = :1723 )' -w $ARG1$ -c $ARG2$
command[check_dell_alertlog]=/usr/lib64/nagios/plugins/check_openmanage –only alertlog
command[check_dell_critical]=/usr/lib64/nagios/plugins/check_openmanage –only critical
command[check_dell_warning]=/usr/lib64/nagios/plugins/check_openmanage –only warning
command[check_vpn_connections]=/usr/lib64/nagios/plugins/check_connections.sh -s all '( dport = :1723 )' -w $ARG1$ -c $ARG2$
Afterwards, I restarted the NRPE service
The output is as following:
Code: Select all
[root@xxx plugins]# ./check_nrpe -H xxxx -c check_vpn_connections -a 20 30
NRPE: Command 'check_vpn_connections' not defined
Thanks
Re: How to check amount of connections on remote port
The color itself is just syntax highlighting, but you're right in that it does look weird. NRPE is probably seeing that "dport =" part and hanging on that.
Can you try to modify the check_connections.sh script to hard-code in the -s all '( dport = :1723 )' part? That might be the easiest way short of patching NRPE (which would take a while).
Can you try to modify the check_connections.sh script to hard-code in the -s all '( dport = :1723 )' part? That might be the easiest way short of patching NRPE (which would take a while).
Former Nagios employee
-
- Posts: 11
- Joined: Wed May 27, 2015 3:39 pm
Re: How to check amount of connections on remote port
I'm using an other plug-in now, that's not great but it should do the work. Thanks for cooperating.
Re: How to check amount of connections on remote port
I'll be closing this thread now, but feel free to open another if you need anything in the future!
Former Nagios employee