zoukankan      html  css  js  c++  java
  • curl访问nagios中Host Status Details For All Host Groups页面的方法

    由于进入nagios要输入用户名与密码才能进入,故用curl模拟输入用户名与密码取得当前所有主机的报警信息:

    # curl -u nagiosadmin:password http://192.168.5.10/nagios/cgi-bin/status.cgi?host=all

    # curl -u nagiosadmin:skylink -s http://192.168.5.10/nagios/cgi-bin/status.cgi?host=all | grep hostTotalsPROBLEMS | grep -o '[[:digit:]]'
    1

    # curl -u nagiosadmin:skylink -s http://192.168.5.10/nagios/cgi-bin/status.cgi?host=all | grep serviceTotalsPROBLEMS | grep -o '[[:digit:]]'
    2

    参数:

    -s          不显示进度

    grep -o   匹配输出

  • 相关阅读:
    风险投资
    a blog about grid stytem
    960gs
    css布局学习资料
    rails测试
    telecommuting
    blueprint
    google +buttons style
    960gs
    960gs tips
  • 原文地址:https://www.cnblogs.com/nhlinkin/p/3625906.html
Copyright © 2011-2022 走看看