Recently a friend asked me how to monitor the company's website: The purpose is that the website can not access timely alarm.
Of course some cloud servers are definitely self-featured, but the physical servers are not that smart, but open source is powerful, and here are two ways to share a personal monitoring site.
First, the Zabbix comes with the Web detection:
1.1) configuration > host (requires networking) >web scene > Create a Web Scene
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/8D/5C/wKioL1iZjkvjrGVhAAB4tpGAbZQ036.png "style=" float: none; "title=" 1.png "alt=" Wkiol1izjkvjrgvhaab4tpgabzq036.png "/>
Add the URL of the site you need to detect
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/8D/5F/wKiom1iZjkvS4iTYAAAv4u1t9Jo753.png "style=" float: none; "title=" 2.png "alt=" Wkiom1izjkvs4ityaaav4u1t9jo753.png "/>
1.2) create trigger (mail alarm, SMS alarm, alarm pre-configuration one can)
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/8D/5C/wKioL1iZjsTBMSglAABnOtt3qVQ201.png "title=" 3.png " alt= "Wkiol1izjstbmsglaabnott3qvq201.png"/>1.3) Monitoring >web detection
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8D/5C/wKioL1iZjyjxZUxAAAEWiHc1s78060.png "title=" 4.png " alt= "Wkiol1izjyjxzuxaaaewihc1s78060.png"/>1.4) Trigger
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/8D/5F/wKiom1iZj3Xy4z4vAAC-GLgSAhM057.png "title=" 5.png " alt= "Wkiom1izj3xy4z4vaac-glgsahm057.png"/>
Second, Shell+nc+namp and other tools +crontab
#!/BIN/BASH#THIS IS A JIANKONG QUTOUWANG BASHNC -z -v -w 10 80 &>/dev/nullif [ $? -ne 0 ]then nmap www.xxx.com -p 80|grep ' 80/tcp open http ' if [ $? -ne 0 ]thenecho "   IS ALREADY STOPD" | mail -s "www.xxx.com " [email protected]fifi#httpsnc -z -v -w 10 443 &>/dev/nullif [ $? -ne 0 ]then nmap -p 443|grep ' 443/tcp open https ' If [ $? -ne 0 ]thenecho "WWW.XXX.COM HTTPS IS ALREADY STOPD" | mail -s " " [email protected]fifi
The script is really simple, no more than the use of commands such as Nc,nmap,curl can also be used to 80 port 443 port (other ports can also) handshake, in order to prevent network latency problem, used two times detection. This script for more than a year to use very convenient, their own thinking, relatively simple.
If you have any better way, also can share!
This article is from "Never give up!" Ningzhiyuan "blog, declined reprint!
Zabbix+shell two ways to monitor any web and alert you in time