1 --- npc/extinfo.php.orig 2005-10-10 14:17:15.000000000 +0000
2 +++ npc/extinfo.php 2006-12-26 16:32:52.000000000 +0000
6 - +-------------------------------------------------------------------------+
7 - | Nagios Plugin 0.1a for cacti 0.8.6f |
8 - | Copyright (C) 2005 Billy Gunn (billy@gunn.org) |
10 - | This program is free software; you can redistribute it and/or |
11 - | modify it under the terms of the GNU General Public License |
12 - | as published by the Free Software Foundation; either version 2 |
13 - | of the License, or (at your option) any later version. |
15 - | This program is distributed in the hope that it will be useful, |
16 - | but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 - | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 - | GNU General Public License for more details. |
19 - +-------------------------------------------------------------------------+
20 - | Cacti and Nagios are the copyright of their respective owners. |
21 - +-------------------------------------------------------------------------+
25 -include_once("./include/auth.php");
26 -include_once("./include/config.php");
28 -// Refresh the page at a user supplied interval
29 -header("Refresh: " . read_config_option("npc_refresh") . "; URL=" . $_SERVER["REQUEST_URI"]);
31 -/* set default action */
32 -if (!isset($_REQUEST["type"])) { $_REQUEST["type"] = ""; }
34 -switch ($_REQUEST["type"]) {
38 - include_once("./include/bottom_footer.php");
44 - include_once("./include/bottom_footer.php");
50 - include_once("./include/bottom_footer.php");
55 -function formatTime($time) {
57 - $days = floor($time/60/60/24);
58 - $time -= $days*60*60*24;
59 - $hours = floor($time/60/60);
60 - $time -= $hours*60*60;
61 - $minutes = floor($time/60);
62 - $time -= $minutes*60;
65 - return ($days . "d " . $hours . "h " . $minutes . "m " . $seconds . "s");
69 -function serviceInfo() {
71 - $hostid = $_REQUEST["hostid"];
72 - $serviceid = $_REQUEST["serviceid"];
73 - $hostname = $_REQUEST["hostname"];
74 - $serviceName = ereg_replace("\+", " ", $_REQUEST["service"]);
77 - if (isset($_POST["local_graph_id"])) {
78 - db_execute("update npc_service set cacti_graph_id = " . $_POST["local_graph_id"] . " where id = " . $serviceid);
79 - header("Location: extinfo.php?type=2&hostid=" . $hostid . "&hostname=" . $hostname . "&serviceid=" . $serviceid . "&service=" . $_REQUEST["service"]);
82 - include_once("top_npc_header.php");
84 - $background1 = "#F5F5F5";
85 - $background2 = "#E7E9F2";
86 - $rowColor = $background1;
88 - $service_detail = db_fetch_row("
90 - service_soft_state as 'Current Status',
91 - duration as 'State Duration',
92 - check_command as 'Check Command',
93 - plugin_output as 'Plugin Output',
94 - performance_data as 'Performance Data',
95 - current_attempt as 'Current Attempt',
96 - from_unixtime(last_check) as 'Last Check',
97 - from_unixtime(next_check) as 'Next Check',
98 - check_latency as 'Check Latency',
99 - check_execute_time as 'Check Duration',
102 - host_soft_state as 'Host Soft State',
103 - host_notifications as 'Host Notifications',
104 - service as 'Service',
107 - service_hard_state,
108 - service_notifications as 'Service Notifications',
109 - max_attempts as 'Max Attempts'
113 - npc_host.id as hostid,
115 - npc_hostgroup_membership.groupid as hostgroup,
116 - npc_host_history.soft_state as host_soft_state,
117 - npc_host.notifications_enabled as host_notifications,
118 - npc_service.id as serviceid,
119 - npc_service.cacti_graph_id,
120 - npc_service.service_description as service,
121 - npc_service_history.soft_state as service_soft_state,
122 - npc_service_history.hard_state as service_hard_state,
123 - npc_service.notifications_enabled as service_notifications,
124 - npc_service_check.last_check,
125 - npc_service_check.next_check,
126 - npc_service_check.check_execute_time,
127 - npc_service_check.check_latency,
128 - npc_service_check.check_command,
129 - npc_service_check.performance_data,
130 - unix_timestamp() - npc_service_history.started as duration,
131 - npc_service_history.current_attempt,
132 - npc_service_check.max_attempts,
133 - npc_service_history.plugin_output
137 - npc_hostgroup_membership,
140 - npc_service_history
142 - npc_host.id = npc_hostgroup_membership.hostid and
143 - npc_host.id = npc_service.hostid and
144 - npc_host.id = npc_host_history.hostid and
145 - npc_service.id = npc_service_check.serviceid and
146 - npc_service.id = npc_service_history.serviceid and
147 - npc_service_history.lasted is null and
148 - npc_host_history.lasted is null and
149 - npc_service.configured = TRUE and
150 - npc_service.has_been_checked = TRUE and
151 - npc_host.has_been_checked = TRUE
154 - npc_host.id as hostid,
157 - npc_host_history.soft_state as host_soft_state,
158 - npc_host.notifications_enabled as host_notifications,
159 - npc_service.id as serviceid,
160 - npc_service.cacti_graph_id,
161 - npc_service.service_description as service,
162 - npc_service_history.soft_state as service_soft_state,
163 - npc_service_history.hard_state as service_hard_state,
164 - npc_service.notifications_enabled as service_notifications,
165 - npc_service_check.last_check,
166 - npc_service_check.next_check,
167 - npc_service_check.check_execute_time,
168 - npc_service_check.check_latency,
169 - npc_service_check.check_command,
170 - npc_service_check.performance_data,
171 - unix_timestamp() - npc_service_history.started as duration,
172 - npc_service_history.current_attempt,
173 - npc_service_check.max_attempts,
174 - npc_service_history.plugin_output
180 - npc_service_history
182 - npc_host.id not in (select hostid from npc_hostgroup_membership) and
183 - npc_host.id = npc_service.hostid and
184 - npc_host.id = npc_host_history.hostid and
185 - npc_service.id = npc_service_check.serviceid and
186 - npc_service.id = npc_service_history.serviceid and
187 - npc_service_history.lasted is null and
188 - npc_host_history.lasted is null and
189 - npc_service.configured = TRUE and
190 - npc_service.has_been_checked = TRUE and
191 - npc_host.has_been_checked = TRUE
194 - npc_host.id as hostid,
196 - npc_hostgroup_membership.groupid as hostgroup,
197 - -1 as host_soft_state,
198 - npc_host.notifications_enabled as host_notifications,
199 - npc_service.id as serviceid,
200 - npc_service.cacti_graph_id,
201 - npc_service.service_description as service,
202 - npc_service_history.soft_state as service_soft_state,
203 - npc_service_history.hard_state as service_hard_state,
204 - npc_service.notifications_enabled as service_notifications,
205 - npc_service_check.last_check,
206 - npc_service_check.next_check,
207 - npc_service_check.check_execute_time,
208 - npc_service_check.check_latency,
209 - npc_service_check.check_command,
210 - npc_service_check.performance_data,
211 - unix_timestamp() - npc_service_history.started as duration,
212 - npc_service_history.current_attempt,
213 - npc_service_check.max_attempts,
214 - npc_service_history.plugin_output
217 - npc_hostgroup_membership,
220 - npc_service_history
222 - npc_host.id = npc_hostgroup_membership.hostid and
223 - npc_host.id = npc_service.hostid and
224 - npc_service.id = npc_service_check.serviceid and
225 - npc_service.id = npc_service_history.serviceid and
226 - npc_service_history.lasted is null and
227 - npc_service.configured = TRUE and
228 - npc_service.has_been_checked = TRUE and
229 - npc_host.has_been_checked = FALSE
232 - npc_host.id as hostid,
235 - -1 as host_soft_state,
236 - npc_host.notifications_enabled as host_notifications,
237 - npc_service.id as serviceid,
238 - npc_service.cacti_graph_id,
239 - npc_service.service_description as service,
240 - npc_service_history.soft_state as service_soft_state,
241 - npc_service_history.hard_state as service_hard_state,
242 - npc_service.notifications_enabled as service_notifications,
243 - npc_service_check.last_check,
244 - npc_service_check.next_check,
245 - npc_service_check.check_execute_time,
246 - npc_service_check.check_latency,
247 - npc_service_check.check_command,
248 - npc_service_check.performance_data,
249 - unix_timestamp() - npc_service_history.started as duration,
250 - npc_service_history.current_attempt,
251 - npc_service_check.max_attempts,
252 - npc_service_history.plugin_output
257 - npc_service_history
259 - npc_host.id not in (select hostid from npc_hostgroup_membership) and
260 - npc_host.id = npc_service.hostid and
261 - npc_service.id = npc_service_check.serviceid and
262 - npc_service.id = npc_service_history.serviceid and
263 - npc_service_history.lasted is null and
264 - npc_service.configured = TRUE and
265 - npc_service.has_been_checked = TRUE and
266 - npc_host.has_been_checked = FALSE
269 - npc_host.id as hostid,
271 - npc_hostgroup_membership.groupid as hostgroup,
272 - npc_host_history.soft_state as host_soft_state,
273 - npc_host.notifications_enabled as host_notifications,
274 - npc_service.id as serviceid,
275 - npc_service.cacti_graph_id,
276 - npc_service.service_description as service,
277 - -1 as service_soft_state,
278 - -1 as service_hard_state,
279 - npc_service.notifications_enabled as service_notifications,
280 - npc_service_check.last_check,
281 - npc_service_check.next_check,
282 - npc_service_check.check_execute_time,
283 - npc_service_check.check_latency,
284 - npc_service_check.check_command,
285 - npc_service_check.performance_data,
287 - 0 as current_attempt,
288 - npc_service_check.max_attempts,
289 - null as plugin_output
293 - npc_hostgroup_membership,
297 - npc_host.id = npc_hostgroup_membership.hostid and
298 - npc_host.id = npc_service.hostid and
299 - npc_host.id = npc_host_history.hostid and
300 - npc_service.id = npc_service_check.serviceid and
301 - npc_host_history.lasted is null and
302 - npc_service.configured = TRUE and
303 - npc_service.has_been_checked = FALSE and
304 - npc_host.has_been_checked = TRUE
307 - npc_host.id as hostid,
310 - npc_host_history.soft_state as host_soft_state,
311 - npc_host.notifications_enabled as host_notifications,
312 - npc_service.id as serviceid,
313 - npc_service.cacti_graph_id,
314 - npc_service.service_description as service,
315 - -1 as service_soft_state,
316 - -1 as service_hard_state,
317 - npc_service.notifications_enabled as service_notifications,
318 - npc_service_check.last_check,
319 - npc_service_check.next_check,
320 - npc_service_check.check_execute_time,
321 - npc_service_check.check_latency,
322 - npc_service_check.check_command,
323 - npc_service_check.performance_data,
325 - 0 as current_attempt,
326 - npc_service_check.max_attempts,
327 - null as plugin_output
334 - npc_host.id not in (select hostid from npc_hostgroup_membership) and
335 - npc_host.id = npc_service.hostid and
336 - npc_host.id = npc_host_history.hostid and
337 - npc_service.id = npc_service_check.serviceid and
338 - npc_host_history.lasted is null and
339 - npc_service.configured = TRUE and
340 - npc_service.has_been_checked = FALSE and
341 - npc_host.has_been_checked = TRUE
344 - npc_host.id as hostid,
346 - npc_hostgroup_membership.groupid as hostgroup,
347 - -1 as host_soft_state,
348 - npc_host.notifications_enabled as host_notifications,
349 - npc_service.id as serviceid,
350 - npc_service.cacti_graph_id,
351 - npc_service.service_description as service,
352 - -1 as service_soft_state,
353 - -1 as service_hard_state,
354 - npc_service.notifications_enabled as service_notifications,
355 - npc_service_check.last_check,
356 - npc_service_check.next_check,
357 - npc_service_check.check_execute_time,
358 - npc_service_check.check_latency,
359 - npc_service_check.check_command,
360 - npc_service_check.performance_data,
362 - 0 as current_attempt,
363 - npc_service_check.max_attempts,
364 - null as plugin_output
367 - npc_hostgroup_membership,
371 - npc_host.id = npc_hostgroup_membership.hostid and
372 - npc_host.id = npc_service.hostid and
373 - npc_service.id = npc_service_check.serviceid and
374 - npc_service.configured = TRUE and
375 - npc_service.has_been_checked = FALSE and
376 - npc_host.has_been_checked = FALSE
379 - npc_host.id as hostid,
382 - -1 as host_soft_state,
383 - npc_host.notifications_enabled as host_notifications,
384 - npc_service.id as serviceid,
385 - npc_service.cacti_graph_id,
386 - npc_service.service_description as service,
387 - -1 as service_soft_state,
388 - -1 as service_hard_state,
389 - npc_service.notifications_enabled as service_notifications,
390 - npc_service_check.last_check,
391 - npc_service_check.next_check,
392 - npc_service_check.check_execute_time,
393 - npc_service_check.check_latency,
394 - npc_service_check.check_command,
395 - npc_service_check.performance_data,
397 - 0 as current_attempt,
398 - npc_service_check.max_attempts,
399 - null as plugin_output
405 - npc_host.id not in (select hostid from npc_hostgroup_membership) and
406 - npc_host.id = npc_service.hostid and
407 - npc_service.id = npc_service_check.serviceid and
408 - npc_service.configured = TRUE and
409 - npc_service.has_been_checked = FALSE and
410 - npc_host.has_been_checked = FALSE
413 - ) as host_details where hostid = $hostid and service = '$serviceName'");
415 - $service_detail["flapping"] = db_fetch_cell("select id from npc_flapping_service where id = $serviceid");
416 - $service_config = db_fetch_row("select active_checks_enabled, passive_checks_enabled, event_handler_enabled, flap_detection_enabled, notifications_enabled, failure_prediction_enabled, process_performance_data, obsess_over_service, event_handler from npc_service where hostid = $hostid and service_description = '$serviceName'");
417 - $comments = db_fetch_assoc("select id,serviceid,timestamp,author,comment,persist,type from npc_comment where serviceid = '$serviceid'");
418 - $row_count = count($comments);
425 - <table width="98%" border="0" cellpadding="0" cellspacing="0" align="center">
426 - <tr class="textSubHeaderDark" bgcolor='#6d88ad'>
428 - <h2> [ <?php echo $serviceName; ?> ] on
429 - <a href="extinfo.php?type=1&hostid=<?php echo $hostid; ?>&hostname=<?php echo $hostname; ?>"><?php echo $hostname; ?></a></h2>
431 - <td align='right' nowrap>
432 - <FORM NAME="cl" ACTION="command.php" method="POST">Command:
433 - <INPUT TYPE='hidden' NAME='host' VALUE='<?php echo $hostname; ?>'>
434 - <INPUT TYPE='hidden' NAME='hostid' VALUE='<?php echo $service_detail["hostid"]; ?>'>
435 - <INPUT TYPE='hidden' NAME='service' VALUE='<?php echo $serviceName; ?>'>
436 - <INPUT TYPE='hidden' NAME='serviceid' VALUE='<?php echo $service_detail["serviceid"]; ?>'>
437 - <select name="command" size="1">
440 - if (read_config_option("nagios_commands")) {
442 - echo "<OPTION VALUE='NULL'>Execute a command</option>";
444 - if ($service_config["active_checks_enabled"]) {
445 - echo "<strong><OPTION VALUE='DISABLE_SVC_CHECK'>Disable active checks</option></strong>";
446 - echo "<OPTION VALUE='SCHEDULE_SVC_CHECK'>Re-schedule the next check</option>";
448 - echo "<OPTION VALUE='ENABLE_SVC_CHECK'>Enable Active Checks</option>";
450 - if ($service_config["passive_checks_enabled"]) {
451 - echo "<OPTION VALUE='PROCESS_SVC_CHECK_RESULT'>Submit passive check result</option>";
452 - echo "<OPTION VALUE='DISABLE_PASSIVE_SVC_CHECKS'>Stop accepting passive checks</option>";
454 - echo "<OPTION VALUE='ENABLE_PASSIVE_SVC_CHECKS'>Start accepting passive checks</option>";
456 - if ($service_config["obsess_over_service"]) {
457 - echo "<OPTION VALUE='STOP_OBSESSING_OVER_SVC'>Stop obsessing</option>";
459 - echo "<OPTION VALUE='START_OBSESSING_OVER_SVC'>Start obsessing</option>";
461 - if ($service_detail["Current Status"] == 1 || $service_detail["Current Status"] == 2 || $service_detail["Current Status"] == 3 && $service_detail["Current Status"] == $service_detail["service_hard_state"]) {
462 - if (!db_fetch_cell("select * from npc_comment where serviceid = $serviceid and type = 4;")) {
463 - echo "<OPTION VALUE='ACKNOWLEDGE_SVC_PROBLEM'>Acknowledge This Service Problem</option>";
464 - } elseif (db_fetch_cell("select * from npc_comment where serviceid = $serviceid and type = 4;")) {
465 - echo "<OPTION VALUE='REMOVE_SVC_ACKNOWLEDGEMENT'>Remove Problem Acknowledgement</option>";
468 - if ($service_config["notifications_enabled"]) {
469 - echo "<OPTION VALUE='DISABLE_SVC_NOTIFICATIONS'>Disable Notifications</option>";
470 - if ($service_detail["Current Status"] != 0) {
471 - echo "<OPTION VALUE='DELAY_SVC_NOTIFICATION'>Delay Next Service Notification</option>";
474 - echo "<OPTION VALUE='ENABLE_SVC_NOTIFICATIONS'>Enable Notifications</option>";
476 - echo "<OPTION VALUE='SCHEDULE_SVC_DOWNTIME'>Schedule Downtime</option>";
477 - if ($service_config["event_handler_enabled"]) {
478 - echo "<OPTION VALUE='DISABLE_SVC_EVENT_HANDLER'>Disable Event Handler</option>";
480 - echo "<OPTION VALUE='ENABLE_SVC_EVENT_HANDLER'>Enable Event Handler</option>";
482 - if ($service_config["flap_detection_enabled"]) {
483 - echo "<OPTION VALUE='DISABLE_SVC_FLAP_DETECTION'>Disable Flap Detection</option>";
485 - echo "<OPTION VALUE='ENABLE_SVC_FLAP_DETECTION'>Enable Flap Detection</option>";
487 - echo "<OPTION VALUE='ADD_SVC_COMMENT'>Add Service Comment</option>";
488 - echo "<OPTION VALUE='DEL_ALL_SVC_COMMENTS'>Delete All Service Comments</option>";
490 - echo "<OPTION VALUE=''>Command execution disabled</option>";
495 - <input type='image' src='../../images/button_go.gif' alt='Go' value='Execute' align='absmiddle'>
502 - <tr><td> </td><td> </td></tr>
505 - <table width="100%" border="0" align="left" valign="top">
507 - <tr class="textHeaderDark" bgcolor='#00438C'>
508 - <td align="center"><strong>Service State Information</strong></td>
513 - <td width="100%" valign="top">
514 - <table width="100%" align="center" cellpadding="3">
516 - <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
527 - foreach ($service_detail as $key => $value) {
532 - case "Current Status":
533 - echo "<tr bgcolor='" . $rowColor . "'>";
534 - echo "<td>" . $key . ":</td>";
538 - echo "<td class='statusPENDING'><strong>PENDING</strong></td>";
541 - echo "<td class='statusOK'><strong>OK</strong></td>";
544 - echo "<td class='statusWARNING'><strong>WARNING</strong></td>";
547 - echo "<td class='statusCRITICAL'><strong>CRITICAL</strong></td>";
550 - echo "<td class='statusUNKNOWN'><strong>UNKNOWN</strong></td>";
555 - case "State Duration":
556 - echo "<tr bgcolor='" . $rowColor . "'>";
557 - echo "<td>" . $key . ":</td>";
558 - echo "<td>" . formatTime($value) . "</td>";
561 - case "Check Command":
562 - echo "<tr bgcolor='" . $rowColor . "'>";
563 - echo "<td>" . $key . ":</td>";
564 - echo "<td>" . $value . "</td>";
567 - case "Plugin Output":
568 - echo "<tr bgcolor='" . $rowColor . "'>";
569 - echo "<td>" . $key . ":</td>";
570 - echo "<td>" . $value . "</td>";
573 - case "Performance Data":
574 - echo "<tr bgcolor='" . $rowColor . "'>";
575 - echo "<td>" . $key . ":</td>";
576 - echo "<td>" . $value . "</td>";
579 - case "Current Attempt":
580 - echo "<tr bgcolor='" . $rowColor . "'>";
581 - echo "<td>" . $key . ":</td>";
582 - echo "<td>" . $value . "/" . $service_detail["Max Attempts"] . "</td>";
586 - echo "<tr bgcolor='" . $rowColor . "'>";
587 - echo "<td>" . $key . ":</td>";
588 - if (preg_match('/1969-12-31/', $value)) {
589 - echo "<td>N/A</td>";
591 - echo "<td>" . $value . "</td>";
596 - echo "<tr bgcolor='" . $rowColor . "'>";
597 - echo "<td>" . $key . ":</td>";
598 - echo "<td>" . $value . "</td>";
601 - case "Check Latency":
602 - echo "<tr bgcolor='" . $rowColor . "'>";
603 - echo "<td>" . $key . ":</td>";
604 - echo "<td>" . $value . "</td>";
607 - case "Check Duration":
608 - echo "<tr bgcolor='" . $rowColor . "'>";
609 - echo "<td>" . $key . ":</td>";
610 - echo "<td>" . $value . "</td>";
614 - echo "<tr bgcolor='" . $rowColor . "'>";
615 - echo "<td>Flapping:</td>";
616 - if ($service_detail["flapping"]) {
617 - echo "<td>Yes</td>";
619 - echo "<td>No</td>";
625 - if($rowColor == $background1) {
626 - $rowColor = $background2;
628 - $rowColor = $background1;
631 - if ($key == "flapping") {
632 - echo "<tr bgcolor='" . $rowColor . "'>";
633 - echo "<td>Event Handler:</td>";
634 - if (!$service_config["event_handler"]) {
635 - echo "<td>N/A</td>";
637 - echo "<td>" . $service_config["event_handler"] . "</td>";
659 - <table width="70%" border="0" align="right">
661 - <tr class="textHeaderDark" bgcolor='#00438C'>
662 - <td align="center"><strong>Service Monitoring Options</strong></td>
667 - <td width="70%" valign="top">
668 - <table width="100%" align="center" cellpadding="3">
670 - <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
678 - $rowColor = $background1;
679 - echo "<tr bgcolor='" . $rowColor . "'>";
682 - foreach ($service_config as $key => $value) {
684 - if ($key == "event_handler") { continue; }
686 - echo "<tr bgcolor='" . $rowColor . "'>";
690 - case "active_checks_enabled":
691 - echo "<td>Active Checks:</td>";
693 - case "passive_checks_enabled":
694 - echo "<td>Passive Checks:</td>";
696 - case "event_handler_enabled":
697 - echo "<td>Event Handler:</td>";
699 - case "flap_detection_enabled":
700 - echo "<td>Flap Detection:</td>";
702 - case "notifications_enabled":
703 - echo "<td>Notifications:</td>";
705 - case "failure_prediction_enabled":
706 - echo "<td>Failure Prediction:</td>";
708 - case "process_performance_data":
709 - echo "<td>Process Performance Data:</td>";
711 - case "obsess_over_service":
712 - echo "<td>Obsess Over Service:</td>";
717 - echo "<td class='optionDISABLED'>Disabled</td></tr>";
719 - echo "<td class='optionENABLED'>Enabled</td></tr>";
722 - if($rowColor == $background1) {
723 - $rowColor = $background2;
725 - $rowColor = $background1;
751 - <tr><td> </td><td> </td></tr>
752 - <tr><td> </td><td> </td></tr>
753 - <td valign="top" colspan='2'>
754 - <table width="60%" border="0" align="center">
756 - <tr class="textHeaderDark" bgcolor='#00438C'>
757 - <td align="center"><strong>Service Comments</strong></td>
762 - <td width="60%" valign="top">
763 - <table width="100%" align="center" cellpadding="3">
765 - <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
766 - <td>Entry Time</td>
769 - <td>Persistent</td>
774 - for($i = 0; $i < $row_count; $i++) {
776 - echo "<tr bgcolor='" . $rowColor . "'>";
777 - echo "<td nowrap>" . $comments[$i]["timestamp"] . "</td>";
778 - echo "<td>" . $comments[$i]["author"] . "</td>";
779 - echo "<td>" . $comments[$i]["comment"] . "</td>";
781 - if ($comments[$i]["persist"]) {
788 - if ($comments[$i]["type"] == 2) {
790 - } elseif ($comments[$i]["type"] == 4) {
791 - echo "Acknowledgment";
795 - if ($comments[$i]["type"] == 2) {
796 - echo "<a href='command.php?cmd=DEL_SVC_COMMENT&id=" . $comments[$i]["id"] . "&host=" . $hostname . "&hostid=" . $hostid . "&service=" . $_REQUEST["service"] . "&serviceid=" . $serviceid . "'><img src='images/delete.gif' alt='delete' title='Delete comment' border=0></a>";
797 - } elseif ($comments[$i]["type"] == 4) {
798 - echo "<a href='command.php?cmd=REMOVE_SVC_ACKNOWLEDGEMENT&host=" . $hostname . "&hostid=" . $hostid . "&service=" . $_REQUEST["service"] . "&serviceid=" . $serviceid . "'><img src='images/delete.gif' alt='Remove' title='Remove problem acknowledgment' border=0></a>";
803 - if($rowColor == $background1) {
804 - $rowColor = $background2;
806 - $rowColor = $background1;
824 - echo "<a href='command.php?cmd=ADD_SVC_COMMENT&host=" . $hostname . "&hostid=" . $hostid . "&service=" . $_REQUEST["service"] . "&serviceid=" . $serviceid . "'><img src='images/comment.gif' alt='Add a comment' title='Add a comment' border=0></a>";
825 - echo "<a href='command.php?cmd=DEL_ALL_SVC_COMMENTS&host=" . $hostname . "&hostid=" . $hostid . "&service=" . $_REQUEST["service"] . "&serviceid=" . $serviceid . "'><img src='images/delete.gif' alt='Delete all comments' title='Delete all comments' border=0></a>";
833 - <tr><td> </td><td> </td></tr>
834 - <tr><td> </td><td> </td></tr>
841 - <td valign="top" colspan='2'>
842 - <table width="60%" border="0" align="center">
844 - <tr align="center" class="textHeaderDark" bgcolor='#00438C'>
845 - <td align="center"><strong>Graph Mapping</strong></td>
850 - <td width="60%" valign="top">
851 - <table width="100%" align="center" cellpadding="3">
856 -$cacti_graphs = db_fetch_assoc("
858 - graph_templates_graph.id,
859 - graph_templates_graph.local_graph_id,
860 - graph_templates_graph.height,
861 - graph_templates_graph.width,
862 - graph_templates_graph.title_cache as title,
863 - graph_templates.name,
864 - graph_local.host_id
865 - from graph_local,graph_templates_graph
866 - left join graph_templates on graph_local.graph_template_id=graph_templates.id
867 - where graph_local.id=graph_templates_graph.local_graph_id
868 - and graph_templates_graph.title_cache like '%'
869 - order by graph_templates_graph.title_cache,graph_local.host_id");
871 - $row_count = count($cacti_graphs);
872 -/* http://logindev/cacti/graph_image.php?local_graph_id=6&rra_id=0 */
875 - <FORM NAME="gm" ACTION="" method="post">
876 - <tr bgcolor='<?php echo $background1; ?>'>
877 - <td>Associated graph:</td>
879 - <select name="local_graph_id" size="1">
881 - echo "<OPTION VALUE='NULL'>None</option>";
882 - for($i = 0; $i < $row_count; $i++) {
883 - echo "<OPTION VALUE='" . $cacti_graphs[$i]["local_graph_id"] . "'>" . $cacti_graphs[$i]["title"] . "</option>";
890 - <td><INPUT TYPE="submit" VALUE="Map"></td>
898 - if ($service_detail["cacti_graph_id"]) {
899 - echo "<table align='center'>";
900 - echo "<tr><td width='100%'>";
901 - echo "<img src='../../graph_image.php?local_graph_id=" . $service_detail["cacti_graph_id"] . "&rra_id=0'>";
921 -function hostInfo() {
923 - $hostid = $_REQUEST["hostid"];
924 - $hostname = $_REQUEST["hostname"];
926 - if (isset($_POST["local_graph_id"])) {
927 - db_execute("update npc_host set cacti_graph_id = " . $_POST["local_graph_id"] . " where id = " . $hostid);
928 - header("Location: extinfo.php?type=1&hostid=" . $hostid . "&hostname=" . $hostname);
931 - include_once("top_npc_header.php");
933 - $background1 = "#F5F5F5";
934 - $background2 = "#E7E9F2";
935 - $rowColor = $background1;
937 - $host_flapping["flapping"] = db_fetch_cell("select id from npc_flapping_host where id = $hostid");
939 - $host_history = db_fetch_row("select started, soft_state, hard_state, current_attempt, plugin_output from npc_host_history where hostid = $hostid order by started desc;");
941 - $host_check = db_fetch_row("select check_command, check_execute_time, check_latency, from_unixtime(last_check) as last_check, from_unixtime(next_check) as next_check, max_attempts, last_notification, next_notification, no_more_notifications, check_type, performance_data from npc_host_check where hostid = $hostid;");
943 - $host_config = db_fetch_row("select active_checks_enabled, passive_checks_enabled, event_handler_enabled, flap_detection_enabled, notifications_enabled, failure_prediction_enabled, process_performance_data, obsess_over_host, event_handler, cacti_graph_id from npc_host where id = $hostid");
945 - $comments = db_fetch_assoc("select id,serviceid,timestamp,author,comment,persist,type from npc_comment where hostid = $hostid");
947 - $graphView = db_fetch_cell("select id from graph_tree_items where host_id = (select id from host where npc_host_id = $hostid)");
949 - $row_count = count($comments);
951 - $duration = date("U") - $host_history["started"];
958 - <table width="98%" border="0" cellpadding="0" cellspacing="0" align="center">
959 - <tr class="textSubHeaderDark" bgcolor='#6d88ad'>
961 - <h2> <strong><?php echo $hostname; ?></strong></h2>
963 - <td align='right' nowrap>
964 - <FORM NAME="cl" ACTION="command.php" method="POST">Command:
965 - <INPUT TYPE='hidden' NAME='host' VALUE='<?php echo $hostname; ?>'>
966 - <INPUT TYPE='hidden' NAME='hostid' VALUE='<?php echo $hostid; ?>'>
967 - <select name="command" size="1">
970 - if (read_config_option("nagios_commands")) {
972 - echo "<OPTION VALUE='NULL'>Execute a command</option>";
974 - if ($host_config["active_checks_enabled"]) {
975 - echo "<OPTION VALUE='DISABLE_HOST_CHECK'>Disable active checks</option>";
976 - echo "<OPTION VALUE='SCHEDULE_HOST_CHECK'>Re-schedule the next check</option>";
977 - echo "<OPTION VALUE='SCHEDULE_HOST_SVC_CHECKS'>Schedule a check of all services</option>";
979 - echo "<OPTION VALUE='ENABLE_HOST_CHECK'>Enable Active Checks</option>";
981 - echo "<OPTION VALUE='DISABLE_HOST_SVC_CHECKS'>Disable checks of all services</option>";
982 - echo "<OPTION VALUE='ENABLE_HOST_SVC_CHECKS'>Enabble checks of all services</option>";
983 - if ($host_config["passive_checks_enabled"]) {
984 - echo "<OPTION VALUE='PROCESS_HOST_CHECK_RESULT'>Submit passive check result</option>";
985 - echo "<OPTION VALUE='DISABLE_PASSIVE_HOST_CHECKS'>Stop accepting passive checks</option>";
987 - echo "<OPTION VALUE='ENABLE_PASSIVE_HOST_CHECKS'>Start accepting passive checks</option>";
989 - if ($host_config["obsess_over_service"]) {
990 - echo "<OPTION VALUE='STOP_OBSESSING_OVER_HOST'>Stop obsessing</option>";
992 - echo "<OPTION VALUE='START_OBSESSING_OVER_HOST'>Start obsessing</option>";
994 - if ($host_history["soft_state"] == 1 || $host_history["soft_state"] == 2 && $host_history["soft_state"] == $host_history["hard_state"]) {
995 - if (!db_fetch_cell("select * from npc_comment where hostid = $hostid and type = 4;")) {
996 - echo "<OPTION VALUE='ACKNOWLEDGE_HOST_PROBLEM'>Acknowledge This Host Problem</option>";
997 - } elseif (db_fetch_cell("select * from npc_comment where hostid = $hostid and type = 4;")) {
998 - echo "<OPTION VALUE='REMOVE_HOST_ACKNOWLEDGEMENT'>Remove Problem Acknowledgement</option>";
1001 - if ($host_config["notifications_enabled"]) {
1002 - echo "<OPTION VALUE='DISABLE_HOST_NOTIFICATIONS'>Disable Notifications</option>";
1003 - if ($host_history["soft_state"] != 0) {
1004 - echo "<OPTION VALUE='DELAY_HOST_NOTIFICATION'>Delay Next Service Notification</option>";
1007 - echo "<OPTION VALUE='ENABLE_HOST_NOTIFICATIONS'>Enable Notifications</option>";
1009 - echo "<OPTION VALUE='SCHEDULE_HOST_DOWNTIME'>Schedule Downtime</option>";
1010 - if ($host_config["event_handler_enabled"]) {
1011 - echo "<OPTION VALUE='DISABLE_HOST_EVENT_HANDLER'>Disable Event Handler</option>";
1013 - echo "<OPTION VALUE='ENABLE_HOST_EVENT_HANDLER'>Enable Event Handler</option>";
1015 - if ($host_config["flap_detection_enabled"]) {
1016 - echo "<OPTION VALUE='DISABLE_HOST_FLAP_DETECTION'>Disable Flap Detection</option>";
1018 - echo "<OPTION VALUE='ENABLE_HOST_FLAP_DETECTION'>Enable Flap Detection</option>";
1020 - echo "<OPTION VALUE='ADD_HOST_COMMENT'>Add Host Comment</option>";
1021 - echo "<OPTION VALUE='DEL_ALL_HOST_COMMENTS'>Delete All Host Comments</option>";
1023 - echo "<OPTION VALUE='NULL'>Command execution disabled</option>";
1028 - <input type='image' src='../../images/button_go.gif' alt='Go' value='Execute' align='absmiddle'>
1034 - <tr><td></td><td></td></tr>
1035 - <tr bgcolor='#a9b7cb'>
1036 - <td><a href='statusDetail.php?filter=showHost&name=<?php echo $hostname; ?>'>View Services</a> | <?php if ($graphView) { ?><a href='<?php echo $config['url_path']?>graph_view.php?action=tree&tree_id=1&leaf_id=<?php echo $graphView; ?>'>View Graphs</a> | <?php } ?><a href='hostConfig.php?name=<?php echo $hostname; ?>&hostid=<?php echo $hostid; ?>'>Configure</a></td>
1037 - <td> </td></tr>
1040 - <tr><td> </td><td> </td></tr>
1043 - <table width="100%" border="0" align="left" valign="top">
1045 - <tr class="textHeaderDark" bgcolor='#00438C'>
1046 - <td align="center"><strong>Host State Information</strong></td>
1051 - <td width="100%" valign="top">
1052 - <table width="100%" align="center" cellpadding="3">
1054 - <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
1055 - <td>Parameter</td>
1065 - $host_detail = array(
1066 - 'Current Status' => $host_history["soft_state"],
1067 - 'State Duration' => formatTime($duration),
1068 - 'Check Command' => $host_check["check_command"],
1069 - 'Plugin Output' => $host_history["plugin_output"],
1070 - 'Performance Data' => $host_check["performance_data"],
1071 - 'Current Attempt' => $host_history["current_attempt"],
1072 - 'Last Check' => $host_check["last_check"],
1073 - 'Next Check' => $host_check["next_check"],
1074 - 'Check Latency' => $host_check["check_latency"],
1075 - 'Check Duration' => $host_check["check_execute_time"],
1076 - 'flapping' => $host_flapping["flapping"],
1077 - 'Event Handler' => $host_config["event_handler"],
1080 - foreach ($host_detail as $key => $value) {
1085 - case "Current Status":
1086 - echo "<tr bgcolor='" . $rowColor . "'>";
1087 - echo "<td>" . $key . ":</td>";
1091 - echo "<td class='statusPENDING'><strong>PENDING</strong></td>";
1094 - echo "<td class='statusHOSTUP'><strong>UP</strong></td>";
1097 - echo "<td class='statusHOSTDOWN'><strong>DOWN</strong></td>";
1100 - echo "<td class='statusHOSTUNREACHABLE'><strong>UNREACHABLE</strong></td>";
1105 - case "State Duration":
1106 - echo "<tr bgcolor='" . $rowColor . "'>";
1107 - echo "<td>" . $key . ":</td>";
1108 - echo "<td>" . $value . "</td>";
1111 - case "Check Command":
1112 - echo "<tr bgcolor='" . $rowColor . "'>";
1113 - echo "<td>" . $key . ":</td>";
1114 - echo "<td>" . $value . "</td>";
1117 - case "Plugin Output":
1118 - echo "<tr bgcolor='" . $rowColor . "'>";
1119 - echo "<td>" . $key . ":</td>";
1120 - echo "<td>" . $value . "</td>";
1123 - case "Performance Data":
1124 - echo "<tr bgcolor='" . $rowColor . "'>";
1125 - echo "<td>" . $key . ":</td>";
1126 - echo "<td>" . $value . "</td>";
1129 - case "Current Attempt":
1130 - echo "<tr bgcolor='" . $rowColor . "'>";
1131 - echo "<td>" . $key . ":</td>";
1132 - echo "<td>" . $value . "/" . $host_check["max_attempts"] . "</td>";
1135 - case "Last Check":
1136 - echo "<tr bgcolor='" . $rowColor . "'>";
1137 - echo "<td>" . $key . ":</td>";
1138 - if (preg_match('/1969-12-31/', $value)) {
1139 - echo "<td>N/A</td>";
1141 - echo "<td>" . $value . "</td>";
1145 - case "Next Check":
1146 - echo "<tr bgcolor='" . $rowColor . "'>";
1147 - echo "<td>" . $key . ":</td>";
1148 - if (preg_match('/1969-12-31/', $value)) {
1149 - echo "<td>N/A</td>";
1151 - echo "<td>" . $value . "</td>";
1155 - case "Check Latency":
1156 - echo "<tr bgcolor='" . $rowColor . "'>";
1157 - echo "<td>" . $key . ":</td>";
1158 - echo "<td>" . $value . "</td>";
1161 - case "Check Duration":
1162 - echo "<tr bgcolor='" . $rowColor . "'>";
1163 - echo "<td>" . $key . ":</td>";
1164 - echo "<td>" . $value . "</td>";
1168 - echo "<tr bgcolor='" . $rowColor . "'>";
1169 - echo "<td>Flapping:</td>";
1170 - if ($host_detail["flapping"]) {
1171 - echo "<td>Yes</td>";
1173 - echo "<td>No</td>";
1177 - case "Event Handler":
1178 - echo "<tr bgcolor='" . $rowColor . "'>";
1179 - echo "<td>" . $key . ":</td>";
1181 - echo "<td>N/A</td>";
1183 - echo "<td>" . $value . "</td>";
1189 - if($rowColor == $background1) {
1190 - $rowColor = $background2;
1192 - $rowColor = $background1;
1211 - <table width="70%" border="0" align="right">
1213 - <tr class="textHeaderDark" bgcolor='#00438C'>
1214 - <td align="center"><strong>Host Monitoring Options</strong></td>
1219 - <td width="70%" valign="top">
1220 - <table width="100%" align="center" cellpadding="3">
1222 - <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
1223 - <td>Parameter</td>
1230 - $rowColor = $background1;
1231 - echo "<tr bgcolor='" . $rowColor . "'>";
1234 - foreach ($host_config as $key => $value) {
1236 - if ($key == "event_handler") { continue; }
1237 - if ($key == "cacti_graph_id") { continue; }
1239 - echo "<tr bgcolor='" . $rowColor . "'>";
1243 - case "active_checks_enabled":
1244 - echo "<td>Active Checks:</td>";
1246 - case "passive_checks_enabled":
1247 - echo "<td>Passive Checks:</td>";
1249 - case "event_handler_enabled":
1250 - echo "<td>Event Handler:</td>";
1252 - case "flap_detection_enabled":
1253 - echo "<td>Flap Detection:</td>";
1255 - case "notifications_enabled":
1256 - echo "<td>Notifications:</td>";
1258 - case "failure_prediction_enabled":
1259 - echo "<td>Failure Prediction:</td>";
1261 - case "process_performance_data":
1262 - echo "<td>Process Performance Data:</td>";
1264 - case "obsess_over_host":
1265 - echo "<td>Obsess Over Host:</td>";
1269 - if ($value == 0) {
1270 - echo "<td class='optionDISABLED'>Disabled</td></tr>";
1272 - echo "<td class='optionENABLED'>Enabled</td></tr>";
1275 - if($rowColor == $background1) {
1276 - $rowColor = $background2;
1278 - $rowColor = $background1;
1304 - <tr><td> </td><td> </td></tr>
1305 - <tr><td> </td><td> </td></tr>
1306 - <td valign="top" colspan='2'>
1307 - <table width="60%" border="0" align="center">
1309 - <tr class="textHeaderDark" bgcolor='#00438C'>
1310 - <td align="center"><strong>Host Comments</strong></td>
1315 - <td width="60%" valign="top">
1316 - <table width="100%" align="center" cellpadding="3">
1318 - <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
1319 - <td>Entry Time</td>
1322 - <td>Persistent</td>
1327 - for($i = 0; $i < $row_count; $i++) {
1329 - echo "<tr bgcolor='" . $rowColor . "'>";
1330 - echo "<td nowrap>" . $comments[$i]["timestamp"] . "</td>";
1331 - echo "<td>" . $comments[$i]["author"] . "</td>";
1332 - echo "<td>" . $comments[$i]["comment"] . "</td>";
1334 - if ($comments[$i]["persist"]) {
1341 - if ($comments[$i]["type"] == 1) {
1343 - } elseif ($comments[$i]["type"] == 3) {
1344 - echo "Acknowledgment";
1348 - if ($comments[$i]["type"] == 1) {
1349 - echo "<a href='command.php?cmd=DEL_HOST_COMMENT&id=" . $comments[$i]["id"] . "&host=" . $hostname . "&hostid=" . $hostid . "'><img src='images/delete.gif' alt='delete' title='Delete comment' border=0></a>";
1350 - } elseif ($comments[$i]["type"] == 3) {
1351 - echo "<a href='command.php?cmd=REMOVE_HOST_ACKNOWLEDGEMENT&host=" . $hostname . "&hostid=" . $hostid . "'><img src='images/delete.gif' alt='Remove' title='Remove problem acknowledgment' border=0></a>";
1356 - if($rowColor == $background1) {
1357 - $rowColor = $background2;
1359 - $rowColor = $background1;
1377 - echo "<a href='command.php?cmd=ADD_HOST_COMMENT&host=" . $hostname . "&hostid=" . $hostid . "'><img src='images/comment.gif' alt='Add a comment' title='Add a comment' border=0></a>";
1378 - echo "<a href='command.php?cmd=DEL_ALL_HOST_COMMENTS&host=" . $hostname . "&hostid=" . $hostid . "'><img src='images/delete.gif' alt='Delete all comments' title='Delete all comments' border=0></a>";
1386 - <tr><td> </td><td> </td></tr>
1387 - <tr><td> </td><td> </td></tr>
1394 - <td valign="top" colspan='2'>
1395 - <table width="60%" border="0" align="center">
1397 - <tr align="center" class="textHeaderDark" bgcolor='#00438C'>
1398 - <td align="center"><strong>Graph Mapping</strong></td>
1403 - <td width="60%" valign="top">
1404 - <table width="100%" align="center" cellpadding="3">
1409 -$cacti_graphs = db_fetch_assoc("
1411 - graph_templates_graph.id,
1412 - graph_templates_graph.local_graph_id,
1413 - graph_templates_graph.height,
1414 - graph_templates_graph.width,
1415 - graph_templates_graph.title_cache as title,
1416 - graph_templates.name,
1417 - graph_local.host_id
1418 - from graph_local,graph_templates_graph
1419 - left join graph_templates on graph_local.graph_template_id=graph_templates.id
1420 - where graph_local.id=graph_templates_graph.local_graph_id
1421 - and graph_templates_graph.title_cache like '%'
1422 - order by graph_templates_graph.title_cache,graph_local.host_id");
1424 - $row_count = count($cacti_graphs);
1425 -/* http://logindev/cacti/graph_image.php?local_graph_id=6&rra_id=0 */
1428 - <FORM NAME="gm" ACTION="" method="post">
1429 - <tr bgcolor='<?php echo $background1; ?>'>
1430 - <td>Associated graph:</td>
1432 - <select name="local_graph_id" size="1">
1434 - echo "<OPTION VALUE='NULL'>None</option>";
1435 - for($i = 0; $i < $row_count; $i++) {
1436 - echo "<OPTION VALUE='" . $cacti_graphs[$i]["local_graph_id"] . "'>" . $cacti_graphs[$i]["title"] . "</option>";
1443 - <td><INPUT TYPE="submit" VALUE="Map"></td>
1451 - if ($host_config["cacti_graph_id"]) {
1452 - echo "<table align='center'>";
1453 - echo "<tr><td width='100%'>";
1454 - echo "<img src='../../graph_image.php?local_graph_id=" . $host_config["cacti_graph_id"] . "&rra_id=0'>";
1455 - echo "</td></tr>";
1479 + +-------------------------------------------------------------------------+
\r
1480 + | Nagios Plugin 0.1a for cacti 0.8.6f |
\r
1481 + | Copyright (C) 2005 Billy Gunn (billy@gunn.org) |
\r
1483 + | This program is free software; you can redistribute it and/or |
\r
1484 + | modify it under the terms of the GNU General Public License |
\r
1485 + | as published by the Free Software Foundation; either version 2 |
\r
1486 + | of the License, or (at your option) any later version. |
\r
1488 + | This program is distributed in the hope that it will be useful, |
\r
1489 + | but WITHOUT ANY WARRANTY; without even the implied warranty of |
\r
1490 + | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
\r
1491 + | GNU General Public License for more details. |
\r
1492 + +-------------------------------------------------------------------------+
\r
1493 + | Cacti and Nagios are the copyright of their respective owners. |
\r
1494 + +-------------------------------------------------------------------------+
\r
1498 +include_once("./include/auth.php");
\r
1499 +include_once("./include/config.php");
\r
1501 +// Refresh the page at a user supplied interval
\r
1502 +header("Refresh: " . read_config_option("npc_refresh") . "; URL=" . $_SERVER["REQUEST_URI"]);
\r
1504 +/* set default action */
\r
1505 +if (!isset($_REQUEST["type"])) { $_REQUEST["type"] = ""; }
\r
1507 +switch ($_REQUEST["type"]) {
\r
1511 + include_once("./include/bottom_footer.php");
\r
1517 + include_once("./include/bottom_footer.php");
\r
1523 + include_once("./include/bottom_footer.php");
\r
1528 +function formatTime($time) {
\r
1530 + $days = floor($time/60/60/24);
\r
1531 + $time -= $days*60*60*24;
\r
1532 + $hours = floor($time/60/60);
\r
1533 + $time -= $hours*60*60;
\r
1534 + $minutes = floor($time/60);
\r
1535 + $time -= $minutes*60;
\r
1536 + $seconds = $time;
\r
1538 + return ($days . "d " . $hours . "h " . $minutes . "m " . $seconds . "s");
\r
1542 +function serviceInfo() {
\r
1544 + $hostid = $_REQUEST["hostid"];
\r
1545 + $serviceid = $_REQUEST["serviceid"];
\r
1546 + $hostname = $_REQUEST["hostname"];
\r
1547 + $serviceName = ereg_replace("\+", " ", $_REQUEST["service"]);
\r
1550 + if (isset($_POST["local_graph_id"])) {
\r
1551 + db_execute("update npc_service set cacti_graph_id = " . $_POST["local_graph_id"] . " where id = " . $serviceid);
\r
1552 + header("Location: extinfo.php?type=2&hostid=" . $hostid . "&hostname=" . $hostname . "&serviceid=" . $serviceid . "&service=" . $_REQUEST["service"]);
\r
1555 + include_once("top_npc_header.php");
\r
1557 + $background1 = "#F5F5F5";
\r
1558 + $background2 = "#E7E9F2";
\r
1559 + $rowColor = $background1;
\r
1561 + $service_detail = db_fetch_row("
\r
1563 + service_soft_state as 'Current Status',
\r
1564 + duration as 'State Duration',
\r
1565 + check_command as 'Check Command',
\r
1566 + plugin_output as 'Plugin Output',
\r
1567 + performance_data as 'Performance Data',
\r
1568 + current_attempt as 'Current Attempt',
\r
1569 + from_unixtime(last_check) as 'Last Check',
\r
1570 + from_unixtime(next_check) as 'Next Check',
\r
1571 + check_latency as 'Check Latency',
\r
1572 + check_execute_time as 'Check Duration',
\r
1575 + host_soft_state as 'Host Soft State',
\r
1576 + host_notifications as 'Host Notifications',
\r
1577 + service as 'Service',
\r
1580 + service_hard_state,
\r
1581 + service_notifications as 'Service Notifications',
\r
1582 + max_attempts as 'Max Attempts'
\r
1586 + npc_host.id as hostid,
\r
1588 + npc_hostgroup_membership.groupid as hostgroup,
\r
1589 + npc_host_history.soft_state as host_soft_state,
\r
1590 + npc_host.notifications_enabled as host_notifications,
\r
1591 + npc_service.id as serviceid,
\r
1592 + npc_service.cacti_graph_id,
\r
1593 + npc_service.service_description as service,
\r
1594 + npc_service_history.soft_state as service_soft_state,
\r
1595 + npc_service_history.hard_state as service_hard_state,
\r
1596 + npc_service.notifications_enabled as service_notifications,
\r
1597 + npc_service_check.last_check,
\r
1598 + npc_service_check.next_check,
\r
1599 + npc_service_check.check_execute_time,
\r
1600 + npc_service_check.check_latency,
\r
1601 + npc_service_check.check_command,
\r
1602 + npc_service_check.performance_data,
\r
1603 + unix_timestamp() - npc_service_history.started as duration,
\r
1604 + npc_service_history.current_attempt,
\r
1605 + npc_service_check.max_attempts,
\r
1606 + npc_service_history.plugin_output
\r
1609 + npc_host_history,
\r
1610 + npc_hostgroup_membership,
\r
1612 + npc_service_check,
\r
1613 + npc_service_history
\r
1615 + npc_host.id = npc_hostgroup_membership.hostid and
\r
1616 + npc_host.id = npc_service.hostid and
\r
1617 + npc_host.id = npc_host_history.hostid and
\r
1618 + npc_service.id = npc_service_check.serviceid and
\r
1619 + npc_service.id = npc_service_history.serviceid and
\r
1620 + npc_service_history.lasted is null and
\r
1621 + npc_host_history.lasted is null and
\r
1622 + npc_service.configured = TRUE and
\r
1623 + npc_service.has_been_checked = TRUE and
\r
1624 + npc_host.has_been_checked = TRUE
\r
1627 + npc_host.id as hostid,
\r
1630 + npc_host_history.soft_state as host_soft_state,
\r
1631 + npc_host.notifications_enabled as host_notifications,
\r
1632 + npc_service.id as serviceid,
\r
1633 + npc_service.cacti_graph_id,
\r
1634 + npc_service.service_description as service,
\r
1635 + npc_service_history.soft_state as service_soft_state,
\r
1636 + npc_service_history.hard_state as service_hard_state,
\r
1637 + npc_service.notifications_enabled as service_notifications,
\r
1638 + npc_service_check.last_check,
\r
1639 + npc_service_check.next_check,
\r
1640 + npc_service_check.check_execute_time,
\r
1641 + npc_service_check.check_latency,
\r
1642 + npc_service_check.check_command,
\r
1643 + npc_service_check.performance_data,
\r
1644 + unix_timestamp() - npc_service_history.started as duration,
\r
1645 + npc_service_history.current_attempt,
\r
1646 + npc_service_check.max_attempts,
\r
1647 + npc_service_history.plugin_output
\r
1650 + npc_host_history,
\r
1652 + npc_service_check,
\r
1653 + npc_service_history
\r
1655 + npc_host.id not in (select hostid from npc_hostgroup_membership) and
\r
1656 + npc_host.id = npc_service.hostid and
\r
1657 + npc_host.id = npc_host_history.hostid and
\r
1658 + npc_service.id = npc_service_check.serviceid and
\r
1659 + npc_service.id = npc_service_history.serviceid and
\r
1660 + npc_service_history.lasted is null and
\r
1661 + npc_host_history.lasted is null and
\r
1662 + npc_service.configured = TRUE and
\r
1663 + npc_service.has_been_checked = TRUE and
\r
1664 + npc_host.has_been_checked = TRUE
\r
1667 + npc_host.id as hostid,
\r
1669 + npc_hostgroup_membership.groupid as hostgroup,
\r
1670 + -1 as host_soft_state,
\r
1671 + npc_host.notifications_enabled as host_notifications,
\r
1672 + npc_service.id as serviceid,
\r
1673 + npc_service.cacti_graph_id,
\r
1674 + npc_service.service_description as service,
\r
1675 + npc_service_history.soft_state as service_soft_state,
\r
1676 + npc_service_history.hard_state as service_hard_state,
\r
1677 + npc_service.notifications_enabled as service_notifications,
\r
1678 + npc_service_check.last_check,
\r
1679 + npc_service_check.next_check,
\r
1680 + npc_service_check.check_execute_time,
\r
1681 + npc_service_check.check_latency,
\r
1682 + npc_service_check.check_command,
\r
1683 + npc_service_check.performance_data,
\r
1684 + unix_timestamp() - npc_service_history.started as duration,
\r
1685 + npc_service_history.current_attempt,
\r
1686 + npc_service_check.max_attempts,
\r
1687 + npc_service_history.plugin_output
\r
1690 + npc_hostgroup_membership,
\r
1692 + npc_service_check,
\r
1693 + npc_service_history
\r
1695 + npc_host.id = npc_hostgroup_membership.hostid and
\r
1696 + npc_host.id = npc_service.hostid and
\r
1697 + npc_service.id = npc_service_check.serviceid and
\r
1698 + npc_service.id = npc_service_history.serviceid and
\r
1699 + npc_service_history.lasted is null and
\r
1700 + npc_service.configured = TRUE and
\r
1701 + npc_service.has_been_checked = TRUE and
\r
1702 + npc_host.has_been_checked = FALSE
\r
1705 + npc_host.id as hostid,
\r
1708 + -1 as host_soft_state,
\r
1709 + npc_host.notifications_enabled as host_notifications,
\r
1710 + npc_service.id as serviceid,
\r
1711 + npc_service.cacti_graph_id,
\r
1712 + npc_service.service_description as service,
\r
1713 + npc_service_history.soft_state as service_soft_state,
\r
1714 + npc_service_history.hard_state as service_hard_state,
\r
1715 + npc_service.notifications_enabled as service_notifications,
\r
1716 + npc_service_check.last_check,
\r
1717 + npc_service_check.next_check,
\r
1718 + npc_service_check.check_execute_time,
\r
1719 + npc_service_check.check_latency,
\r
1720 + npc_service_check.check_command,
\r
1721 + npc_service_check.performance_data,
\r
1722 + unix_timestamp() - npc_service_history.started as duration,
\r
1723 + npc_service_history.current_attempt,
\r
1724 + npc_service_check.max_attempts,
\r
1725 + npc_service_history.plugin_output
\r
1729 + npc_service_check,
\r
1730 + npc_service_history
\r
1732 + npc_host.id not in (select hostid from npc_hostgroup_membership) and
\r
1733 + npc_host.id = npc_service.hostid and
\r
1734 + npc_service.id = npc_service_check.serviceid and
\r
1735 + npc_service.id = npc_service_history.serviceid and
\r
1736 + npc_service_history.lasted is null and
\r
1737 + npc_service.configured = TRUE and
\r
1738 + npc_service.has_been_checked = TRUE and
\r
1739 + npc_host.has_been_checked = FALSE
\r
1742 + npc_host.id as hostid,
\r
1744 + npc_hostgroup_membership.groupid as hostgroup,
\r
1745 + npc_host_history.soft_state as host_soft_state,
\r
1746 + npc_host.notifications_enabled as host_notifications,
\r
1747 + npc_service.id as serviceid,
\r
1748 + npc_service.cacti_graph_id,
\r
1749 + npc_service.service_description as service,
\r
1750 + -1 as service_soft_state,
\r
1751 + -1 as service_hard_state,
\r
1752 + npc_service.notifications_enabled as service_notifications,
\r
1753 + npc_service_check.last_check,
\r
1754 + npc_service_check.next_check,
\r
1755 + npc_service_check.check_execute_time,
\r
1756 + npc_service_check.check_latency,
\r
1757 + npc_service_check.check_command,
\r
1758 + npc_service_check.performance_data,
\r
1760 + 0 as current_attempt,
\r
1761 + npc_service_check.max_attempts,
\r
1762 + null as plugin_output
\r
1765 + npc_host_history,
\r
1766 + npc_hostgroup_membership,
\r
1768 + npc_service_check
\r
1770 + npc_host.id = npc_hostgroup_membership.hostid and
\r
1771 + npc_host.id = npc_service.hostid and
\r
1772 + npc_host.id = npc_host_history.hostid and
\r
1773 + npc_service.id = npc_service_check.serviceid and
\r
1774 + npc_host_history.lasted is null and
\r
1775 + npc_service.configured = TRUE and
\r
1776 + npc_service.has_been_checked = FALSE and
\r
1777 + npc_host.has_been_checked = TRUE
\r
1780 + npc_host.id as hostid,
\r
1783 + npc_host_history.soft_state as host_soft_state,
\r
1784 + npc_host.notifications_enabled as host_notifications,
\r
1785 + npc_service.id as serviceid,
\r
1786 + npc_service.cacti_graph_id,
\r
1787 + npc_service.service_description as service,
\r
1788 + -1 as service_soft_state,
\r
1789 + -1 as service_hard_state,
\r
1790 + npc_service.notifications_enabled as service_notifications,
\r
1791 + npc_service_check.last_check,
\r
1792 + npc_service_check.next_check,
\r
1793 + npc_service_check.check_execute_time,
\r
1794 + npc_service_check.check_latency,
\r
1795 + npc_service_check.check_command,
\r
1796 + npc_service_check.performance_data,
\r
1798 + 0 as current_attempt,
\r
1799 + npc_service_check.max_attempts,
\r
1800 + null as plugin_output
\r
1803 + npc_host_history,
\r
1805 + npc_service_check
\r
1807 + npc_host.id not in (select hostid from npc_hostgroup_membership) and
\r
1808 + npc_host.id = npc_service.hostid and
\r
1809 + npc_host.id = npc_host_history.hostid and
\r
1810 + npc_service.id = npc_service_check.serviceid and
\r
1811 + npc_host_history.lasted is null and
\r
1812 + npc_service.configured = TRUE and
\r
1813 + npc_service.has_been_checked = FALSE and
\r
1814 + npc_host.has_been_checked = TRUE
\r
1817 + npc_host.id as hostid,
\r
1819 + npc_hostgroup_membership.groupid as hostgroup,
\r
1820 + -1 as host_soft_state,
\r
1821 + npc_host.notifications_enabled as host_notifications,
\r
1822 + npc_service.id as serviceid,
\r
1823 + npc_service.cacti_graph_id,
\r
1824 + npc_service.service_description as service,
\r
1825 + -1 as service_soft_state,
\r
1826 + -1 as service_hard_state,
\r
1827 + npc_service.notifications_enabled as service_notifications,
\r
1828 + npc_service_check.last_check,
\r
1829 + npc_service_check.next_check,
\r
1830 + npc_service_check.check_execute_time,
\r
1831 + npc_service_check.check_latency,
\r
1832 + npc_service_check.check_command,
\r
1833 + npc_service_check.performance_data,
\r
1835 + 0 as current_attempt,
\r
1836 + npc_service_check.max_attempts,
\r
1837 + null as plugin_output
\r
1840 + npc_hostgroup_membership,
\r
1842 + npc_service_check
\r
1844 + npc_host.id = npc_hostgroup_membership.hostid and
\r
1845 + npc_host.id = npc_service.hostid and
\r
1846 + npc_service.id = npc_service_check.serviceid and
\r
1847 + npc_service.configured = TRUE and
\r
1848 + npc_service.has_been_checked = FALSE and
\r
1849 + npc_host.has_been_checked = FALSE
\r
1852 + npc_host.id as hostid,
\r
1855 + -1 as host_soft_state,
\r
1856 + npc_host.notifications_enabled as host_notifications,
\r
1857 + npc_service.id as serviceid,
\r
1858 + npc_service.cacti_graph_id,
\r
1859 + npc_service.service_description as service,
\r
1860 + -1 as service_soft_state,
\r
1861 + -1 as service_hard_state,
\r
1862 + npc_service.notifications_enabled as service_notifications,
\r
1863 + npc_service_check.last_check,
\r
1864 + npc_service_check.next_check,
\r
1865 + npc_service_check.check_execute_time,
\r
1866 + npc_service_check.check_latency,
\r
1867 + npc_service_check.check_command,
\r
1868 + npc_service_check.performance_data,
\r
1870 + 0 as current_attempt,
\r
1871 + npc_service_check.max_attempts,
\r
1872 + null as plugin_output
\r
1876 + npc_service_check
\r
1878 + npc_host.id not in (select hostid from npc_hostgroup_membership) and
\r
1879 + npc_host.id = npc_service.hostid and
\r
1880 + npc_service.id = npc_service_check.serviceid and
\r
1881 + npc_service.configured = TRUE and
\r
1882 + npc_service.has_been_checked = FALSE and
\r
1883 + npc_host.has_been_checked = FALSE
\r
1886 + ) as host_details where hostid = $hostid and service = '$serviceName'");
\r
1888 + $service_detail["flapping"] = db_fetch_cell("select id from npc_flapping_service where id = $serviceid");
\r
1889 + $service_config = db_fetch_row("select active_checks_enabled, passive_checks_enabled, event_handler_enabled, flap_detection_enabled, notifications_enabled, failure_prediction_enabled, process_performance_data, obsess_over_service, event_handler from npc_service where hostid = $hostid and service_description = '$serviceName'");
\r
1890 + $comments = db_fetch_assoc("select id,serviceid,timestamp,author,comment,persist,type from npc_comment where serviceid = '$serviceid'");
\r
1891 + $row_count = count($comments);
\r
1898 + <table width="98%" border="0" cellpadding="0" cellspacing="0" align="center">
\r
1899 + <tr class="textSubHeaderDark" bgcolor='#6d88ad'>
\r
1901 + <h2> [ <?php echo $serviceName; ?> ] on
\r
1902 + <a href="extinfo.php?type=1&hostid=<?php echo $hostid; ?>&hostname=<?php echo $hostname; ?>"><?php echo $hostname; ?></a></h2>
\r
1904 + <td align='right' nowrap>
\r
1905 + <FORM NAME="cl" ACTION="command.php" method="POST">Command:
\r
1906 + <INPUT TYPE='hidden' NAME='host' VALUE='<?php echo $hostname; ?>'>
\r
1907 + <INPUT TYPE='hidden' NAME='hostid' VALUE='<?php echo $service_detail["hostid"]; ?>'>
\r
1908 + <INPUT TYPE='hidden' NAME='service' VALUE='<?php echo $serviceName; ?>'>
\r
1909 + <INPUT TYPE='hidden' NAME='serviceid' VALUE='<?php echo $service_detail["serviceid"]; ?>'>
\r
1910 + <select name="command" size="1">
\r
1913 + if (read_config_option("nagios_commands")) {
\r
1915 + echo "<OPTION VALUE='NULL'>Execute a command</option>";
\r
1917 + if ($service_config["active_checks_enabled"]) {
\r
1918 + echo "<strong><OPTION VALUE='DISABLE_SVC_CHECK'>Disable active checks</option></strong>";
\r
1919 + echo "<OPTION VALUE='SCHEDULE_SVC_CHECK'>Re-schedule the next check</option>";
\r
1921 + echo "<OPTION VALUE='ENABLE_SVC_CHECK'>Enable Active Checks</option>";
\r
1923 + if ($service_config["passive_checks_enabled"]) {
\r
1924 + echo "<OPTION VALUE='PROCESS_SVC_CHECK_RESULT'>Submit passive check result</option>";
\r
1925 + echo "<OPTION VALUE='DISABLE_PASSIVE_SVC_CHECKS'>Stop accepting passive checks</option>";
\r
1927 + echo "<OPTION VALUE='ENABLE_PASSIVE_SVC_CHECKS'>Start accepting passive checks</option>";
\r
1929 + if ($service_config["obsess_over_service"]) {
\r
1930 + echo "<OPTION VALUE='STOP_OBSESSING_OVER_SVC'>Stop obsessing</option>";
\r
1932 + echo "<OPTION VALUE='START_OBSESSING_OVER_SVC'>Start obsessing</option>";
\r
1934 + if ($service_detail["Current Status"] == 1 || $service_detail["Current Status"] == 2 || $service_detail["Current Status"] == 3 && $service_detail["Current Status"] == $service_detail["service_hard_state"]) {
\r
1935 + if (!db_fetch_cell("select * from npc_comment where serviceid = $serviceid and type = 4;")) {
\r
1936 + echo "<OPTION VALUE='ACKNOWLEDGE_SVC_PROBLEM'>Acknowledge This Service Problem</option>";
\r
1937 + } elseif (db_fetch_cell("select * from npc_comment where serviceid = $serviceid and type = 4;")) {
\r
1938 + echo "<OPTION VALUE='REMOVE_SVC_ACKNOWLEDGEMENT'>Remove Problem Acknowledgement</option>";
\r
1941 + if ($service_config["notifications_enabled"]) {
\r
1942 + echo "<OPTION VALUE='DISABLE_SVC_NOTIFICATIONS'>Disable Notifications</option>";
\r
1943 + if ($service_detail["Current Status"] != 0) {
\r
1944 + echo "<OPTION VALUE='DELAY_SVC_NOTIFICATION'>Delay Next Service Notification</option>";
\r
1947 + echo "<OPTION VALUE='ENABLE_SVC_NOTIFICATIONS'>Enable Notifications</option>";
\r
1949 + echo "<OPTION VALUE='SCHEDULE_SVC_DOWNTIME'>Schedule Downtime</option>";
\r
1950 + if ($service_config["event_handler_enabled"]) {
\r
1951 + echo "<OPTION VALUE='DISABLE_SVC_EVENT_HANDLER'>Disable Event Handler</option>";
\r
1953 + echo "<OPTION VALUE='ENABLE_SVC_EVENT_HANDLER'>Enable Event Handler</option>";
\r
1955 + if ($service_config["flap_detection_enabled"]) {
\r
1956 + echo "<OPTION VALUE='DISABLE_SVC_FLAP_DETECTION'>Disable Flap Detection</option>";
\r
1958 + echo "<OPTION VALUE='ENABLE_SVC_FLAP_DETECTION'>Enable Flap Detection</option>";
\r
1960 + echo "<OPTION VALUE='ADD_SVC_COMMENT'>Add Service Comment</option>";
\r
1961 + echo "<OPTION VALUE='DEL_ALL_SVC_COMMENTS'>Delete All Service Comments</option>";
\r
1963 + echo "<OPTION VALUE=''>Command execution disabled</option>";
\r
1968 + <input type='image' src='../../images/button_go.gif' alt='Go' value='Execute' align='absmiddle'>
\r
1975 + <tr><td> </td><td> </td></tr>
\r
1977 + <td valign="top">
\r
1978 + <table width="100%" border="0" align="left" valign="top">
\r
1980 + <tr class="textHeaderDark" bgcolor='#00438C'>
\r
1981 + <td align="center"><strong>Service State Information</strong></td>
\r
1986 + <td width="100%" valign="top">
\r
1987 + <table width="100%" align="center" cellpadding="3">
\r
1989 + <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
\r
1990 + <td>Parameter</td>
\r
2000 + foreach ($service_detail as $key => $value) {
\r
2005 + case "Current Status":
\r
2006 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2007 + echo "<td>" . $key . ":</td>";
\r
2011 + echo "<td class='statusPENDING'><strong>PENDING</strong></td>";
\r
2014 + echo "<td class='statusOK'><strong>OK</strong></td>";
\r
2017 + echo "<td class='statusWARNING'><strong>WARNING</strong></td>";
\r
2020 + echo "<td class='statusCRITICAL'><strong>CRITICAL</strong></td>";
\r
2023 + echo "<td class='statusUNKNOWN'><strong>UNKNOWN</strong></td>";
\r
2028 + case "State Duration":
\r
2029 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2030 + echo "<td>" . $key . ":</td>";
\r
2031 + echo "<td>" . formatTime($value) . "</td>";
\r
2034 + case "Check Command":
\r
2035 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2036 + echo "<td>" . $key . ":</td>";
\r
2037 + echo "<td>" . $value . "</td>";
\r
2040 + case "Plugin Output":
\r
2041 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2042 + echo "<td>" . $key . ":</td>";
\r
2043 + echo "<td>" . $value . "</td>";
\r
2046 + case "Performance Data":
\r
2047 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2048 + echo "<td>" . $key . ":</td>";
\r
2049 + echo "<td>" . $value . "</td>";
\r
2052 + case "Current Attempt":
\r
2053 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2054 + echo "<td>" . $key . ":</td>";
\r
2055 + echo "<td>" . $value . "/" . $service_detail["Max Attempts"] . "</td>";
\r
2058 + case "Last Check":
\r
2059 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2060 + echo "<td>" . $key . ":</td>";
\r
2061 + if (preg_match('/1969-12-31/', $value)) {
\r
2062 + echo "<td>N/A</td>";
\r
2064 + echo "<td>" . $value . "</td>";
\r
2068 + case "Next Check":
\r
2069 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2070 + echo "<td>" . $key . ":</td>";
\r
2071 + echo "<td>" . $value . "</td>";
\r
2074 + case "Check Latency":
\r
2075 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2076 + echo "<td>" . $key . ":</td>";
\r
2077 + echo "<td>" . $value . "</td>";
\r
2080 + case "Check Duration":
\r
2081 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2082 + echo "<td>" . $key . ":</td>";
\r
2083 + echo "<td>" . $value . "</td>";
\r
2086 + case "flapping":
\r
2087 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2088 + echo "<td>Flapping:</td>";
\r
2089 + if ($service_detail["flapping"]) {
\r
2090 + echo "<td>Yes</td>";
\r
2092 + echo "<td>No</td>";
\r
2098 + if($rowColor == $background1) {
\r
2099 + $rowColor = $background2;
\r
2101 + $rowColor = $background1;
\r
2104 + if ($key == "flapping") {
\r
2105 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2106 + echo "<td>Event Handler:</td>";
\r
2107 + if (!$service_config["event_handler"]) {
\r
2108 + echo "<td>N/A</td>";
\r
2110 + echo "<td>" . $service_config["event_handler"] . "</td>";
\r
2131 + <td valign="top">
\r
2132 + <table width="70%" border="0" align="right">
\r
2134 + <tr class="textHeaderDark" bgcolor='#00438C'>
\r
2135 + <td align="center"><strong>Service Monitoring Options</strong></td>
\r
2140 + <td width="70%" valign="top">
\r
2141 + <table width="100%" align="center" cellpadding="3">
\r
2143 + <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
\r
2144 + <td>Parameter</td>
\r
2151 + $rowColor = $background1;
\r
2152 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2155 + foreach ($service_config as $key => $value) {
\r
2157 + if ($key == "event_handler") { continue; }
\r
2159 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2163 + case "active_checks_enabled":
\r
2164 + echo "<td>Active Checks:</td>";
\r
2166 + case "passive_checks_enabled":
\r
2167 + echo "<td>Passive Checks:</td>";
\r
2169 + case "event_handler_enabled":
\r
2170 + echo "<td>Event Handler:</td>";
\r
2172 + case "flap_detection_enabled":
\r
2173 + echo "<td>Flap Detection:</td>";
\r
2175 + case "notifications_enabled":
\r
2176 + echo "<td>Notifications:</td>";
\r
2178 + case "failure_prediction_enabled":
\r
2179 + echo "<td>Failure Prediction:</td>";
\r
2181 + case "process_performance_data":
\r
2182 + echo "<td>Process Performance Data:</td>";
\r
2184 + case "obsess_over_service":
\r
2185 + echo "<td>Obsess Over Service:</td>";
\r
2189 + if ($value == 0) {
\r
2190 + echo "<td class='optionDISABLED'>Disabled</td></tr>";
\r
2192 + echo "<td class='optionENABLED'>Enabled</td></tr>";
\r
2195 + if($rowColor == $background1) {
\r
2196 + $rowColor = $background2;
\r
2198 + $rowColor = $background1;
\r
2224 + <tr><td> </td><td> </td></tr>
\r
2225 + <tr><td> </td><td> </td></tr>
\r
2226 + <td valign="top" colspan='2'>
\r
2227 + <table width="60%" border="0" align="center">
\r
2229 + <tr class="textHeaderDark" bgcolor='#00438C'>
\r
2230 + <td align="center"><strong>Service Comments</strong></td>
\r
2235 + <td width="60%" valign="top">
\r
2236 + <table width="100%" align="center" cellpadding="3">
\r
2238 + <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
\r
2239 + <td>Entry Time</td>
\r
2241 + <td>Comment</td>
\r
2242 + <td>Persistent</td>
\r
2247 + for($i = 0; $i < $row_count; $i++) {
\r
2249 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2250 + echo "<td nowrap>" . $comments[$i]["timestamp"] . "</td>";
\r
2251 + echo "<td>" . $comments[$i]["author"] . "</td>";
\r
2252 + echo "<td>" . $comments[$i]["comment"] . "</td>";
\r
2254 + if ($comments[$i]["persist"]) {
\r
2261 + if ($comments[$i]["type"] == 2) {
\r
2263 + } elseif ($comments[$i]["type"] == 4) {
\r
2264 + echo "Acknowledgment";
\r
2268 + if ($comments[$i]["type"] == 2) {
\r
2269 + echo "<a href='command.php?cmd=DEL_SVC_COMMENT&id=" . $comments[$i]["id"] . "&host=" . $hostname . "&hostid=" . $hostid . "&service=" . $_REQUEST["service"] . "&serviceid=" . $serviceid . "'><img src='images/delete.gif' alt='delete' title='Delete comment' border=0></a>";
\r
2270 + } elseif ($comments[$i]["type"] == 4) {
\r
2271 + echo "<a href='command.php?cmd=REMOVE_SVC_ACKNOWLEDGEMENT&host=" . $hostname . "&hostid=" . $hostid . "&service=" . $_REQUEST["service"] . "&serviceid=" . $serviceid . "'><img src='images/delete.gif' alt='Remove' title='Remove problem acknowledgment' border=0></a>";
\r
2276 + if($rowColor == $background1) {
\r
2277 + $rowColor = $background2;
\r
2279 + $rowColor = $background1;
\r
2297 + echo "<a href='command.php?cmd=ADD_SVC_COMMENT&host=" . $hostname . "&hostid=" . $hostid . "&service=" . $_REQUEST["service"] . "&serviceid=" . $serviceid . "'><img src='images/comment.gif' alt='Add a comment' title='Add a comment' border=0></a>";
\r
2298 + echo "<a href='command.php?cmd=DEL_ALL_SVC_COMMENTS&host=" . $hostname . "&hostid=" . $hostid . "&service=" . $_REQUEST["service"] . "&serviceid=" . $serviceid . "'><img src='images/delete.gif' alt='Delete all comments' title='Delete all comments' border=0></a>";
\r
2306 + <tr><td> </td><td> </td></tr>
\r
2307 + <tr><td> </td><td> </td></tr>
\r
2314 + <td valign="top" colspan='2'>
\r
2315 + <table width="60%" border="0" align="center">
\r
2317 + <tr align="center" class="textHeaderDark" bgcolor='#00438C'>
\r
2318 + <td align="center"><strong>Graph Mapping</strong></td>
\r
2323 + <td width="60%" valign="top">
\r
2324 + <table width="100%" align="center" cellpadding="3">
\r
2329 +$cacti_graphs = db_fetch_assoc("
\r
2331 + graph_templates_graph.id,
\r
2332 + graph_templates_graph.local_graph_id,
\r
2333 + graph_templates_graph.height,
\r
2334 + graph_templates_graph.width,
\r
2335 + graph_templates_graph.title_cache as title,
\r
2336 + graph_templates.name,
\r
2337 + graph_local.host_id
\r
2338 + from graph_local,graph_templates_graph
\r
2339 + left join graph_templates on graph_template_id=graph_templates.id
\r
2340 + where graph_local.id=graph_templates_graph.local_graph_id
\r
2341 + and graph_templates_graph.title_cache like '%'
\r
2342 + order by graph_templates_graph.title_cache,graph_local.host_id");
\r
2344 + $row_count = count($cacti_graphs);
\r
2345 +/* http://logindev/cacti/graph_image.php?local_graph_id=6&rra_id=0 */
\r
2348 + <FORM NAME="gm" ACTION="" method="post">
\r
2349 + <tr bgcolor='<?php echo $background1; ?>'>
\r
2350 + <td>Associated graph:</td>
\r
2352 + <select name="local_graph_id" size="1">
\r
2354 + echo "<OPTION VALUE='NULL'>None</option>";
\r
2355 + for($i = 0; $i < $row_count; $i++) {
\r
2356 + echo "<OPTION VALUE='" . $cacti_graphs[$i]["local_graph_id"] . "'>" . $cacti_graphs[$i]["title"] . "</option>";
\r
2363 + <td><INPUT TYPE="submit" VALUE="Map"></td>
\r
2371 + if ($service_detail["cacti_graph_id"]) {
\r
2372 + echo "<table align='center'>";
\r
2373 + echo "<tr><td width='100%'>";
\r
2374 + echo "<img src='../../graph_image.php?local_graph_id=" . $service_detail["cacti_graph_id"] . "&rra_id=0'>";
\r
2375 + echo "</td></tr>";
\r
2394 +function hostInfo() {
\r
2396 + $hostid = $_REQUEST["hostid"];
\r
2397 + $hostname = $_REQUEST["hostname"];
\r
2399 + if (isset($_POST["local_graph_id"])) {
\r
2400 + db_execute("update npc_host set cacti_graph_id = " . $_POST["local_graph_id"] . " where id = " . $hostid);
\r
2401 + header("Location: extinfo.php?type=1&hostid=" . $hostid . "&hostname=" . $hostname);
\r
2404 + include_once("top_npc_header.php");
\r
2406 + $background1 = "#F5F5F5";
\r
2407 + $background2 = "#E7E9F2";
\r
2408 + $rowColor = $background1;
\r
2410 + $host_flapping["flapping"] = db_fetch_cell("select id from npc_flapping_host where id = $hostid");
\r
2412 + $host_history = db_fetch_row("select started, soft_state, hard_state, current_attempt, plugin_output from npc_host_history where hostid = $hostid order by started desc;");
\r
2414 + $host_check = db_fetch_row("select check_command, check_execute_time, check_latency, from_unixtime(last_check) as last_check, from_unixtime(next_check) as next_check, max_attempts, last_notification, next_notification, no_more_notifications, check_type, performance_data from npc_host_check where hostid = $hostid;");
\r
2416 + $host_config = db_fetch_row("select active_checks_enabled, passive_checks_enabled, event_handler_enabled, flap_detection_enabled, notifications_enabled, failure_prediction_enabled, process_performance_data, obsess_over_host, event_handler, cacti_graph_id from npc_host where id = $hostid");
\r
2418 + $comments = db_fetch_assoc("select id,serviceid,timestamp,author,comment,persist,type from npc_comment where hostid = $hostid");
\r
2420 + $graphView = db_fetch_cell("select id from graph_tree_items where host_id = (select id from host where npc_host_id = $hostid)");
\r
2422 + $row_count = count($comments);
\r
2424 + $duration = date("U") - $host_history["started"];
\r
2431 + <table width="98%" border="0" cellpadding="0" cellspacing="0" align="center">
\r
2432 + <tr class="textSubHeaderDark" bgcolor='#6d88ad'>
\r
2434 + <h2> <strong><?php echo $hostname; ?></strong></h2>
\r
2436 + <td align='right' nowrap>
\r
2437 + <FORM NAME="cl" ACTION="command.php" method="POST">Command:
\r
2438 + <INPUT TYPE='hidden' NAME='host' VALUE='<?php echo $hostname; ?>'>
\r
2439 + <INPUT TYPE='hidden' NAME='hostid' VALUE='<?php echo $hostid; ?>'>
\r
2440 + <select name="command" size="1">
\r
2443 + if (read_config_option("nagios_commands")) {
\r
2445 + echo "<OPTION VALUE='NULL'>Execute a command</option>";
\r
2447 + if ($host_config["active_checks_enabled"]) {
\r
2448 + echo "<OPTION VALUE='DISABLE_HOST_CHECK'>Disable active checks</option>";
\r
2449 + echo "<OPTION VALUE='SCHEDULE_HOST_CHECK'>Re-schedule the next check</option>";
\r
2450 + echo "<OPTION VALUE='SCHEDULE_HOST_SVC_CHECKS'>Schedule a check of all services</option>";
\r
2452 + echo "<OPTION VALUE='ENABLE_HOST_CHECK'>Enable Active Checks</option>";
\r
2454 + echo "<OPTION VALUE='DISABLE_HOST_SVC_CHECKS'>Disable checks of all services</option>";
\r
2455 + echo "<OPTION VALUE='ENABLE_HOST_SVC_CHECKS'>Enabble checks of all services</option>";
\r
2456 + if ($host_config["passive_checks_enabled"]) {
\r
2457 + echo "<OPTION VALUE='PROCESS_HOST_CHECK_RESULT'>Submit passive check result</option>";
\r
2458 + echo "<OPTION VALUE='DISABLE_PASSIVE_HOST_CHECKS'>Stop accepting passive checks</option>";
\r
2460 + echo "<OPTION VALUE='ENABLE_PASSIVE_HOST_CHECKS'>Start accepting passive checks</option>";
\r
2462 + if ($host_config["obsess_over_service"]) {
\r
2463 + echo "<OPTION VALUE='STOP_OBSESSING_OVER_HOST'>Stop obsessing</option>";
\r
2465 + echo "<OPTION VALUE='START_OBSESSING_OVER_HOST'>Start obsessing</option>";
\r
2467 + if ($host_history["soft_state"] == 1 || $host_history["soft_state"] == 2 && $host_history["soft_state"] == $host_history["hard_state"]) {
\r
2468 + if (!db_fetch_cell("select * from npc_comment where hostid = $hostid and type = 4;")) {
\r
2469 + echo "<OPTION VALUE='ACKNOWLEDGE_HOST_PROBLEM'>Acknowledge This Host Problem</option>";
\r
2470 + } elseif (db_fetch_cell("select * from npc_comment where hostid = $hostid and type = 4;")) {
\r
2471 + echo "<OPTION VALUE='REMOVE_HOST_ACKNOWLEDGEMENT'>Remove Problem Acknowledgement</option>";
\r
2474 + if ($host_config["notifications_enabled"]) {
\r
2475 + echo "<OPTION VALUE='DISABLE_HOST_NOTIFICATIONS'>Disable Notifications</option>";
\r
2476 + if ($host_history["soft_state"] != 0) {
\r
2477 + echo "<OPTION VALUE='DELAY_HOST_NOTIFICATION'>Delay Next Service Notification</option>";
\r
2480 + echo "<OPTION VALUE='ENABLE_HOST_NOTIFICATIONS'>Enable Notifications</option>";
\r
2482 + echo "<OPTION VALUE='SCHEDULE_HOST_DOWNTIME'>Schedule Downtime</option>";
\r
2483 + if ($host_config["event_handler_enabled"]) {
\r
2484 + echo "<OPTION VALUE='DISABLE_HOST_EVENT_HANDLER'>Disable Event Handler</option>";
\r
2486 + echo "<OPTION VALUE='ENABLE_HOST_EVENT_HANDLER'>Enable Event Handler</option>";
\r
2488 + if ($host_config["flap_detection_enabled"]) {
\r
2489 + echo "<OPTION VALUE='DISABLE_HOST_FLAP_DETECTION'>Disable Flap Detection</option>";
\r
2491 + echo "<OPTION VALUE='ENABLE_HOST_FLAP_DETECTION'>Enable Flap Detection</option>";
\r
2493 + echo "<OPTION VALUE='ADD_HOST_COMMENT'>Add Host Comment</option>";
\r
2494 + echo "<OPTION VALUE='DEL_ALL_HOST_COMMENTS'>Delete All Host Comments</option>";
\r
2496 + echo "<OPTION VALUE='NULL'>Command execution disabled</option>";
\r
2501 + <input type='image' src='../../images/button_go.gif' alt='Go' value='Execute' align='absmiddle'>
\r
2507 + <tr><td></td><td></td></tr>
\r
2508 + <tr bgcolor='#a9b7cb'>
\r
2509 + <td><a href='statusDetail.php?filter=showHost&name=<?php echo $hostname; ?>'>View Services</a> | <?php if ($graphView) { ?><a href='<?php echo $config['url_path']?>graph_view.php?action=tree&tree_id=1&leaf_id=<?php echo $graphView; ?>'>View Graphs</a> | <?php } ?><a href='hostConfig.php?name=<?php echo $hostname; ?>&hostid=<?php echo $hostid; ?>'>Configure</a></td>
\r
2510 + <td> </td></tr>
\r
2513 + <tr><td> </td><td> </td></tr>
\r
2515 + <td valign="top">
\r
2516 + <table width="100%" border="0" align="left" valign="top">
\r
2518 + <tr class="textHeaderDark" bgcolor='#00438C'>
\r
2519 + <td align="center"><strong>Host State Information</strong></td>
\r
2524 + <td width="100%" valign="top">
\r
2525 + <table width="100%" align="center" cellpadding="3">
\r
2527 + <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
\r
2528 + <td>Parameter</td>
\r
2538 + $host_detail = array(
\r
2539 + 'Current Status' => $host_history["soft_state"],
\r
2540 + 'State Duration' => formatTime($duration),
\r
2541 + 'Check Command' => $host_check["check_command"],
\r
2542 + 'Plugin Output' => $host_history["plugin_output"],
\r
2543 + 'Performance Data' => $host_check["performance_data"],
\r
2544 + 'Current Attempt' => $host_history["current_attempt"],
\r
2545 + 'Last Check' => $host_check["last_check"],
\r
2546 + 'Next Check' => $host_check["next_check"],
\r
2547 + 'Check Latency' => $host_check["check_latency"],
\r
2548 + 'Check Duration' => $host_check["check_execute_time"],
\r
2549 + 'flapping' => $host_flapping["flapping"],
\r
2550 + 'Event Handler' => $host_config["event_handler"],
\r
2553 + foreach ($host_detail as $key => $value) {
\r
2558 + case "Current Status":
\r
2559 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2560 + echo "<td>" . $key . ":</td>";
\r
2564 + echo "<td class='statusPENDING'><strong>PENDING</strong></td>";
\r
2567 + echo "<td class='statusHOSTUP'><strong>UP</strong></td>";
\r
2570 + echo "<td class='statusHOSTDOWN'><strong>DOWN</strong></td>";
\r
2573 + echo "<td class='statusHOSTUNREACHABLE'><strong>UNREACHABLE</strong></td>";
\r
2578 + case "State Duration":
\r
2579 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2580 + echo "<td>" . $key . ":</td>";
\r
2581 + echo "<td>" . $value . "</td>";
\r
2584 + case "Check Command":
\r
2585 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2586 + echo "<td>" . $key . ":</td>";
\r
2587 + echo "<td>" . $value . "</td>";
\r
2590 + case "Plugin Output":
\r
2591 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2592 + echo "<td>" . $key . ":</td>";
\r
2593 + echo "<td>" . $value . "</td>";
\r
2596 + case "Performance Data":
\r
2597 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2598 + echo "<td>" . $key . ":</td>";
\r
2599 + echo "<td>" . $value . "</td>";
\r
2602 + case "Current Attempt":
\r
2603 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2604 + echo "<td>" . $key . ":</td>";
\r
2605 + echo "<td>" . $value . "/" . $host_check["max_attempts"] . "</td>";
\r
2608 + case "Last Check":
\r
2609 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2610 + echo "<td>" . $key . ":</td>";
\r
2611 + if (preg_match('/1969-12-31/', $value)) {
\r
2612 + echo "<td>N/A</td>";
\r
2614 + echo "<td>" . $value . "</td>";
\r
2618 + case "Next Check":
\r
2619 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2620 + echo "<td>" . $key . ":</td>";
\r
2621 + if (preg_match('/1969-12-31/', $value)) {
\r
2622 + echo "<td>N/A</td>";
\r
2624 + echo "<td>" . $value . "</td>";
\r
2628 + case "Check Latency":
\r
2629 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2630 + echo "<td>" . $key . ":</td>";
\r
2631 + echo "<td>" . $value . "</td>";
\r
2634 + case "Check Duration":
\r
2635 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2636 + echo "<td>" . $key . ":</td>";
\r
2637 + echo "<td>" . $value . "</td>";
\r
2640 + case "flapping":
\r
2641 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2642 + echo "<td>Flapping:</td>";
\r
2643 + if ($host_detail["flapping"]) {
\r
2644 + echo "<td>Yes</td>";
\r
2646 + echo "<td>No</td>";
\r
2650 + case "Event Handler":
\r
2651 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2652 + echo "<td>" . $key . ":</td>";
\r
2654 + echo "<td>N/A</td>";
\r
2656 + echo "<td>" . $value . "</td>";
\r
2662 + if($rowColor == $background1) {
\r
2663 + $rowColor = $background2;
\r
2665 + $rowColor = $background1;
\r
2683 + <td valign="top">
\r
2684 + <table width="70%" border="0" align="right">
\r
2686 + <tr class="textHeaderDark" bgcolor='#00438C'>
\r
2687 + <td align="center"><strong>Host Monitoring Options</strong></td>
\r
2692 + <td width="70%" valign="top">
\r
2693 + <table width="100%" align="center" cellpadding="3">
\r
2695 + <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
\r
2696 + <td>Parameter</td>
\r
2703 + $rowColor = $background1;
\r
2704 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2707 + foreach ($host_config as $key => $value) {
\r
2709 + if ($key == "event_handler") { continue; }
\r
2710 + if ($key == "cacti_graph_id") { continue; }
\r
2712 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2716 + case "active_checks_enabled":
\r
2717 + echo "<td>Active Checks:</td>";
\r
2719 + case "passive_checks_enabled":
\r
2720 + echo "<td>Passive Checks:</td>";
\r
2722 + case "event_handler_enabled":
\r
2723 + echo "<td>Event Handler:</td>";
\r
2725 + case "flap_detection_enabled":
\r
2726 + echo "<td>Flap Detection:</td>";
\r
2728 + case "notifications_enabled":
\r
2729 + echo "<td>Notifications:</td>";
\r
2731 + case "failure_prediction_enabled":
\r
2732 + echo "<td>Failure Prediction:</td>";
\r
2734 + case "process_performance_data":
\r
2735 + echo "<td>Process Performance Data:</td>";
\r
2737 + case "obsess_over_host":
\r
2738 + echo "<td>Obsess Over Host:</td>";
\r
2742 + if ($value == 0) {
\r
2743 + echo "<td class='optionDISABLED'>Disabled</td></tr>";
\r
2745 + echo "<td class='optionENABLED'>Enabled</td></tr>";
\r
2748 + if($rowColor == $background1) {
\r
2749 + $rowColor = $background2;
\r
2751 + $rowColor = $background1;
\r
2777 + <tr><td> </td><td> </td></tr>
\r
2778 + <tr><td> </td><td> </td></tr>
\r
2779 + <td valign="top" colspan='2'>
\r
2780 + <table width="60%" border="0" align="center">
\r
2782 + <tr class="textHeaderDark" bgcolor='#00438C'>
\r
2783 + <td align="center"><strong>Host Comments</strong></td>
\r
2788 + <td width="60%" valign="top">
\r
2789 + <table width="100%" align="center" cellpadding="3">
\r
2791 + <tr align="center" class="textSubHeaderDark" bgcolor='#6d88ad'>
\r
2792 + <td>Entry Time</td>
\r
2794 + <td>Comment</td>
\r
2795 + <td>Persistent</td>
\r
2800 + for($i = 0; $i < $row_count; $i++) {
\r
2802 + echo "<tr bgcolor='" . $rowColor . "'>";
\r
2803 + echo "<td nowrap>" . $comments[$i]["timestamp"] . "</td>";
\r
2804 + echo "<td>" . $comments[$i]["author"] . "</td>";
\r
2805 + echo "<td>" . $comments[$i]["comment"] . "</td>";
\r
2807 + if ($comments[$i]["persist"]) {
\r
2814 + if ($comments[$i]["type"] == 1) {
\r
2816 + } elseif ($comments[$i]["type"] == 3) {
\r
2817 + echo "Acknowledgment";
\r
2821 + if ($comments[$i]["type"] == 1) {
\r
2822 + echo "<a href='command.php?cmd=DEL_HOST_COMMENT&id=" . $comments[$i]["id"] . "&host=" . $hostname . "&hostid=" . $hostid . "'><img src='images/delete.gif' alt='delete' title='Delete comment' border=0></a>";
\r
2823 + } elseif ($comments[$i]["type"] == 3) {
\r
2824 + echo "<a href='command.php?cmd=REMOVE_HOST_ACKNOWLEDGEMENT&host=" . $hostname . "&hostid=" . $hostid . "'><img src='images/delete.gif' alt='Remove' title='Remove problem acknowledgment' border=0></a>";
\r
2829 + if($rowColor == $background1) {
\r
2830 + $rowColor = $background2;
\r
2832 + $rowColor = $background1;
\r
2850 + echo "<a href='command.php?cmd=ADD_HOST_COMMENT&host=" . $hostname . "&hostid=" . $hostid . "'><img src='images/comment.gif' alt='Add a comment' title='Add a comment' border=0></a>";
\r
2851 + echo "<a href='command.php?cmd=DEL_ALL_HOST_COMMENTS&host=" . $hostname . "&hostid=" . $hostid . "'><img src='images/delete.gif' alt='Delete all comments' title='Delete all comments' border=0></a>";
\r
2859 + <tr><td> </td><td> </td></tr>
\r
2860 + <tr><td> </td><td> </td></tr>
\r
2867 + <td valign="top" colspan='2'>
\r
2868 + <table width="60%" border="0" align="center">
\r
2870 + <tr align="center" class="textHeaderDark" bgcolor='#00438C'>
\r
2871 + <td align="center"><strong>Graph Mapping</strong></td>
\r
2876 + <td width="60%" valign="top">
\r
2877 + <table width="100%" align="center" cellpadding="3">
\r
2882 +$cacti_graphs = db_fetch_assoc("
\r
2884 + graph_templates_graph.id,
\r
2885 + graph_templates_graph.local_graph_id,
\r
2886 + graph_templates_graph.height,
\r
2887 + graph_templates_graph.width,
\r
2888 + graph_templates_graph.title_cache as title,
\r
2889 + graph_templates.name,
\r
2890 + graph_local.host_id
\r
2891 + from graph_local,graph_templates_graph
\r
2892 + left join graph_templates on graph_template_id=graph_templates.id
\r
2893 + where graph_local.id=graph_templates_graph.local_graph_id
\r
2894 + and graph_templates_graph.title_cache like '%'
\r
2895 + order by graph_templates_graph.title_cache,graph_local.host_id");
\r
2897 + $row_count = count($cacti_graphs);
\r
2898 +/* http://logindev/cacti/graph_image.php?local_graph_id=6&rra_id=0 */
\r
2901 + <FORM NAME="gm" ACTION="" method="post">
\r
2902 + <tr bgcolor='<?php echo $background1; ?>'>
\r
2903 + <td>Associated graph:</td>
\r
2905 + <select name="local_graph_id" size="1">
\r
2907 + echo "<OPTION VALUE='NULL'>None</option>";
\r
2908 + for($i = 0; $i < $row_count; $i++) {
\r
2909 + echo "<OPTION VALUE='" . $cacti_graphs[$i]["local_graph_id"] . "'>" . $cacti_graphs[$i]["title"] . "</option>";
\r
2916 + <td><INPUT TYPE="submit" VALUE="Map"></td>
\r
2924 + if ($host_config["cacti_graph_id"]) {
\r
2925 + echo "<table align='center'>";
\r
2926 + echo "<tr><td width='100%'>";
\r
2927 + echo "<img src='../../graph_image.php?local_graph_id=" . $host_config["cacti_graph_id"] . "&rra_id=0'>";
\r
2928 + echo "</td></tr>";
\r