44 |
|
return "Paging"; |
45 |
|
} |
46 |
|
|
47 |
+ |
# The name Uptime information should be displayed as |
48 |
+ |
if($string == "uptime") { |
49 |
+ |
return "Uptime"; |
50 |
+ |
} |
51 |
+ |
|
52 |
|
# Values use for escaping (need to match the perl scripts!) |
53 |
|
# / converted to a decimal then hex'd |
54 |
|
$hex_slash = "_2f"; |
55 |
|
# _ converted to a decimal then hex'd |
56 |
|
$hex_underscore = "_5f"; |
57 |
+ |
# (space) converted to a decimal then hex'd |
58 |
+ |
$hex_space = "_20"; |
59 |
+ |
# : converted to a decimal then hex'd |
60 |
+ |
$hex_colon = "_3A"; |
61 |
+ |
# \ converted to a decimal then hex'd |
62 |
+ |
$hex_bslash = "_5C"; |
63 |
+ |
# ( converted to a decimal then hex'd |
64 |
+ |
$hex_rbracket = "_28"; |
65 |
+ |
# ) converted to a decimal then hex'd |
66 |
+ |
$hex_lbracket = "_29"; |
67 |
+ |
# + converted to a decimal then hex'd |
68 |
+ |
$hex_plus = "_2B"; |
69 |
+ |
# # converted to a decimal then hex'd |
70 |
+ |
$hex_hash = "_23"; |
71 |
|
|
72 |
|
# The name Disk information should be displayed as |
73 |
|
if(preg_match("/^disk-(\S+)$/", $string, $matches)) { |
74 |
|
$string = preg_replace("/$hex_slash/", "/", $matches[1]); |
75 |
|
$string = preg_replace("/$hex_underscore/", "_", $string); |
76 |
+ |
$string = preg_replace("/$hex_bslash/", "\\", $string); |
77 |
+ |
$string = preg_replace("/$hex_space/", " ", $string); |
78 |
+ |
$string = preg_replace("/$hex_colon/", ":", $string); |
79 |
|
return "Disk usage: $string"; |
80 |
+ |
} |
81 |
+ |
|
82 |
+ |
# The name DiskIO information should be displayed as |
83 |
+ |
if(preg_match("/^diskio-(\S+)$/", $string, $matches)) { |
84 |
+ |
$string = preg_replace("/$hex_slash/", "/", $matches[1]); |
85 |
+ |
$string = preg_replace("/$hex_underscore/", "_", $string); |
86 |
+ |
$string = preg_replace("/$hex_bslash/", "\\", $string); |
87 |
+ |
$string = preg_replace("/$hex_space/", " ", $string); |
88 |
+ |
$string = preg_replace("/$hex_colon/", ":", $string); |
89 |
+ |
return "Disk IO: $string"; |
90 |
+ |
} |
91 |
+ |
|
92 |
+ |
# The name Network information should be displayed as |
93 |
+ |
if(preg_match("/^net-(\S+)$/", $string, $matches)) { |
94 |
+ |
$string = preg_replace("/$hex_slash/", "/", $matches[1]); |
95 |
+ |
$string = preg_replace("/$hex_underscore/", "_", $string); |
96 |
+ |
$string = preg_replace("/$hex_bslash/", "\\", $string); |
97 |
+ |
$string = preg_replace("/$hex_space/", " ", $string); |
98 |
+ |
$string = preg_replace("/$hex_colon/", ":", $string); |
99 |
+ |
$string = preg_replace("/$hex_lbracket/", "(", $string); |
100 |
+ |
$string = preg_replace("/$hex_rbracket/", ")", $string); |
101 |
+ |
$string = preg_replace("/$hex_plus/", "+", $string); |
102 |
+ |
$string = preg_replace("/$hex_hash/", "#", $string); |
103 |
+ |
return "Network IO: $string"; |
104 |
+ |
} |
105 |
+ |
|
106 |
+ |
# The name Mail Queue information should be displayed as |
107 |
+ |
if(preg_match("/^mailq-(\S+)$/", $string, $matches)) { |
108 |
+ |
return "Mail Queue Size: $matches[1]"; |
109 |
|
} |
110 |
|
|
111 |
|
# The name Queue information should be displayed as |