diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/collectd.inc.php | 24 | ||||
-rw-r--r-- | inc/types.db | 187 |
2 files changed, 211 insertions, 0 deletions
diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php index 3bfc6ff..695d79c 100644 --- a/inc/collectd.inc.php +++ b/inc/collectd.inc.php | |||
@@ -167,3 +167,27 @@ function plugin_sort($data) { | |||
167 | 167 | ||
168 | return $data; | 168 | return $data; |
169 | } | 169 | } |
170 | |||
171 | function parse_typesdb_file($file = '/usr/share/collectd/types.db') { | ||
172 | if (!file_exists($file)) | ||
173 | $file = 'inc/types.db'; | ||
174 | |||
175 | $types = array(); | ||
176 | foreach (file($file) as $type) { | ||
177 | if(!preg_match('/^(?P<dataset>[\w_]+)\s+(?P<datasources>.*)/', $type, $matches)) | ||
178 | continue; | ||
179 | $dataset = $matches['dataset']; | ||
180 | $datasources = explode(', ', $matches['datasources']); | ||
181 | |||
182 | foreach ($datasources as $ds) { | ||
183 | if (!preg_match('/^(?P<dsname>\w+):(?P<dstype>[\w]+):(?P<min>[\-\dU\.]+):(?P<max>[\dU\.]+)/', $ds, $matches)) | ||
184 | error_log(sprintf('CGP Error: DS "%s" from dataset "%s" did not match', $ds, $dataset)); | ||
185 | $types[$dataset][$matches['dsname']] = array( | ||
186 | 'dstype' => $matches['dstype'], | ||
187 | 'min' => $matches['min'], | ||
188 | 'max' => $matches['max'], | ||
189 | ); | ||
190 | } | ||
191 | } | ||
192 | return $types; | ||
193 | } | ||
diff --git a/inc/types.db b/inc/types.db new file mode 100644 index 0000000..e6345ab --- /dev/null +++ b/inc/types.db | |||
@@ -0,0 +1,187 @@ | |||
1 | absolute value:ABSOLUTE:0:U | ||
2 | apache_bytes value:DERIVE:0:U | ||
3 | apache_connections value:GAUGE:0:65535 | ||
4 | apache_idle_workers value:GAUGE:0:65535 | ||
5 | apache_requests value:DERIVE:0:U | ||
6 | apache_scoreboard value:GAUGE:0:65535 | ||
7 | ath_nodes value:GAUGE:0:65535 | ||
8 | ath_stat value:DERIVE:0:U | ||
9 | bitrate value:GAUGE:0:4294967295 | ||
10 | bytes value:GAUGE:0:U | ||
11 | cache_operation value:DERIVE:0:U | ||
12 | cache_ratio value:GAUGE:0:100 | ||
13 | cache_result value:DERIVE:0:U | ||
14 | cache_size value:GAUGE:0:4294967295 | ||
15 | charge value:GAUGE:0:U | ||
16 | compression_ratio value:GAUGE:0:2 | ||
17 | compression uncompressed:DERIVE:0:U, compressed:DERIVE:0:U | ||
18 | connections value:DERIVE:0:U | ||
19 | conntrack value:GAUGE:0:4294967295 | ||
20 | contextswitch value:DERIVE:0:U | ||
21 | counter value:COUNTER:U:U | ||
22 | cpufreq value:GAUGE:0:U | ||
23 | cpu value:DERIVE:0:U | ||
24 | current_connections value:GAUGE:0:U | ||
25 | current_sessions value:GAUGE:0:U | ||
26 | current value:GAUGE:U:U | ||
27 | delay value:GAUGE:-1000000:1000000 | ||
28 | derive value:DERIVE:0:U | ||
29 | df_complex value:GAUGE:0:U | ||
30 | df_inodes value:GAUGE:0:U | ||
31 | df used:GAUGE:0:1125899906842623, free:GAUGE:0:1125899906842623 | ||
32 | disk_latency read:GAUGE:0:U, write:GAUGE:0:U | ||
33 | disk_merged read:DERIVE:0:U, write:DERIVE:0:U | ||
34 | disk_octets read:DERIVE:0:U, write:DERIVE:0:U | ||
35 | disk_ops_complex value:DERIVE:0:U | ||
36 | disk_ops read:DERIVE:0:U, write:DERIVE:0:U | ||
37 | disk_time read:DERIVE:0:U, write:DERIVE:0:U | ||
38 | dns_answer value:DERIVE:0:U | ||
39 | dns_notify value:DERIVE:0:U | ||
40 | dns_octets queries:DERIVE:0:U, responses:DERIVE:0:U | ||
41 | dns_opcode value:DERIVE:0:U | ||
42 | dns_qtype_cached value:GAUGE:0:4294967295 | ||
43 | dns_qtype value:DERIVE:0:U | ||
44 | dns_query value:DERIVE:0:U | ||
45 | dns_question value:DERIVE:0:U | ||
46 | dns_rcode value:DERIVE:0:U | ||
47 | dns_reject value:DERIVE:0:U | ||
48 | dns_request value:DERIVE:0:U | ||
49 | dns_resolver value:DERIVE:0:U | ||
50 | dns_response value:DERIVE:0:U | ||
51 | dns_transfer value:DERIVE:0:U | ||
52 | dns_update value:DERIVE:0:U | ||
53 | dns_zops value:DERIVE:0:U | ||
54 | email_check value:GAUGE:0:U | ||
55 | email_count value:GAUGE:0:U | ||
56 | email_size value:GAUGE:0:U | ||
57 | entropy value:GAUGE:0:4294967295 | ||
58 | fanspeed value:GAUGE:0:U | ||
59 | file_size value:GAUGE:0:U | ||
60 | files value:GAUGE:0:U | ||
61 | fork_rate value:DERIVE:0:U | ||
62 | frequency value:GAUGE:0:U | ||
63 | frequency_offset value:GAUGE:-1000000:1000000 | ||
64 | fscache_stat value:DERIVE:0:U | ||
65 | gauge value:GAUGE:U:U | ||
66 | http_request_methods value:DERIVE:0:U | ||
67 | http_requests value:DERIVE:0:U | ||
68 | http_response_codes value:DERIVE:0:U | ||
69 | humidity value:GAUGE:0:100 | ||
70 | if_collisions value:DERIVE:0:U | ||
71 | if_dropped rx:DERIVE:0:U, tx:DERIVE:0:U | ||
72 | if_errors rx:DERIVE:0:U, tx:DERIVE:0:U | ||
73 | if_multicast value:DERIVE:0:U | ||
74 | if_octets rx:DERIVE:0:U, tx:DERIVE:0:U | ||
75 | if_packets rx:DERIVE:0:U, tx:DERIVE:0:U | ||
76 | if_rx_errors value:DERIVE:0:U | ||
77 | if_tx_errors value:DERIVE:0:U | ||
78 | invocations value:DERIVE:0:U | ||
79 | io_octets rx:DERIVE:0:U, tx:DERIVE:0:U | ||
80 | io_packets rx:DERIVE:0:U, tx:DERIVE:0:U | ||
81 | ipt_bytes value:DERIVE:0:U | ||
82 | ipt_packets value:DERIVE:0:U | ||
83 | irq value:DERIVE:0:U | ||
84 | latency value:GAUGE:0:65535 | ||
85 | links value:GAUGE:0:U | ||
86 | load shortterm:GAUGE:0:100, midterm:GAUGE:0:100, longterm:GAUGE:0:100 | ||
87 | memcached_command value:DERIVE:0:U | ||
88 | memcached_connections value:GAUGE:0:U | ||
89 | memcached_items value:GAUGE:0:U | ||
90 | memcached_octets rx:DERIVE:0:U, tx:DERIVE:0:U | ||
91 | memcached_ops value:DERIVE:0:U | ||
92 | memory value:GAUGE:0:281474976710656 | ||
93 | multimeter value:GAUGE:U:U | ||
94 | mysql_commands value:DERIVE:0:U | ||
95 | mysql_handler value:DERIVE:0:U | ||
96 | mysql_locks value:DERIVE:0:U | ||
97 | mysql_log_position value:DERIVE:0:U | ||
98 | mysql_octets rx:DERIVE:0:U, tx:DERIVE:0:U | ||
99 | nfs_procedure value:DERIVE:0:U | ||
100 | nginx_connections value:GAUGE:0:U | ||
101 | nginx_requests value:DERIVE:0:U | ||
102 | node_octets rx:DERIVE:0:U, tx:DERIVE:0:U | ||
103 | node_rssi value:GAUGE:0:255 | ||
104 | node_stat value:DERIVE:0:U | ||
105 | node_tx_rate value:GAUGE:0:127 | ||
106 | operations value:DERIVE:0:U | ||
107 | percent value:GAUGE:0:100.1 | ||
108 | pg_blks value:DERIVE:0:U | ||
109 | pg_db_size value:GAUGE:0:U | ||
110 | pg_n_tup_c value:DERIVE:0:U | ||
111 | pg_n_tup_g value:GAUGE:0:U | ||
112 | pg_numbackends value:GAUGE:0:U | ||
113 | pg_scan value:DERIVE:0:U | ||
114 | pg_xact value:DERIVE:0:U | ||
115 | ping_droprate value:GAUGE:0:100 | ||
116 | ping value:GAUGE:0:65535 | ||
117 | ping_stddev value:GAUGE:0:65535 | ||
118 | players value:GAUGE:0:1000000 | ||
119 | power value:GAUGE:0:U | ||
120 | protocol_counter value:DERIVE:0:U | ||
121 | ps_code value:GAUGE:0:9223372036854775807 | ||
122 | ps_count processes:GAUGE:0:1000000, threads:GAUGE:0:1000000 | ||
123 | ps_cputime user:DERIVE:0:U, syst:DERIVE:0:U | ||
124 | ps_data value:GAUGE:0:9223372036854775807 | ||
125 | ps_disk_octets read:DERIVE:0:U, write:DERIVE:0:U | ||
126 | ps_disk_ops read:DERIVE:0:U, write:DERIVE:0:U | ||
127 | ps_pagefaults minflt:DERIVE:0:U, majflt:DERIVE:0:U | ||
128 | ps_rss value:GAUGE:0:9223372036854775807 | ||
129 | ps_stacksize value:GAUGE:0:9223372036854775807 | ||
130 | ps_state value:GAUGE:0:65535 | ||
131 | ps_vm value:GAUGE:0:9223372036854775807 | ||
132 | queue_length value:GAUGE:0:U | ||
133 | records value:GAUGE:0:U | ||
134 | requests value:GAUGE:0:U | ||
135 | response_time value:GAUGE:0:U | ||
136 | route_etx value:GAUGE:0:U | ||
137 | route_metric value:GAUGE:0:U | ||
138 | routes value:GAUGE:0:U | ||
139 | serial_octets rx:DERIVE:0:U, tx:DERIVE:0:U | ||
140 | signal_noise value:GAUGE:U:0 | ||
141 | signal_power value:GAUGE:U:0 | ||
142 | signal_quality value:GAUGE:0:U | ||
143 | snr value:GAUGE:0:U | ||
144 | spam_check value:GAUGE:0:U | ||
145 | spam_score value:GAUGE:U:U | ||
146 | swap_io value:DERIVE:0:U | ||
147 | swap value:GAUGE:0:1099511627776 | ||
148 | tcp_connections value:GAUGE:0:4294967295 | ||
149 | temperature value:GAUGE:-273.15:U | ||
150 | threads value:GAUGE:0:U | ||
151 | time_dispersion value:GAUGE:-1000000:1000000 | ||
152 | timeleft value:GAUGE:0:3600 | ||
153 | time_offset value:GAUGE:-1000000:1000000 | ||
154 | total_bytes value:DERIVE:0:U | ||
155 | total_connections value:DERIVE:0:U | ||
156 | total_operations value:DERIVE:0:U | ||
157 | total_requests value:DERIVE:0:U | ||
158 | total_sessions value:DERIVE:0:U | ||
159 | total_threads value:DERIVE:0:U | ||
160 | total_time_in_ms value:DERIVE:0:U | ||
161 | total_values value:DERIVE:0:U | ||
162 | uptime value:GAUGE:0:4294967295 | ||
163 | users value:GAUGE:0:65535 | ||
164 | vcpu value:GAUGE:0:U | ||
165 | virt_cpu_total value:DERIVE:0:U | ||
166 | virt_vcpu value:DERIVE:0:U | ||
167 | vmpage_action value:DERIVE:0:U | ||
168 | vmpage_faults minflt:DERIVE:0:U, majflt:DERIVE:0:U | ||
169 | vmpage_io in:DERIVE:0:U, out:DERIVE:0:U | ||
170 | vmpage_number value:GAUGE:0:4294967295 | ||
171 | volatile_changes value:GAUGE:0:U | ||
172 | voltage_threshold value:GAUGE:U:U, threshold:GAUGE:U:U | ||
173 | voltage value:GAUGE:U:U | ||
174 | vs_memory value:GAUGE:0:9223372036854775807 | ||
175 | vs_processes value:GAUGE:0:65535 | ||
176 | vs_threads value:GAUGE:0:65535 | ||
177 | # | ||
178 | # Legacy types | ||
179 | # (required for the v5 upgrade target) | ||
180 | # | ||
181 | arc_counts demand_data:COUNTER:0:U, demand_metadata:COUNTER:0:U, prefetch_data:COUNTER:0:U, prefetch_metadata:COUNTER:0:U | ||
182 | arc_l2_bytes read:COUNTER:0:U, write:COUNTER:0:U | ||
183 | arc_l2_size value:GAUGE:0:U | ||
184 | arc_ratio value:GAUGE:0:U | ||
185 | arc_size current:GAUGE:0:U, target:GAUGE:0:U, minlimit:GAUGE:0:U, maxlimit:GAUGE:0:U | ||
186 | mysql_qcache hits:COUNTER:0:U, inserts:COUNTER:0:U, not_cached:COUNTER:0:U, lowmem_prunes:COUNTER:0:U, queries_in_cache:GAUGE:0:U | ||
187 | mysql_threads running:GAUGE:0:U, connected:GAUGE:0:U, cached:GAUGE:0:U, created:COUNTER:0:U | ||