CMDB Cabinet platform combined with Zabbix alarm display

Source: Internet
Author: User

Recently saw Liu Tians teacher's cabinet display platform, very gorgeous, and there is a large screen display can also reflect the value of operation and maintenance, here is the next I am doing some data of the CMDB platform:

CMDB data:

Computer room, cabinet, cabinet power supply, cabinet location, machine room contract, contract expiry time, contact person in the computer room.

Server, CPU, hard disk, whether virtualization, host, RAID type, memory.

Asset ID, listed date, bottom shelf record, Server Agent, Agent contact, server to warranty date.

IP address, MAC address, line of business, product line, operating system.


Communication This major technology JSON-RPC, and then provide API interface to program calls, in a fixed format to import, hardware fixed information, such as IP,MAC, hard disk and other information, through the automatic collection of API post to add to the data table. Like computer room information, cabinets and the like can give a copy of the computer room Excel form and then directly import.


Computer room server display: Through the Liu Tians teacher cabinet temporary platform of the front end to take over, and then combined into the table structure inside the display; When the fault alarm, left a warning interface API, through the Zabbix to send the alarm data to the operation and maintenance platform; Operation and maintenance platform Storage alarm display: The following is the front-end simple display effect, Here's how:


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/29/wKioL1fWYPLR76bUAACZ7urAiuo679.png "title=" 1.png " Width= "444" height= "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:444px;height:300px; "alt=" Wkiol1fwyplr76buaacz7uraiuo679.png "/>


Front-end Cabinet generation effect display: blink effect directly get the manufacturer's GIF file call can, cabinet naming mode such as the following: 5-6,5-7 on the fifth row sixth, seventh cabinet:


650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/87/2B/wKiom1fWYUWze3u_AAGD2oFdS4g571.png "title=" 2.png " Width= "height=" 278 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:600px;height:278px; "alt=" wkiom1fwyuwze3u_ Aagd2ofds4g571.png "/>


The above is normal display, when the failure occurs: The combination of Zabbix alarm script, send the past to the interface, the fault is as follows:


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/87/2C/wKiom1fWYzTg_MjQAAAyh_p45IM220.png "title=" 4.png " alt= "Wkiom1fwyztg_mjqaaayh_p45im220.png"/>

Room Display Effect:


650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/29/wKioL1fWYl7AB6ZsAAGQI8GmX6o434.png "title=" 5.png " Width= "height=" 297 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:600PX;HEIGHT:297PX; "alt=" Wkiol1fwyl7ab6zsaagqi8gmx6o434.png "/>


The mouse moves to the enclosure to display information about the server:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/87/2C/wKiom1fWY37iruSNAAFt8tVLuXU969.png "title=" 6.png " Width= "height=" 397 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:600PX;HEIGHT:397PX; "alt=" Wkiom1fwy37irusnaaft8tvluxu969.png "/>


Zabbix the alarm script and sends the status to the operations platform, and changes the server status:


[[Email protected] alertscripts]# cat zabbix_alert.py #!/usr/bin/python#coding:utf-8  import requests,json import smtplibfrom email.mime.text import  mimetextimport sys   #邮箱服务器地址mail_host  =  ' smtp.163.com ' #邮箱用户名mail_user  =  ' [ Email protected] ' #邮箱密码mail_pass  =  ' xxxxxx123456 ' mail_postfix =  ' 163.com '  def  send_mail (to_list,subject,content):     me = mail_user+ "<" +mail_user+ "@" +mail_postfix+ ">"     msg = mimetext (content)     msg[' Subject '] = subject    msg[' from '] = me    msg[' to '] = to_list      try:         S = smtplib. SMTP ()         s.connect (mail_host)         &nbSp;s.login (Mail_user,mail_pass)         s.sendmail (me,to_list,msg.as_ String ())         s.close ()          return True    except Exception,e:         print str (e)         return falsedef alert ( Message):     headers = {"Content-type":  "Application/json"}     data = {}    res = {}    data[' status ' ] = message     res[' params ']=data    res[' jsonrpc ']  =  "2.0"     res["id"] = 1    res["method"]=  " Alert.turn "    url = " Http://192.168.63.216:2000/api "    r  = requests.post (URl, headers=headers,json=res)  if __name__ ==  "__main__":     send_ Mail (sys.argv[1], sys.argv[2], sys.argv[3])     alert (sys.argv[2])


Back end return status changes directly after the storage modification, my side just to determine whether the subject is problem or OK:


The front-end code can be changed to jquery according to Liu Tians Teacher's and then the front-end can go free to play, the following simple example:


<table border= "0"  cellpadding= "1"  cellspacing= "0"  height= "" " width=" 99% ">     <tbody><tr>    <td class= "Jgtable"  align= "Center"  height= " valign=" Bottom "><font class=" Jgtitle ">01</font></td> </tr>      <td class= "jgtable"  align= "center"  height= "30 " valign=" >&nbsp;    </td>    </tr> "Bottom"     <tr>    <td class= "jgtable"  align= "center"  height= " valign=" "Bottom" >&nbsp;    </td>     </tr>    <tr>    <td class= "Jgtable"   align= "center"  height= " valign=" "Bottom" >&nbsp;    </td>     </tr>     <tr>    <td class= "jgtable"  align= "center"   height= ""  valign= "Bottom" >&nbsp;    </td>    </ tr>    <tr>    <td class= "jgtable"  align= "center " height="  valign= "Bottom" >&nbsp;    </td>     </tr>    </tbody></table>



This article is from the "Little Luo" blog, please be sure to keep this source http://xiaoluoge.blog.51cto.com/9141967/1852029

CMDB Cabinet platform combined with Zabbix alarm display

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.