V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
dnsjia
V2EX  ›  Linux

zabbix 监控网页中的文字 ,如何设置?

  •  
  •   dnsjia · Jan 13, 2017 · 4366 views
    This topic created in 3393 days ago, the information mentioned may be changed or developed.

    目前想用 zabbix 监控网页中的某个字符,当监控取值等于网页的字符串就触发动作。 这个该怎么设置呢?

    比如 zabbix 监控要求的字串 = 网页中的字符串 zabbix 就报警。

    4 replies    2017-01-13 16:54:05 +08:00
    ye10010
        1
    ye10010  
       Jan 13, 2017
    仅供参考:写个脚本,读取网页中的该字符,返回符合 zabbix 格式的数据丢给 zabbix 去比较。
    之前做过监控自有服务,大概是这样的思路。
    eric6789
        2
    eric6789  
       Jan 13, 2017
    在 web scenario 里的 step 下添加 Required string 就好了啊
    ecosky
        3
    ecosky  
       Jan 13, 2017
    简单的办法,就是 agent 写脚本去 curl 这个网页 grep 关键值, server 端设触发器,值大于 1 就报警呗
    codermagefox
        4
    codermagefox  
       Jan 13, 2017
    楼主你好,这个我已经做了,不过做的方法比较曲折。
    方法:
    zabbix 脚本只取服务器上一个 TXT 文本的值, TXT 文本的值哪里来呢?爬虫保存至文本。
    绕了一圈,不过还算达成效果了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1016 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 22:09 · PVG 06:09 · LAX 15:09 · JFK 18:09
    ♥ Do have faith in what you're doing.