Changeset 139
- Timestamp:
- 04/05/08 18:35:40 (5 years ago)
- Location:
- trunk
- Files:
-
- 110 modified
-
config.php (modified) (1 prop)
-
controllers/cacti.php (modified) (1 prop)
-
controllers/commands.php (modified) (1 prop)
-
controllers/comments.php (modified) (1 diff, 1 prop)
-
controllers/controller.php (modified) (1 diff, 1 prop)
-
controllers/downtime.php (modified) (1 diff, 1 prop)
-
controllers/hostgroups.php (modified) (1 diff, 1 prop)
-
controllers/hosts.php (modified) (1 diff, 1 prop)
-
controllers/layout.php (modified) (1 prop)
-
controllers/layoutDev.php (modified) (1 prop)
-
controllers/logentries.php (modified) (1 diff, 1 prop)
-
controllers/nagios.php (modified) (1 diff, 1 prop)
-
controllers/notifications.php (modified) (1 diff, 1 prop)
-
controllers/servicegroups.php (modified) (1 diff, 1 prop)
-
controllers/services.php (modified) (1 diff, 1 prop)
-
controllers/settings.php (modified) (1 diff, 1 prop)
-
controllers/statehistory.php (modified) (1 diff, 1 prop)
-
controllers/sync.php (modified) (1 diff, 1 prop)
-
index.php (modified) (1 prop)
-
js/src/Portal.js (modified) (1 prop)
-
js/src/PortalColumn.js (modified) (1 prop)
-
js/src/Portlet.js (modified) (1 prop)
-
js/src/monitoring/commandForms.js (modified) (1 prop)
-
js/src/monitoring/comments.js (modified) (1 prop)
-
js/src/monitoring/downtime.js (modified) (1 prop)
-
js/src/monitoring/eventLog.js (modified) (1 prop)
-
js/src/monitoring/n2c.js (modified) (1 prop)
-
js/src/monitoring/processInfo.js (modified) (1 prop)
-
js/src/monitoring/reporting.js (modified) (1 prop)
-
js/src/npc.js (modified) (1 prop)
-
js/src/overrides/overrides.js (modified) (1 prop)
-
js/src/plugins/Ext.state.HttpProvider.js (modified) (1 prop)
-
js/src/plugins/Ext.ux.form.XCheckbox.js (modified) (1 diff, 1 prop)
-
js/src/plugins/Ext.ux.grid.Search.js (modified) (1 diff, 1 prop)
-
js/src/portlets/eventlog-portlet.js (modified) (1 prop)
-
js/src/portlets/host-problems-portlet.js (modified) (1 prop)
-
js/src/portlets/host-summary-portlet.js (modified) (1 prop)
-
js/src/portlets/hostgroup-host-status-portlet.js (modified) (1 prop)
-
js/src/portlets/hostgroup-service-status-portlet.js (modified) (1 prop)
-
js/src/portlets/monitoring-performance-portlet.js (modified) (1 prop)
-
js/src/portlets/service-problems-portlet.js (modified) (1 prop)
-
js/src/portlets/service-summary-portlet.js (modified) (1 prop)
-
js/src/portlets/servicegroup-host-status-portlet.js (modified) (1 prop)
-
js/src/portlets/servicegroup-service-status-portlet.js (modified) (1 prop)
-
models/NpcAcknowledgements.php (modified) (1 prop)
-
models/NpcCommands.php (modified) (1 prop)
-
models/NpcCommenthistory.php (modified) (1 prop)
-
models/NpcComments.php (modified) (1 prop)
-
models/NpcConfigfiles.php (modified) (1 prop)
-
models/NpcConfigfilevariables.php (modified) (1 prop)
-
models/NpcConninfo.php (modified) (1 prop)
-
models/NpcContactAddresses.php (modified) (1 prop)
-
models/NpcContactNotificationcommands.php (modified) (1 prop)
-
models/NpcContactgroupMembers.php (modified) (1 prop)
-
models/NpcContactgroups.php (modified) (1 prop)
-
models/NpcContactnotificationmethods.php (modified) (1 prop)
-
models/NpcContactnotifications.php (modified) (1 prop)
-
models/NpcContacts.php (modified) (1 prop)
-
models/NpcContactstatus.php (modified) (1 prop)
-
models/NpcCustomvariables.php (modified) (1 prop)
-
models/NpcCustomvariablestatus.php (modified) (1 prop)
-
models/NpcDbversion.php (modified) (1 prop)
-
models/NpcDowntimehistory.php (modified) (1 prop)
-
models/NpcEventhandlers.php (modified) (1 prop)
-
models/NpcExternalcommands.php (modified) (1 prop)
-
models/NpcFlappinghistory.php (modified) (1 prop)
-
models/NpcHostContactgroups.php (modified) (1 prop)
-
models/NpcHostContacts.php (modified) (1 prop)
-
models/NpcHostGraphs.php (modified) (1 prop)
-
models/NpcHostParenthosts.php (modified) (1 prop)
-
models/NpcHostchecks.php (modified) (1 prop)
-
models/NpcHostdependencies.php (modified) (1 prop)
-
models/NpcHostescalationContactgroups.php (modified) (1 prop)
-
models/NpcHostescalationContacts.php (modified) (1 prop)
-
models/NpcHostescalations.php (modified) (1 prop)
-
models/NpcHostgroupMembers.php (modified) (1 prop)
-
models/NpcHostgroups.php (modified) (1 prop)
-
models/NpcHosts.php (modified) (1 prop)
-
models/NpcHoststatus.php (modified) (1 prop)
-
models/NpcInstances.php (modified) (1 prop)
-
models/NpcLogentries.php (modified) (1 diff, 1 prop)
-
models/NpcNotifications.php (modified) (1 prop)
-
models/NpcObjects.php (modified) (1 prop)
-
models/NpcProcessevents.php (modified) (1 diff, 1 prop)
-
models/NpcProgramstatus.php (modified) (1 diff, 1 prop)
-
models/NpcRuntimevariables.php (modified) (1 prop)
-
models/NpcScheduleddowntime.php (modified) (1 prop)
-
models/NpcServiceContactgroups.php (modified) (1 prop)
-
models/NpcServiceContacts.php (modified) (1 prop)
-
models/NpcServiceGraphs.php (modified) (1 prop)
-
models/NpcServicechecks.php (modified) (1 prop)
-
models/NpcServicedependencies.php (modified) (1 prop)
-
models/NpcServiceescalationContactgroups.php (modified) (1 prop)
-
models/NpcServiceescalationContacts.php (modified) (1 prop)
-
models/NpcServiceescalations.php (modified) (1 prop)
-
models/NpcServicegroupMembers.php (modified) (1 prop)
-
models/NpcServicegroups.php (modified) (1 prop)
-
models/NpcServices.php (modified) (1 diff, 1 prop)
-
models/NpcServicestatus.php (modified) (1 prop)
-
models/NpcSettings.php (modified) (1 prop)
-
models/NpcStatehistory.php (modified) (1 prop)
-
models/NpcSystemcommands.php (modified) (1 prop)
-
models/NpcTimedeventqueue.php (modified) (1 prop)
-
models/NpcTimedevents.php (modified) (1 prop)
-
models/NpcTimeperiodTimeranges.php (modified) (1 prop)
-
models/NpcTimeperiods.php (modified) (1 prop)
-
nagioscmd.php (modified) (1 diff, 1 prop)
-
npc.php (modified) (1 diff, 1 prop)
-
perfdata.php (modified) (1 prop)
-
setup.php (modified) (9 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/config.php
- Property svn:keywords set to id
-
trunk/controllers/cacti.php
- Property svn:keywords set to id
-
trunk/controllers/commands.php
- Property svn:keywords set to id
-
trunk/controllers/comments.php
- Property svn:keywords set to id
r112 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/controllers/controller.php
- Property svn:keywords set to id
r131 r139 10 10 * @subpackage npc.controllers 11 11 * @since NPC 2.0 12 * @version $Id :$12 * @version $Id$ 13 13 */ 14 14 -
trunk/controllers/downtime.php
- Property svn:keywords set to id
r107 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/controllers/hostgroups.php
- Property svn:keywords set to id
r97 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/controllers/hosts.php
- Property svn:keywords set to id
r119 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/controllers/layout.php
- Property svn:keywords set to id
-
trunk/controllers/layoutDev.php
- Property svn:keywords set to id
-
trunk/controllers/logentries.php
- Property svn:keywords set to id
r97 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/controllers/nagios.php
- Property svn:keywords set to id
r116 r139 14 14 * @subpackage npc.controllers 15 15 * @since NPC 2.0 16 * @version $Id :$16 * @version $Id$ 17 17 */ 18 18 -
trunk/controllers/notifications.php
- Property svn:keywords set to id
r97 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/controllers/servicegroups.php
- Property svn:keywords set to id
r97 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/controllers/services.php
- Property svn:keywords set to id
r118 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/controllers/settings.php
- Property svn:keywords set to id
r97 r139 13 13 * @subpackage npc.controllers 14 14 * @since NPC 2.0 15 * @version $Id :$15 * @version $Id$ 16 16 */ 17 17 -
trunk/controllers/statehistory.php
- Property svn:keywords set to id
r97 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/controllers/sync.php
- Property svn:keywords set to id
r136 r139 12 12 * @subpackage npc.controllers 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/index.php
- Property svn:keywords set to id
-
trunk/js/src/Portal.js
- Property svn:keywords set to id
-
trunk/js/src/PortalColumn.js
- Property svn:keywords set to id
-
trunk/js/src/Portlet.js
- Property svn:keywords set to id
-
trunk/js/src/monitoring/commandForms.js
- Property svn:keywords set to id
-
trunk/js/src/monitoring/comments.js
- Property svn:keywords set to id
-
trunk/js/src/monitoring/downtime.js
- Property svn:keywords set to id
-
trunk/js/src/monitoring/eventLog.js
- Property svn:keywords set to id
-
trunk/js/src/monitoring/n2c.js
- Property svn:keywords set to id
-
trunk/js/src/monitoring/processInfo.js
- Property svn:keywords set to id
-
trunk/js/src/monitoring/reporting.js
- Property svn:keywords set to id
-
trunk/js/src/npc.js
- Property svn:keywords set to id
-
trunk/js/src/overrides/overrides.js
- Property svn:keywords set to id
-
trunk/js/src/plugins/Ext.state.HttpProvider.js
- Property svn:keywords set to id
-
trunk/js/src/plugins/Ext.ux.form.XCheckbox.js
- Property svn:keywords set to id
r107 r139 3 3 * 4 4 * @author Ing. Jozef Sakalos 5 * @version $Id : Ext.ux.form.XCheckbox.js 704 2008-02-11 04:49:11Z jozo$5 * @version $Id$ 6 6 * @date 10. February 2008 7 7 * -
trunk/js/src/plugins/Ext.ux.grid.Search.js
- Property svn:keywords set to id
r107 r139 7 7 * @copyright (c) 2008, by Ing. Jozef Sakalos 8 8 * @date 17. January 2008 9 * @version $Id : Ext.ux.grid.Search.js 634 2008-01-19 17:00:20Z jozo$9 * @version $Id$ 10 10 */ 11 11 -
trunk/js/src/portlets/eventlog-portlet.js
- Property svn:keywords set to id
-
trunk/js/src/portlets/host-problems-portlet.js
- Property svn:keywords set to id
-
trunk/js/src/portlets/host-summary-portlet.js
- Property svn:keywords set to id
-
trunk/js/src/portlets/hostgroup-host-status-portlet.js
- Property svn:keywords set to id
-
trunk/js/src/portlets/hostgroup-service-status-portlet.js
- Property svn:keywords set to id
-
trunk/js/src/portlets/monitoring-performance-portlet.js
- Property svn:keywords set to id
-
trunk/js/src/portlets/service-problems-portlet.js
- Property svn:keywords set to id
-
trunk/js/src/portlets/service-summary-portlet.js
- Property svn:keywords set to id
-
trunk/js/src/portlets/servicegroup-host-status-portlet.js
- Property svn:keywords set to id
-
trunk/js/src/portlets/servicegroup-service-status-portlet.js
- Property svn:keywords set to id
-
trunk/models/NpcAcknowledgements.php
- Property svn:keywords set to id
-
trunk/models/NpcCommands.php
- Property svn:keywords set to id
-
trunk/models/NpcCommenthistory.php
- Property svn:keywords set to id
-
trunk/models/NpcComments.php
- Property svn:keywords set to id
-
trunk/models/NpcConfigfiles.php
- Property svn:keywords set to id
-
trunk/models/NpcConfigfilevariables.php
- Property svn:keywords set to id
-
trunk/models/NpcConninfo.php
- Property svn:keywords set to id
-
trunk/models/NpcContactAddresses.php
- Property svn:keywords set to id
-
trunk/models/NpcContactNotificationcommands.php
- Property svn:keywords set to id
-
trunk/models/NpcContactgroupMembers.php
- Property svn:keywords set to id
-
trunk/models/NpcContactgroups.php
- Property svn:keywords set to id
-
trunk/models/NpcContactnotificationmethods.php
- Property svn:keywords set to id
-
trunk/models/NpcContactnotifications.php
- Property svn:keywords set to id
-
trunk/models/NpcContacts.php
- Property svn:keywords set to id
-
trunk/models/NpcContactstatus.php
- Property svn:keywords set to id
-
trunk/models/NpcCustomvariables.php
- Property svn:keywords set to id
-
trunk/models/NpcCustomvariablestatus.php
- Property svn:keywords set to id
-
trunk/models/NpcDbversion.php
- Property svn:keywords set to id
-
trunk/models/NpcDowntimehistory.php
- Property svn:keywords set to id
-
trunk/models/NpcEventhandlers.php
- Property svn:keywords set to id
-
trunk/models/NpcExternalcommands.php
- Property svn:keywords set to id
-
trunk/models/NpcFlappinghistory.php
- Property svn:keywords set to id
-
trunk/models/NpcHostContactgroups.php
- Property svn:keywords set to id
-
trunk/models/NpcHostContacts.php
- Property svn:keywords set to id
-
trunk/models/NpcHostGraphs.php
- Property svn:keywords set to id
-
trunk/models/NpcHostParenthosts.php
- Property svn:keywords set to id
-
trunk/models/NpcHostchecks.php
- Property svn:keywords set to id
-
trunk/models/NpcHostdependencies.php
- Property svn:keywords set to id
-
trunk/models/NpcHostescalationContactgroups.php
- Property svn:keywords set to id
-
trunk/models/NpcHostescalationContacts.php
- Property svn:keywords set to id
-
trunk/models/NpcHostescalations.php
- Property svn:keywords set to id
-
trunk/models/NpcHostgroupMembers.php
- Property svn:keywords set to id
-
trunk/models/NpcHostgroups.php
- Property svn:keywords set to id
-
trunk/models/NpcHosts.php
- Property svn:keywords set to id
-
trunk/models/NpcHoststatus.php
- Property svn:keywords set to id
-
trunk/models/NpcInstances.php
- Property svn:keywords set to id
-
trunk/models/NpcLogentries.php
- Property svn:keywords set to id
r97 r139 12 12 * @subpackage npc.models 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/models/NpcNotifications.php
- Property svn:keywords set to id
-
trunk/models/NpcObjects.php
- Property svn:keywords set to id
-
trunk/models/NpcProcessevents.php
- Property svn:keywords set to id
r97 r139 12 12 * @subpackage npc.models 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/models/NpcProgramstatus.php
- Property svn:keywords set to id
r97 r139 12 12 * @subpackage npc.models 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/models/NpcRuntimevariables.php
- Property svn:keywords set to id
-
trunk/models/NpcScheduleddowntime.php
- Property svn:keywords set to id
-
trunk/models/NpcServiceContactgroups.php
- Property svn:keywords set to id
-
trunk/models/NpcServiceContacts.php
- Property svn:keywords set to id
-
trunk/models/NpcServiceGraphs.php
- Property svn:keywords set to id
-
trunk/models/NpcServicechecks.php
- Property svn:keywords set to id
-
trunk/models/NpcServicedependencies.php
- Property svn:keywords set to id
-
trunk/models/NpcServiceescalationContactgroups.php
- Property svn:keywords set to id
-
trunk/models/NpcServiceescalationContacts.php
- Property svn:keywords set to id
-
trunk/models/NpcServiceescalations.php
- Property svn:keywords set to id
-
trunk/models/NpcServicegroupMembers.php
- Property svn:keywords set to id
-
trunk/models/NpcServicegroups.php
- Property svn:keywords set to id
-
trunk/models/NpcServices.php
- Property svn:keywords set to id
r117 r139 12 12 * @subpackage npc.models 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/models/NpcServicestatus.php
- Property svn:keywords set to id
-
trunk/models/NpcSettings.php
- Property svn:keywords set to id
-
trunk/models/NpcStatehistory.php
- Property svn:keywords set to id
-
trunk/models/NpcSystemcommands.php
- Property svn:keywords set to id
-
trunk/models/NpcTimedeventqueue.php
- Property svn:keywords set to id
-
trunk/models/NpcTimedevents.php
- Property svn:keywords set to id
-
trunk/models/NpcTimeperiodTimeranges.php
- Property svn:keywords set to id
-
trunk/models/NpcTimeperiods.php
- Property svn:keywords set to id
-
trunk/nagioscmd.php
- Property svn:keywords set to id
r109 r139 12 12 * @package npc 13 13 * @since NPC 2.0 14 * @version $Id :$14 * @version $Id$ 15 15 */ 16 16 -
trunk/npc.php
- Property svn:keywords set to id
r128 r139 1 1 <?php 2 3 /* 4 +-------------------------------------------------------------------------+ 5 | Copyright (C) 2007 Billy Gunn aka divagater (billy@gunn.org) | 6 | | 7 | This program is free software; you can redistribute it and/or | 8 | modify it under the terms of the GNU General Public License (GPLv3) | 9 | version 3 as published by the Free Software Foundation. | 10 | | 11 | This program is distributed in the hope that it will be useful, | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | GNU General Public License for more details. | 15 +-------------------------------------------------------------------------+ 16 | Cacti and Nagios are the copyright of their respective owners. | 17 +-------------------------------------------------------------------------+ 18 */ 2 19 3 20 chdir('../../'); -
trunk/perfdata.php
- Property svn:keywords set to id
-
trunk/setup.php
- Property svn:keywords set to id
r132 r139 1 1 <?php 2 /* $Id:$ */ 2 3 /* 3 4 +-------------------------------------------------------------------------+ … … 20 21 */ 21 22 22 function plugin_init_npc() { 23 global $plugin_hooks;24 $plugin_hooks['top_header_tabs']['npc'] = 'npc_show_tab';25 $plugin_hooks['top_graph_header_tabs']['npc'] = 'npc_show_tab';26 $plugin_hooks['config_arrays']['npc'] = 'npc_config_arrays';27 $plugin_hooks['draw_navigation_text']['npc'] = 'npc_draw_navigation_text';28 $plugin_hooks['config_form']['npc'] = 'npc_config_form';29 $plugin_hooks['api_device_save']['npc'] = 'npc_api_device_save';30 $plugin_hooks['top_graph_refresh']['npc'] = 'npc_top_graph_refresh'; 31 $plugin_hooks['config_settings']['npc'] = 'npc_config_settings';23 /** 24 * Called after install 25 * 26 * if return true, plugin will be installed but disabled 27 * if return false, plugin will be waiting configuration 28 * 29 * @return bool 30 */ 31 function plugin_npc_check_config () { 32 return true; 32 33 } 33 34 35 /** 36 * compatibility for plugin update 37 */ 34 38 function npc_version () { 39 return plugin_npc_version (); 40 } 41 42 /** 43 * Version information 44 */ 45 function plugin_npc_version () { 35 46 return array( 'name' => 'npc', 36 'version' => '2.0.0a ',47 'version' => '2.0.0a-136', 37 48 'longname' => 'Nagios plugin for Cacti', 38 49 'author' => 'Billy Gunn', … … 43 54 } 44 55 56 function plugin_npc_install () { 57 58 npc_setup_tables(); 59 60 api_plugin_register_realm ('npc', 'npc.php', 'Use NPC', 1); 61 62 // setup all arrays needed for npc 63 api_plugin_register_hook ('npc', 'config_arrays', 'npc_config_arrays', 'setup.php'); 64 65 // Add the npc tab 66 api_plugin_register_hook ('npc', 'top_header_tabs', 'npc_show_tab', 'setup.php'); 67 api_plugin_register_hook ('npc', 'top_graph_header_tabs', 'npc_show_tab', 'setup.php'); 68 69 // Provide navigation texts 70 api_plugin_register_hook ('npc', 'draw_navigation_text', 'npc_draw_navigation_text', 'setup.php'); 71 72 // Add Nagios host mapping select box 73 api_plugin_register_hook ('npc', 'config_form', 'npc_config_form', 'setup.php'); 74 75 // Saves the selection from the host mapping select box 76 api_plugin_register_hook ('npc', 'api_device_save', 'npc_api_device_save', 'setup.php'); 77 78 // Alter the page refresh rate 79 api_plugin_register_hook ('npc', 'top_graph_refresh', 'npc_top_graph_refresh', 'setup.php'); 80 81 // Add a npc tab to the settings page 82 api_plugin_register_hook ('npc', 'config_settings', 'npc_config_settings', 'setup.php'); 83 } 84 85 /** 86 * Remove all NPC database changes 87 */ 88 function plugin_npc_uninstall () { 89 90 // Drop all npc tables 91 db_execute("DROP TABLE `npc_acknowledgements`"); 92 db_execute("DROP TABLE `npc_commands`"); 93 db_execute("DROP TABLE `npc_commenthistory`"); 94 db_execute("DROP TABLE `npc_comments`"); 95 db_execute("DROP TABLE `npc_configfiles`"); 96 db_execute("DROP TABLE `npc_configfilevariables`"); 97 db_execute("DROP TABLE `npc_conninfo`"); 98 db_execute("DROP TABLE `npc_contact_addresses`"); 99 db_execute("DROP TABLE `npc_contact_notificationcommands`"); 100 db_execute("DROP TABLE `npc_contactgroup_members`"); 101 db_execute("DROP TABLE `npc_contactgroups`"); 102 db_execute("DROP TABLE `npc_contactnotificationmethods`"); 103 db_execute("DROP TABLE `npc_contactnotifications`"); 104 db_execute("DROP TABLE `npc_contacts`"); 105 db_execute("DROP TABLE `npc_contactstatus`"); 106 db_execute("DROP TABLE `npc_customvariables`"); 107 db_execute("DROP TABLE `npc_customvariablestatus`"); 108 db_execute("DROP TABLE `npc_dbversion`"); 109 db_execute("DROP TABLE `npc_downtimehistory`"); 110 db_execute("DROP TABLE `npc_eventhandlers`"); 111 db_execute("DROP TABLE `npc_externalcommands`"); 112 db_execute("DROP TABLE `npc_flappinghistory`"); 113 db_execute("DROP TABLE `npc_host_contactgroups`"); 114 db_execute("DROP TABLE `npc_host_contacts`"); 115 db_execute("DROP TABLE `npc_host_graphs`"); 116 db_execute("DROP TABLE `npc_host_parenthosts`"); 117 db_execute("DROP TABLE `npc_hostchecks`"); 118 db_execute("DROP TABLE `npc_hostdependencies`"); 119 db_execute("DROP TABLE `npc_hostescalation_contactgroups`"); 120 db_execute("DROP TABLE `npc_hostescalation_contacts`"); 121 db_execute("DROP TABLE `npc_hostescalations`"); 122 db_execute("DROP TABLE `npc_hostgroup_members`"); 123 db_execute("DROP TABLE `npc_hostgroups`"); 124 db_execute("DROP TABLE `npc_hosts`"); 125 db_execute("DROP TABLE `npc_hoststatus`"); 126 db_execute("DROP TABLE `npc_instances`"); 127 db_execute("DROP TABLE `npc_logentries`"); 128 db_execute("DROP TABLE `npc_notifications`"); 129 db_execute("DROP TABLE `npc_objects`"); 130 db_execute("DROP TABLE `npc_processevents`"); 131 db_execute("DROP TABLE `npc_programstatus`"); 132 db_execute("DROP TABLE `npc_runtimevariables`"); 133 db_execute("DROP TABLE `npc_scheduleddowntime`"); 134 db_execute("DROP TABLE `npc_service_contactgroups`"); 135 db_execute("DROP TABLE `npc_service_contacts`"); 136 db_execute("DROP TABLE `npc_service_graphs`"); 137 db_execute("DROP TABLE `npc_servicechecks`"); 138 db_execute("DROP TABLE `npc_servicedependencies`"); 139 db_execute("DROP TABLE `npc_serviceescalation_contactgroups`"); 140 db_execute("DROP TABLE `npc_serviceescalation_contacts`"); 141 db_execute("DROP TABLE `npc_serviceescalations`"); 142 db_execute("DROP TABLE `npc_servicegroup_members`"); 143 db_execute("DROP TABLE `npc_servicegroups`"); 144 db_execute("DROP TABLE `npc_services`"); 145 db_execute("DROP TABLE `npc_servicestatus`"); 146 db_execute("DROP TABLE `npc_settings`"); 147 db_execute("DROP TABLE `npc_statehistory`"); 148 db_execute("DROP TABLE `npc_systemcommands`"); 149 db_execute("DROP TABLE `npc_timedeventqueue`"); 150 db_execute("DROP TABLE `npc_timedevents`"); 151 db_execute("DROP TABLE `npc_timeperiod_timeranges`"); 152 db_execute("DROP TABLE `npc_timeperiods`"); 153 154 db_execute("ALTER TABLE `host` DROP `npc_host_object_id`"); 155 db_execute("DELETE FROM `settings` WHERE `name` like 'npc\_%'"); 156 157 api_plugin_remove_realms ('npc'); 158 } 159 160 /** 161 * Set the page refresh very high 162 */ 45 163 function npc_top_graph_refresh() { 46 // Don't want to refresh so set very high47 164 return('2592000'); 48 165 } … … 53 170 global $npc_default_settings, $npc_log_level; 54 171 55 $user_auth_realms[32]='View NPC'; 56 $user_auth_realm_filenames['npc.php'] = 32; 57 $user_auth_realm_filenames['test.php'] = 32; 58 $user_auth_realm_filenames['npc_layout.php'] = 32; 59 $user_auth_realm_filenames['npc_service_detail.php'] = 32; 60 61 $npc_log_level = array( 62 "0" => "None", 63 "1" => "ERROR - Log errors only", 64 "2" => "WARN - Log errors and warnings", 65 "3" => "INFO - Log errors, warnings, and info messages", 66 "4" => "DEBUG - Log everything" 67 ); 68 69 $npc_date_format = array( 70 "Y-m-d" => "2007-12-27", 71 "m-d-Y" => "12-27-2007", 72 "d-m-Y" => "27-12-2007", 73 "Y/m/d" => "2007/12/27", 74 "m/d/Y" => "12/27/2007", 75 "d/m/Y" => "27/12/2007", 76 "Y.m.d" => "2007.12.27", 77 "d.m.Y" => "27.12.2007", 78 "m.d.Y" => "12.27.2007" 79 ); 80 81 $npc_time_format = array( 82 "H:i:s" => "23:07", 83 "h:i:sa" => "11:07pm", 84 "h:i:sA" => "11:07PM", 85 "H.i.s" => "23.07", 86 "h.i.sa" => "11.07pm", 87 "h.i.sA" => "11.07PM" 88 ); 89 90 $npc_default_settings = array( 91 'date_format' => "s%3AY-m-d", 92 'time_format' => "s%3AH%3Ai%3As", 93 94 "serviceProblems" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A0%5Eindex%3Ds%253A0%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 95 "serviceSummary" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A0%5Eindex%3Ds%253A1%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 96 "servicegroupServiceStatus" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A0%5Eindex%3Ds%253A2%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 97 "servicegroupHostStatus" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A0%5Eindex%3Ds%253A3%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 98 "monitoringPerf" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A1%5Eindex%3Ds%253A4%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 99 100 "hostProblems" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A0%5Eindex%3Ds%253A0%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 101 "hostSummary" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A0%5Eindex%3Ds%253A1%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 102 "hostgroupServiceStatus" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A0%5Eindex%3Ds%253A2%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 103 "hostgroupHostStatus" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A0%5Eindex%3Ds%253A3%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 104 "eventLog" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A1%5Eindex%3Ds%253A4%5Erefresh%3Dn%253A60%5Erows%3Dn%253A5' 105 ); 106 172 if (isset($_SESSION["sess_user_id"])) { 173 174 $user_id=$_SESSION["sess_user_id"]; 175 176 $npc_realm = db_fetch_cell("SELECT id FROM plugin_config WHERE directory = 'npc'"); 177 $npc_enabled = db_fetch_cell("SELECT status FROM plugin_config WHERE directory = 'npc'"); 178 179 if ($npc_enabled == "1") { 180 181 $user_auth_realm_filenames['npc.php'] = 9000 + $npc_realm; 182 183 $npc_log_level = array( 184 "0" => "None", 185 "1" => "ERROR - Log errors only", 186 "2" => "WARN - Log errors and warnings", 187 "3" => "INFO - Log errors, warnings, and info messages", 188 "4" => "DEBUG - Log everything" 189 ); 190 191 $npc_date_format = array( 192 "Y-m-d" => "2007-12-27", 193 "m-d-Y" => "12-27-2007", 194 "d-m-Y" => "27-12-2007", 195 "Y/m/d" => "2007/12/27", 196 "m/d/Y" => "12/27/2007", 197 "d/m/Y" => "27/12/2007", 198 "Y.m.d" => "2007.12.27", 199 "d.m.Y" => "27.12.2007", 200 "m.d.Y" => "12.27.2007" 201 ); 202 203 $npc_time_format = array( 204 "H:i:s" => "23:07", 205 "h:i:sa" => "11:07pm", 206 "h:i:sA" => "11:07PM", 207 "H.i.s" => "23.07", 208 "h.i.sa" => "11.07pm", 209 "h.i.sA" => "11.07PM" 210 ); 211 212 // Initial settings for server side state handling 213 $npc_default_settings = array( 214 'date_format' => "s%3AY-m-d", 215 'time_format' => "s%3AH%3Ai%3As", 216 217 "serviceProblems" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A0%5Eindex%3Ds%253A0%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 218 "serviceSummary" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A0%5Eindex%3Ds%253A1%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 219 "servicegroupServiceStatus" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A0%5Eindex%3Ds%253A2%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 220 "servicegroupHostStatus" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A0%5Eindex%3Ds%253A3%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 221 "monitoringPerf" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol1%5Ehidden%3Db%253A1%5Eindex%3Ds%253A4%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 222 223 "hostProblems" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A0%5Eindex%3Ds%253A0%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 224 "hostSummary" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A0%5Eindex%3Ds%253A1%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 225 "hostgroupServiceStatus" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A0%5Eindex%3Ds%253A2%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 226 "hostgroupHostStatus" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A0%5Eindex%3Ds%253A3%5Erefresh%3Dn%253A60%5Erows%3Dn%253A10', 227 "eventLog" => 'o%3Acollapsed%3Db%253A0%5Ecolumn%3Ds%253Adashcol2%5Ehidden%3Db%253A1%5Eindex%3Ds%253A4%5Erefresh%3Dn%253A60%5Erows%3Dn%253A5' 228 ); 229 230 api_plugin_load_realms(); 231 } 232 } 107 233 } 108 234 … … 147 273 } 148 274 149 function npc_setup_table () {150 global $config, $database_default , $npc_default_settings;275 function npc_setup_tables() { 276 global $config, $database_default; 151 277 152 278 include_once($config["library_path"] . "/database.php"); … … 1326 1452 } else { 1327 1453 1328 $cUser = db_fetch_assoc('SELECT id FROM user_auth');1329 $nUser = db_fetch_assoc('SELECT user_id FROM npc_settings');1330 1331 // Add exitsting users to npc_settings1332 for ($i = 0; $i < count($cUser); $i++) {1333 if (!db_fetch_cell('SELECT user_id FROM npc_settings WHERE user_id = ' . $cUser[$i]['id'])) {1334 db_execute("INSERT INTO npc_settings VALUES(". $cUser[$i]['id'].",'".serialize($npc_default_settings)."')");1335 }1336 }1337 1338 // Delete non existent users from npc_settings1339 for ($i = 0; $i < count($nUser); $i++) {1340 if (isset($nUser[$i]['id']) && !db_fetch_cell('SELECT id FROM user_auth WHERE id = ' . $nUser[$i]['id'])) {1341 db_execute('DELETE FROM npc_settings WHERE user_id = ' . $nUser[$i]['id']);1342 }1343 }1344 1454 } 1345 1455 … … 1352 1462 1353 1463 function npc_show_tab() { 1354 global $config; 1355 if (api_user_realm_auth('npc.php')) { 1356 $cp = false; 1357 if (basename($_SERVER["PHP_SELF"]) == "npc.php") 1358 $cp = true; 1359 1360 print '<a href="' . $config['url_path'] . 'plugins/npc/npc.php"><img src="' 1361 . $config['url_path'] . 'plugins/npc/images/tab_npc' 1362 . ($cp ? "_down": "") . '.gif" alt="npc" align="absmiddle" border="0"></a>'; 1464 global $config; 1465 1466 if (isset($_SESSION["sess_user_id"])) { 1467 1468 $user_id = $_SESSION["sess_user_id"]; 1469 1470 $npc_realm = db_fetch_cell("SELECT id FROM plugin_config WHERE directory = 'npc'"); 1471 $npc_enabled = db_fetch_cell("SELECT status FROM plugin_config WHERE directory = 'npc'"); 1472 1473 if ($npc_enabled == "1") { 1474 if (api_user_realm_auth('npc.php')) { 1475 $cp = false; 1476 if (basename($_SERVER["PHP_SELF"]) == "npc.php") { $cp = true; } 1477 1478 print '<a href="' . $config['url_path'] . 'plugins/npc/npc.php"><img src="' 1479 . $config['url_path'] . 'plugins/npc/images/tab_npc' 1480 . ($cp ? "_down": "") . '.gif" alt="npc" align="absmiddle" border="0"></a>'; 1481 } 1363 1482 } 1364 npc_check_upgrade ();1483 } 1365 1484 } 1366 1485 1367 function npc_check_upgrade() {1368 $current = npc_version ();1369 $current = $current['version'];1370 $old = read_config_option('plugin_npc_version');1371 //if ($current != $old) {1372 npc_setup_table ();1373 //}1374 }1375 1376 1377 1486 function npc_config_settings() { 1378 1487 1379 global $tabs, $settings, $npc_date_format, $npc_time_format, $npc_log_level; 1380 1381 $tabs["npc"] = " NPC "; 1382 1383 $settings['npc'] = array( 1488 global $tabs, $settings, $npc_date_format, $npc_time_format, $npc_log_level, $npc_default_settings; 1489 1490 if (isset($_SESSION["sess_user_id"])) { 1491 1492 $user_id = $_SESSION["sess_user_id"]; 1493 1494 $npc_realm = db_fetch_cell("SELECT id FROM plugin_config WHERE directory = 'npc'"); 1495 $npc_enabled = db_fetch_cell("SELECT status FROM plugin_config WHERE directory = 'npc'"); 1496 1497 if ($npc_enabled == "1") { 1498 1499 $tabs["npc"] = " NPC "; 1500 1501 $cUser = db_fetch_assoc('SELECT id FROM user_auth'); 1502 $nUser = db_fetch_assoc('SELECT user_id FROM npc_settings'); 1503 1504 // Add exitsting users to npc_settings 1505 for ($i = 0; $i < count($cUser); $i++) { 1506 if (!db_fetch_cell('SELECT user_id FROM npc_settings WHERE user_id = ' . $cUser[$i]['id'])) { 1507 db_execute("INSERT INTO npc_settings VALUES(". $cUser[$i]['id'].",'".serialize($npc_default_settings)."')"); 1508 } 1509 } 1510 1511 // Delete non existent users from npc_settings 1512 for ($i = 0; $i < count($nUser); $i++) { 1513 if (isset($nUser[$i]['id']) && !db_fetch_cell('SELECT id FROM user_auth WHERE id = ' . $nUser[$i]['id'])) { 1514 db_execute('DELETE FROM npc_settings WHERE user_id = ' . $nUser[$i]['id']); 1515 } 1516 } 1517 1518 $settings['npc'] = array( 1384 1519 "npc_header" => array( 1385 "friendly_name" => "General Settings",1386 "method" => "spacer",1520 "friendly_name" => "General Settings", 1521 "method" => "spacer", 1387 1522 ), 1388 1523 "npc_nagios_commands" => array( 1389 "friendly_name" => "Remote Commands",1390 "description" => "Allow commands to be written to the Nagios command file.",1391 "method" => "checkbox",1524 "friendly_name" => "Remote Commands", 1525 "description" => "Allow commands to be written to the Nagios command file.", 1526 "method" => "checkbox", 1392 1527 ), 1393 1528 "npc_nagios_cmd_path" => array( 1394 "friendly_name" => "Nagios Command File Path",1395 "description" => "The path to the Nagios command file (nagios.cmd).",1396 "method" => "textbox",1397 "max_length" => 255,1398 ), 1529 "friendly_name" => "Nagios Command File Path", 1530 "description" => "The path to the Nagios command file (nagios.cmd).", 1531 "method" => "textbox", 1532 "max_length" => 255, 1533 ), 1399 1534 "npc_nagios_url" => array( 1400 "friendly_name" => "Nagios URL",1401 "description" => "The full URL to your Nagios installation (http://nagios.company.com/nagios/)",1402 "method" => "textbox",1403 "max_length" => 255,1535 "friendly_name" => "Nagios URL", 1536 "description" => "The full URL to your Nagios installation (http://nagios.company.com/nagios/)", 1537 "method" => "textbox", 1538 "max_length" => 255, 1404 1539 ), 1405 1540 "npc_date_format" => array( … … 1418 1553 ), 1419 1554 "npc_logging_header" => array( 1420 "friendly_name" => "Logging",1421 "method" => "spacer",1555 "friendly_name" => "Logging", 1556 "method" => "spacer", 1422 1557 ), 1423 1558 "npc_log_level" => array( … … 1428 1563 "array" => $npc_log_level, 1429 1564 ) 1430 ); 1565 ); 1566 } 1567 } 1431 1568 } 1432 1569