Yum demand status monitoring

Yum demand status monitoring

Add monitoring client's point of view

  1. Scripting
#!/bin/bash
sudo yum clean all &>/dev/null
sudo rm -rf /var/cache/yum  &>/dev/null
sudo yum makecache &>/dev/null
echo "plugin_sys.yum.status $?"
  1. Write telegraf profile
[[email protected] /etc/telegraf/telegraf.d]$ cat yum_monitor.conf
[[inputs.exec]]
  commands = ["bash /data/w/telegraf-plugin/yum_moniter.sh"]
  timeout = "15s"
  interval = "60s"
  data_format = "graphite"
  templates = [
    "measurement.measurement.field"
  ]
  1. Check the log file to see if there are problems uploading monitoring data
[[email protected] /var/log/telegraf]$ tail -f telegraf.log
2019-12-02T07:48:18Z I! Hang on, flushing any cached metrics before shutdown
2019-12-02T07:48:18Z I! Starting Telegraf
2019-12-02T07:48:18Z I! Loaded inputs: inputs.disk inputs.diskio inputs.kernel inputs.mem inputs.internal inputs.net inputs.netstat inputs.ping inputs.cpu inputs.processes inputs.swap inputs.system inputs.nstat inputs.exec inputs.exec
2019-12-02T07:48:18Z I! Loaded aggregators:
2019-12-02T07:48:18Z I! Loaded processors:
2019-12-02T07:48:18Z I! Loaded outputs: graphite
2019-12-02T07:48:18Z I! Tags enabled: host=salt-master2.sys.ops.beta.bj1
2019-12-02T07:48:18Z I! Agent Config: Interval:30s, Quiet:false, Hostname:"salt-master2.sys.ops.beta.bj1", Flush Interval:30s
  1. Check whether there is data on the monitoring system and configure alarms done
  2. Verify that the alarm can be reported out of
    the script location to configure yum source
    1, the existence of alarm information done
    2, does have a work order appears done

    Adding server monitoring angle

    Add port monitoring 28080

Guess you like

Origin www.cnblogs.com/yanghehe/p/12308285.html