File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8787 }
8888}
8989
90+ print 'NOTE: APCUPSD Poller Process Starting. ' . PHP_EOL ;
91+
9092$ host_template_id = db_fetch_cell_prepared ('SELECT id FROM host_template WHERE hash = ? ' , array ($ hash ));
9193$ add_devices = true ;
9294
98100/* apcupsd upses first UPS */
99101$ upses = db_fetch_assoc_prepared ('SELECT ups.*
100102 FROM apcupsd_ups AS ups
101- INNER JOIN apcupsd_ups_stats AS stats
103+ LEFT JOIN apcupsd_ups_stats AS stats
102104 ON ups.id = stats.ups_id
103105 WHERE type_id = 1
104106 AND enabled = "on"
108110$ apcupsd = cacti_sizeof ($ upses );
109111
110112if ($ apcupsd > 0 ) {
113+ printf ('NOTE: Found %s apcaccess enabled UPS \'s ' . PHP_EOL , $ apcupsd );
114+
111115 foreach ($ upses as $ ups ) {
112116 debug (sprintf ('Collecting UPS Information for %s ' , $ ups ['name ' ]));
113117
125129 add_ups_device ($ ups , $ host_template_id );
126130 }
127131 }
132+ } else {
133+ printf ('NOTE: Did not find any apcaccess enabled UPS \'s ' . PHP_EOL );
128134}
129135
130-
131136/* apcupsd upses first UPS */
132137$ upses = db_fetch_assoc ('SELECT *
133138 FROM apcupsd_ups
137142$ snmpupses = cacti_sizeof ($ upses );
138143
139144if ($ snmpupses > 0 ) {
145+ printf ('NOTE: Found %s snmp enabled UPS \'s ' . PHP_EOL , $ apcupsd );
146+
140147 foreach ($ upses as $ ups ) {
141148 debug (sprintf ('Collecting UPS Information for %s ' , $ ups ['name ' ]));
142149
154161 add_ups_device ($ ups , $ host_template_id , true );
155162 }
156163 }
164+ } else {
165+ printf ('NOTE: Did not find any snmp enabled UPS \'s ' . PHP_EOL );
157166}
158167
159168$ end = microtime (true );
You can’t perform that action at this time.
0 commit comments