Skip to content

Commit c22f40a

Browse files
authoredNov 16, 2017
nginxCacheStatus.php
1 parent e9c86c6 commit c22f40a

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
 

‎nginxCacheStatus.php

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
#
3+
# Plugin: nginxCacheStatus.sh
4+
#
5+
#
6+
$opt[1] = "--vertical-label \"Usage\" -b 1024 -l 0 --title \"NGINX cache hitrate for $hostname / $servicedesc\" ";
7+
#hit
8+
$def[1] = "DEF:var1=$rrdfile:$DS[1]:AVERAGE " ;
9+
10+
$def[1] .= "LINE:var1#FF0000:\"hit\" " ;
11+
$def[1] .= "GPRINT:var1:LAST:\"%3.2lf %Sp last\" " ;
12+
$def[1] .= "GPRINT:var1:AVERAGE:\"%3.2lf %Sp avg\" " ;
13+
$def[1] .= "GPRINT:var1:MAX:\"%3.2lf %Sp max\l\" ";
14+
15+
#miss
16+
$def[1] .= "DEF:var2=$rrdfile:$DS[2]:AVERAGE " ;
17+
18+
$def[1] .= "LINE:var2#FF8000:\"miss\" " ;
19+
$def[1] .= "GPRINT:var2:LAST:\"%3.2lf %Sp last\" " ;
20+
$def[1] .= "GPRINT:var2:AVERAGE:\"%3.2lf %Sp avg\" " ;
21+
$def[1] .= "GPRINT:var2:MAX:\"%3.2lf %Sp max\l\" ";
22+
23+
#expired
24+
$def[1] .= "DEF:var3=$rrdfile:$DS[3]:AVERAGE " ;
25+
26+
$def[1] .= "LINE:var3#4B8A08:\"expired\" " ;
27+
$def[1] .= "GPRINT:var3:LAST:\"%3.2lf %Sp last\" " ;
28+
$def[1] .= "GPRINT:var3:AVERAGE:\"%3.2lf %Sp avg\" " ;
29+
$def[1] .= "GPRINT:var3:MAX:\"%3.2lf %Sp max\l\" ";
30+
31+
#updating
32+
$def[1] .= "DEF:var4=$rrdfile:$DS[4]:AVERAGE " ;
33+
34+
$def[1] .= "LINE:var4#2E3B0B:\"updating\" " ;
35+
$def[1] .= "GPRINT:var4:LAST:\"%3.2lf %Sp last\" " ;
36+
$def[1] .= "GPRINT:var4:AVERAGE:\"%3.2lf %Sp avg\" " ;
37+
$def[1] .= "GPRINT:var4:MAX:\"%3.2lf %Sp max\l\" ";
38+
39+
?>

0 commit comments

Comments
 (0)
Please sign in to comment.