Skip to content

Commit

Permalink
move " on <HOSTNAME>" suffix in graph title to JSON
Browse files Browse the repository at this point in the history
Closes #101
  • Loading branch information
Łukasz Kostka authored and pommi committed Aug 25, 2014
1 parent 4c7146f commit 2c5c2a6
Show file tree
Hide file tree
Showing 45 changed files with 144 additions and 142 deletions.
8 changes: 5 additions & 3 deletions graph.php
Expand Up @@ -83,9 +83,11 @@
}

if (isset($plugin_json[$type]['title'])) {
$obj->rrd_title = $plugin_json[$type]['title'];
$obj->rrd_title = str_replace('{{PI}}', GET('pi'), $obj->rrd_title);
$obj->rrd_title = str_replace('{{TI}}', GET('ti'), $obj->rrd_title);
$obj->rrd_title = str_replace(
array('{{PI}}', '{{TI}}', '{{HOST}}'),
array(GET('pi'), GET('ti'), GET('h')),
$plugin_json[$type]['title']
);
}

if (isset($plugin_json[$type]['vertical'])) {
Expand Down
10 changes: 5 additions & 5 deletions plugin/apache.json
@@ -1,6 +1,6 @@
{
"apache_bytes": {
"title": "Webserver Traffic ({{PI}})",
"title": "Webserver Traffic ({{PI}}) on {{HOST}}",
"vertical": "{{ND}}/s",
"legend": {
"value": {
Expand All @@ -11,7 +11,7 @@
"legend_format": "%5.1lf"
},
"apache_connections": {
"title": "Webserver Connections ({{PI}})",
"title": "Webserver Connections ({{PI}}) on {{HOST}}",
"vertical": "Conns/s",
"legend": {
"value": {
Expand All @@ -22,7 +22,7 @@
"legend_format": "%5.1lf"
},
"apache_idle_workers": {
"title": "Webserver Idle Workers ({{PI}})",
"title": "Webserver Idle Workers ({{PI}}) on {{HOST}}",
"vertical": "Workers",
"legend": {
"value": {
Expand All @@ -33,7 +33,7 @@
"legend_format": "%5.1lf"
},
"apache_requests": {
"title": "Webserver Requests ({{PI}})",
"title": "Webserver Requests ({{PI}}) on {{HOST}}",
"vertical": "Requests/s",
"legend": {
"value": {
Expand All @@ -44,7 +44,7 @@
"legend_format": "%5.1lf"
},
"apache_scoreboard": {
"title": "Webserver Scoreboard ({{PI}})",
"title": "Webserver Scoreboard ({{PI}}) on {{HOST}}",
"vertical": "Slots",
"type": "stacked",
"legend": {
Expand Down
12 changes: 6 additions & 6 deletions plugin/apcups.json
@@ -1,6 +1,6 @@
{
"charge": {
"title": "UPS Charge",
"title": "UPS Charge on {{HOST}}",
"vertical": "Ampere hours",
"legend": {
"value": {
Expand All @@ -11,7 +11,7 @@
"legend_format": "%5.1lf%s"
},
"frequency": {
"title": "UPS Input Frequency",
"title": "UPS Input Frequency on {{HOST}}",
"vertical": "Hertz",
"legend": {
"value": {
Expand All @@ -22,7 +22,7 @@
"legend_format": "%5.1lf%s"
},
"percent": {
"title": "UPS Load",
"title": "UPS Load on {{HOST}}",
"vertical": "Load",
"legend": {
"value": {
Expand All @@ -33,7 +33,7 @@
"legend_format": "%5.1lf%s"
},
"temperature": {
"title": "UPS Temperature",
"title": "UPS Temperature on {{HOST}}",
"vertical": "Celsius",
"legend": {
"value": {
Expand All @@ -43,7 +43,7 @@
}
},
"timeleft": {
"title": "UPS Time Left",
"title": "UPS Time Left on {{HOST}}",
"vertical": "Seconds",
"legend": {
"value": {
Expand All @@ -54,7 +54,7 @@
"legend_format": "%5.1lf%s"
},
"voltage": {
"title": "UPS Voltage {{TI}}",
"title": "UPS Voltage {{TI}} on {{HOST}}",
"vertical": "Volt",
"legend": {
"value": {
Expand Down
6 changes: 3 additions & 3 deletions plugin/battery.json
@@ -1,6 +1,6 @@
{
"charge": {
"title": "Charge (Battery {{PI}})",
"title": "Charge (Battery {{PI}}) on {{HOST}}",
"vertical": "Ampere hours",
"legend": {
"value": {
Expand All @@ -11,7 +11,7 @@
"legend_format": "%5.1lf%s"
},
"current": {
"title": "Current (Battery {{PI}})",
"title": "Current (Battery {{PI}}) on {{HOST}}",
"vertical": "Ampere",
"legend": {
"value": {
Expand All @@ -22,7 +22,7 @@
"legend_format": "%5.1lf%s"
},
"voltage": {
"title": "Voltage (Battery {{PI}})",
"title": "Voltage (Battery {{PI}}) on {{HOST}}",
"vertical": "Volt",
"legend": {
"value": {
Expand Down
2 changes: 1 addition & 1 deletion plugin/conntrack.json
@@ -1,6 +1,6 @@
{
"conntrack": {
"title": "Conntrack entries",
"title": "Conntrack entries on {{HOST}}",
"vertical": "Entries",
"legend": {
"value": {
Expand Down
2 changes: 1 addition & 1 deletion plugin/contextswitch.json
@@ -1,6 +1,6 @@
{
"contextswitch": {
"title": "Context switches",
"title": "Context switches on {{HOST}}",
"vertical": "switch per second Bits",
"legend": {
"value": {
Expand Down
2 changes: 1 addition & 1 deletion plugin/cpu.json
@@ -1,6 +1,6 @@
{
"cpu": {
"title": "CPU-{{PI}} usage",
"title": "CPU-{{PI}} usage on {{HOST}}",
"vertical": "Jiffies",
"rrdtool_opts": ["-u", "100"],
"type": "stacked",
Expand Down
2 changes: 1 addition & 1 deletion plugin/cpufreq.json
@@ -1,6 +1,6 @@
{
"cpufreq": {
"title": "CPU frequency scaling",
"title": "CPU frequency scaling on {{HOST}}",
"vertical": "Hz",
"legend_format": "%5.1lf%s"
}
Expand Down
4 changes: 2 additions & 2 deletions plugin/df.json
@@ -1,6 +1,6 @@
{
"df_complex": {
"title": "Free space ({{PI}})",
"title": "Free space ({{PI}}) on {{HOST}}",
"vertical": "Bytes",
"type": "stacked",
"legend": {
Expand All @@ -21,7 +21,7 @@
"base": "1024"
},
"df_inodes": {
"title": "Free inodes ({{PI}})",
"title": "Free inodes ({{PI}}) on {{HOST}}",
"vertical": "Inodes",
"type": "stacked",
"legend": {
Expand Down
8 changes: 4 additions & 4 deletions plugin/disk.json
@@ -1,6 +1,6 @@
{
"disk_merged": {
"title": "Disk Merged Operations ({{PI}})",
"title": "Disk Merged Operations ({{PI}}) on {{HOST}}",
"vertical": "Merged operations/s",
"type": "io",
"legend": {
Expand All @@ -16,7 +16,7 @@
"legend_format": "%5.1lf%s"
},
"disk_octets": {
"title": "Disk Traffic ({{PI}})",
"title": "Disk Traffic ({{PI}}) on {{HOST}}",
"vertical": "Bytes per second",
"type": "io",
"legend": {
Expand All @@ -32,7 +32,7 @@
"legend_format": "%5.1lf%s"
},
"disk_ops": {
"title": "Disk Operations ({{PI}})",
"title": "Disk Operations ({{PI}}) on {{HOST}}",
"vertical": "Ops per second",
"type": "io",
"legend": {
Expand All @@ -48,7 +48,7 @@
"legend_format": "%5.1lf%s"
},
"disk_time": {
"title": "Disk time per operation ({{PI}})",
"title": "Disk time per operation ({{PI}}) on {{HOST}}",
"vertical": "Avg. Time/Op",
"type": "io",
"legend": {
Expand Down
8 changes: 4 additions & 4 deletions plugin/dns.json
@@ -1,6 +1,6 @@
{
"dns_octets": {
"title": "DNS traffic",
"title": "DNS traffic on {{HOST}}",
"vertical": "Bit/s",
"type": "stacked",
"legend": {
Expand All @@ -15,17 +15,17 @@
}
},
"dns_opcode": {
"title": "DNS Opcode Query",
"title": "DNS Opcode Query on {{HOST}}",
"vertical": "Queries/s",
"type": "stacked"
},
"dns_qtype": {
"title": "DNS QType",
"title": "DNS QType on {{HOST}}",
"vertical": "Queries/s",
"type": "stacked"
},
"dns_rcode": {
"title": "DNS Reply code",
"title": "DNS Reply code on {{HOST}}",
"vertical": "Queries/s",
"type": "stacked"
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/entropy.json
@@ -1,6 +1,6 @@
{
"entropy": {
"title": "Available entropy",
"title": "Available entropy on {{HOST}}",
"vertical": "Bits",
"legend": {
"value": {
Expand Down
4 changes: 2 additions & 2 deletions plugin/filecount.json
@@ -1,6 +1,6 @@
{
"bytes": {
"title": "Filecount: size ({{PI}})",
"title": "Filecount: size ({{PI}}) on {{HOST}}",
"vertical": "Bytes",
"type": "stacked",
"legend": {
Expand All @@ -12,7 +12,7 @@
"legend_format": "%5.1lf%s"
},
"files": {
"title": "Filecount: number of files ({{PI}})",
"title": "Filecount: number of files ({{PI}}) on {{HOST}}",
"vertical": "Files",
"type": "stacked",
"legend": {
Expand Down
2 changes: 1 addition & 1 deletion plugin/hddtemp.json
@@ -1,6 +1,6 @@
{
"temperature": {
"title": "HDD Temperature",
"title": "HDD Temperature on {{HOST}}",
"vertical": "°C",
"legend_format": "%5.1lf%s"
}
Expand Down
6 changes: 3 additions & 3 deletions plugin/interface.json
@@ -1,6 +1,6 @@
{
"if_octets": {
"title": "Interface Traffic ({{PI}})",
"title": "Interface Traffic ({{PI}}) on {{HOST}}",
"vertical": "{{ND}} per second",
"type": "io",
"legend": {
Expand All @@ -17,7 +17,7 @@
"datasize": true
},
"if_errors": {
"title": "Interface Errors ({{PI}})",
"title": "Interface Errors ({{PI}}) on {{HOST}}",
"vertical": "Errors per second",
"type": "io",
"legend": {
Expand All @@ -33,7 +33,7 @@
"legend_format": "%5.1lf%s"
},
"if_packets": {
"title": "Interface Packets ({{PI}})",
"title": "Interface Packets ({{PI}}) on {{HOST}}",
"vertical": "Packets per second",
"type": "io",
"legend": {
Expand Down
6 changes: 3 additions & 3 deletions plugin/ipmi.json
@@ -1,16 +1,16 @@
{
"fanspeed": {
"title": "Fanspeed ({{PI}})",
"title": "Fanspeed ({{PI}}) on {{HOST}}",
"vertical": "RPM",
"legend_format": "%5.1lf"
},
"temperature": {
"title": "Temperature ({{PI}})",
"title": "Temperature ({{PI}}) on {{HOST}}",
"vertical": "Celsius",
"legend_format": "%5.1lf%s"
},
"voltage": {
"title": "Voltage ({{PI}})",
"title": "Voltage ({{PI}}) on {{HOST}}",
"vertical": "Volt",
"legend_format": "%5.1lf"
}
Expand Down
4 changes: 2 additions & 2 deletions plugin/iptables.json
@@ -1,13 +1,13 @@
{
"ipt_bytes": {
"title": "IP-Tables Traffic",
"title": "IP-Tables Traffic on {{HOST}}",
"vertical": "{{ND}}",
"type": "stacked",
"legend_format": "%5.1lf%s",
"datasize": true
},
"ipt_packets": {
"title": "IP-Tables Packets",
"title": "IP-Tables Packets on {{HOST}}",
"vertical": "Packets",
"type": "stacked",
"legend_format": "%5.1lf%s"
Expand Down
2 changes: 1 addition & 1 deletion plugin/irq.json
@@ -1,7 +1,7 @@
{
"irq": {
"type": "stacked",
"title": "Interrupts",
"title": "Interrupts on {{HOST}}",
"vertical": "IRQs/s",
"legend_format": "%6.1lf"
}
Expand Down

0 comments on commit 2c5c2a6

Please sign in to comment.