8000 GitHub - artroot/zabbix-graphic-viewer: Module on JavaScriph which helps to display zabbix graphics and management it.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

artroot/zabbix-graphic-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

zabbix-graphic-viewer

Module on JavaScript which helps to display zabbix graphics and to manage it in your app.

  • Hour, day and month modes;
  • Back or front time control;
  • Auto update.

Add to your index

<link rel="stylesheet" type="text/css" href="css/graph.css">
<script type="text/javascript" src="js/graph_compress.js"></script>

Example

Add the element where graphics will display:

<div id="graph_<Switch port or another uniq identificator>"></div>

Create instance of a class Graphic with your JSON data:

<script>
var data = {
        'port' : <Switch port or another uniq identificator, div element id must be as this one>,
        'period' : <Zabbix graphic period in seconds>,
        'stime' : <Start display time, for example (YYYYMMDDHHmmss): 20170418214112>,
        'width' : <Width of graphic image>,
        'height' : <Height of graphic image>,
        'zabbix_path' : <Zabbix api controller/action path>,
        'graphids' : [
          {
              'graphid' : <Zabbix graphic identificator>
          }
          ...
        ]
};

var graph = new Graphic(data);
graph.create();
</script>

The script will add the next structure into div body:

<div id="graph_1" class="zabbix-graphics">
        <ul class="pagination">
                <li mode="hour">
                        <a href="javascript:void(0)" mode="hour" aria-label="Previous">
                                <span>«</span>
                        </a>
                </li>
                <li class="active" period="3600" mode="hour">
                        <a href="javascript:void(0)">Час</a>
                </li>
                <li class="" period="86400" mode="day">
                        <a href="javascript:void(0)">День</a>
                </li>
                <li class="" period="2592000" mode="month">
                        <a href="javascript:void(0)">Месяц</a>
                </li>
                <li mode="hour">
                        <a href="javascript:void(0)" mode="hour" aria-label="Next">
                                <span>»</span>
                        </a>
                </li>
        </ul>
        <p class="timer">0</p>
        <figure>
                <img src="zabbix?graphid=12782&amp;period=3600&amp;stime=20170418210829&amp;width=400&amp;height=150" graphid="12782">
        </figure>
</div>

Some work screenshots:

alt text alt text
alt text

About

Module on JavaScriph which helps to display zabbix graphics and management it.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0