Mzcs is Zabbix Graph Output Tool.
You will arrive at the office in the morning, check the metrics for each server Zabbix.
Mzcs will help you to check the metrics Morning, gives you time to drink another glass of coffee:)
Past <-------------------> Today
1. [ x x x x x x x x x x x o o ]
2. [ x x x x x x x x x x o o x ]
3. [ o o o o o o o o o o o o o ]
- [now] ---------- [24hour ago]
- [24hour ago] --- [48hour ago]
- [now] ------- [two weeks ago]
![image] (https://dl.dropbox.com/u/5390179/Mzcs-view3.png)
![image] (https://dl.dropbox.com/u/5390179/Mzcs-view2.png)
![image] (https://dl.dropbox.com/u/5390179/Mzcs-view.png)
Pleas reading this code.
customize area.
### Zabbix Settings ###
my $username = "";
my $password = "";
Attention! Refresh enters while you're getting set Graph Refresh Time "0" for this account(Profile).
### Your Zabbix URL
my $url = 'https://localhost/zabbix';
### MySQL settings ###
my $data_source = "DBI:mysql:zabbix";
my $db_username = "";
my $db_password = "";
DBI:mysql:YOURZABBIX_DATABASE
my @graph_category = (
"CPU Utilization",
"DiskUsage",
"Load Average",
"Memory Utilization",
"Swap Utilization",
"Network Traffic (eth0)",
"Network Traffic (eth1)",
"MySQL queries",
"MySQL slave delay"
);
my %filepath = (
cpu => "CPU Utilization",
disk => "DiskUsage",
memory => "Memory Utilization",
swap => "Swap Utilization",
loa => "Load Average",
netone => "Network Traffic (eth0)",
nettwo => "Network Traffic (eth1)",
query => "MySQL queries",
slave => "MySQL slave delay",
slave => "MySQL slave delay"
);
@graph_category is Zabbix Graph Name. pull out ID from Zabbix database using the name of this Graph Name.
@filepath is A name of the index of each graph. Look View => Header.
### CPU = Fork
my $pm = new Parallel::ForkManager(2);
set your CPU Core.
my $time = "095000"; # for time. 09:00:00
default 09:00 ~ 09:00
-
git clone git://github.com/kenjiskywalker/Mzcs.git at your WebServer's DucumentRoot.
-
Look "How To Use" => I confirm "customize are", and please change it for one's setting.
-
this script run!run!run! exp) *"1 9 * * ** perl Mzcs.pl @ cron
-
this script download graphs. so access your WebServer. Look Mzcs Directory /index.html to go!
my $sql = "SELECT graphid FROM graphs WHERE name = ?";
debug time
my $sql = "SELECT graphid FROM graphs WHERE name = ? LIMIT 1";
:)
enjoy.
The MIT License (MIT) Copyright (c) 2012, kenjiskywalker All rights reserved.
Also, "css/bootsrap" (Twitter Bootstrap), is The Apache License, Version 2.0