Script for monitoring server connections in Nagios

Source: Internet
Author: User

Recently, because the server is constantly adding new business, the server needs to adjust the maximum number of connections, so the use of Nagios to monitor the corresponding number of connections, the script is also using Nagios to send the corresponding state to implement monitoring, implementation is also very simple

#/bin/bash#used to monitor the number of sockets connections in Nagios#writer jim#histor#2017.6.15state_ok=0state_warning =1state_criticalll=2state_unknown=3declare-i socket_num=$ (ss-an|wc-l) declare-i max_num=65535if [$socket _num-le $ Max_num]; Then echo "The number of sockets connections is $socket _num. Ok "Exit $STATE _okelse echo" Error!!! The number of socket connections is too much.the number is $socket _num "Exit $STATE _criticallfi


This article from "Technical essay" blog, declined reprint!

Script for monitoring server connections in Nagios

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.