Netstat-statistics plugin ?

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Netstat-statistics plugin ?

Postby junqian1992 » Fri Oct 12, 2018 4:35 am

Hi all,
could recommend what plugin is suitable for me ?

Example :
I need to show out the result as below script on Nagios core. But i dunno what plugin can do like this.
since i need to real time to check how many connection on our web server by using Nagios core.

Code: Select all
echo -e "connections: "
netstat -n | awk '/^tcp/ {++state[$NF]} END {for(key in state) print key,"\t",state[key]}'
echo  -e "\n connected server & ip:"
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
Regards,
JQ
junqian1992
 
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: Netstat-statistics plugin ?

Postby scottwilkerson » Fri Oct 12, 2018 7:55 am

You could put those commands in a custom bash script anc create a nagios plugin, then call the plugin with an agent such as NRPE or NCPA

Here are the Nagios Plugins Development Guidelines
https://nagios-plugins.org/doc/guidelines.html
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12607
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Netstat-statistics plugin ?

Postby junqian1992 » Thu Oct 18, 2018 10:46 pm

Hi,
Thanks for your reply.
I will test it.
Regards,
JQ
junqian1992
 
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: Netstat-statistics plugin ?

Postby scottwilkerson » Fri Oct 19, 2018 8:13 am

junqian1992 wrote:Hi,
Thanks for your reply.
I will test it.


Let us know how it comes out
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12607
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Netstat-statistics plugin ?

Postby junqian1992 » Tue Dec 04, 2018 1:35 am

Hi all,
Done, thank you.
Regards,
JQ
junqian1992
 
Posts: 41
Joined: Wed Nov 15, 2017 4:57 am

Re: Netstat-statistics plugin ?

Postby scottwilkerson » Tue Dec 04, 2018 8:29 am

junqian1992 wrote:Hi all,
Done, thank you.


Great!

Locking thread
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 12607
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 13 guests