Shell script gets Zabbix monitor diagram

Source: Internet
Author: User
Tags curl

Because the leader put forward the need to see a few times a day the server traffic map, this morning 9 to start work, more than 10 servers, the designated time 12 hours traffic map, cut over the chart repeatedly control several times, one is afraid of choosing the wrong host, the second is afraid of the mistake time period. The use of Zabbix time is not long, has been feeling very awkward, prone to error. Plus the middle also did a little other things statistics, and finally the mail issued by the time is already 10 points later.

I'm afraid this is going to affect my career. If there is anything else, it is estimated that the leader can eat lunch while watching the report, I can only choose to eat the soil ...

Online tutorials are more, Python wrote, Perl, should be for the time being no such basis, copied to run the error is no solution. Get your hands on your own.


The following is the Chrome browser + Zabbix 2.4.x


Body:


Preparatory work:

Browser Landing Grab Bag:

(slightly, you need to grab the POST request of the login Zabbix to grab the packet: request=&name=admin&password=zabbix&autologin=1&enter=sign+in)

Graphid and Traffic map address

Graphid:

Graphic ID (literal translation), do not know how to define, popular point is a host + a monitoring point ==>> a different ID

Process:

1.Monitoring--Dashboard--Graphs

2. Select the corresponding host and the corresponding monitoring item

3. Right-click on the flow graph to check

4. Find keywords

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/82/DB/wKioL1diwUbxobiLAAA69UhLhEg750.jpg-wh_500x0-wm_3 -wmp_4-s_3610197722.jpg "title=" screen. jpg "alt=" wkiol1diwubxobilaaa69uhlheg750.jpg-wh_50 "/>

5. Get: chart2.php?graphid=963&period=3600&stime=20170616192202&updateprofile=1&profileidx= web.screens&profileidx2=963&sid=2eaa005d53dd3ea0&width=1222

graphid=963

Flow chart Address: http://192.168.0.162/zabbix/chart2.php?graphid=963&period=3600&width=1222

Period is a time period, not add, but it is best to specify by hand.

Width for the picture, no addition, the plot will be slightly narrower.

The remaining parameters did not do too much research, there is or no temporary difference, it is omitted. If you need to find all Graphid recommendations through the database lookup.

Script:

#!/bin/bash## Zabbix Login address, Zabbix login user logurl= "http://192.168.0.162/zabbix/index.php" zabbix_user= "admin" zabbix_pass = "Zabbix" graphid=963# #时间段, 12hperiod=43200## request address save Cookie Curl-l-C cookie.txt--user-agent mozilla/4.0-d "REQUEST=&A MP; $ZABBIX _user&password= $ZABBIX _pass&autologin=1&enter=sign+in "$LOGURL # #图片URL地址格式URL =" http:// 192.168.0.162/zabbix/chart2.php?graphid= $GRAPHID &period= $PERIOD &width=1222 "# #带cookie请求图片URL, and save Curl-c Cookie.txt-b cookie.txt--user-agent mozilla/4.0 $URL >/home/zabbix_$graphid.png


This article is from "Bear bears big" blog, please be sure to keep this source http://x1ong.blog.51cto.com/11055831/1790101

Shell script gets Zabbix monitor diagram

Related Article

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.