nagios url monitoring

Learn about nagios url monitoring, we have the largest and most updated nagios url monitoring information on alibabacloud.com

Zabbix Monitoring URL return status

= argv1# page address response=urllib2.urlopen (URL) # Call Urllib2 to send a GET request to the server returnresponse.read () # Gets the page information returned by the server Ret=http_get () retj=json.loads (ret) ifretj[' action ']NBSP;==NBSP; " None ": print0else:print1cat/usr/local/zabbix/ Etc/zabbix_agentd.conf.d[[emailprotected]zabbix_agentd.conf.d]#catwarn_status.conf userparameter=get_warn_name,/usr/local/zabbix/bin/warn_web.pyuserparameter=

The Shell function method implements the monitoring web site URL

Using shell functions to implement monitoring web site URLs[[emailprotected]scripts]#catcheckweb.sh#!/bin/ Bashfunctionusage () {echo$ "Usage:$0url" Exit1}functioncheck_url () {wget--spider-q-o/ DEV/NULLNBSP;--TRIES=1NBSP;-TNBSP;5NBSP;$1NBSP;NBSP;NBSP;NBSP;IFNBSP;[NBSP;$?NBSP;-EQNBSP;0NBSP;] thenecho "$ isyes. " elseecho "$1is No. " fi}functionmain () {if[$#-ne 1]thenusage ficheck_url$1}main$* The script runs as follows[[Email protected] scripts]# sh

Python URL monitoring and mail alerting

Import timeImport requestsImport SmtplibFrom Email.mime.text import MimetextImport datetimedef SendEmail (Fromadd,toadd,subject,text):_pwd = "[email protected]" #授权码msg = Mimetext (text)msg["Subject"] = SubjectMsg["from"] = FromaddMsg["to"] = ToaddTrys = smtplib. Smtp_ssl ("smtp.sudaizhijia.com", 465)S.login (Fromadd, _pwd)S.sendmail (Fromadd, Toadd, msg.as_string ())S.quit ()Print ("success!")Except Smtplib. Smtpexception:Print (' falied! ')from_= "[Email protected]"To_ = ["[Email protected]"]

Total Pages: 13 1 .... 9 10 11 12 13 Go to: Go

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.