From b1a5ff119ddf4a3b3f6c883b39c8f9600b254b27 Mon Sep 17 00:00:00 2001 From: guruevi Date: Wed, 9 Jul 2008 16:41:13 +0000 Subject: [PATCH] 2008-07-09 Evi Vanoost * pandora_console/pandoradb.sql: Updated indexes * pandora_agents/mac_osx: Updated pieces here and there including the installer and startup scripts to make them more compatible and reliable git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@948 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/ChangeLog | 6 ++- pandora_agents/mac_osx/pandora_agent.conf | 17 +++--- .../mac_osx/pandora_agent_installer | 7 +-- .../mac_osx/pandora_fms/pandora_fms | 4 +- pandora_console/ChangeLog | 4 ++ pandora_console/pandoradb.sql | 53 ++++++++++--------- 6 files changed, 48 insertions(+), 43 deletions(-) diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index d79d5e918b..65f98613a3 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,4 +1,8 @@ -2008-07-08 Evi Vanoost +2008-07-09 Evi Vanoost + + * pandora_agents/mac_osx: Updated pieces here and there including the installer and startup scripts to make them more compatible and reliable + +2008-07-08 Evi Vanoost * pandora_agents/tools pandora_agents/linux/plugins diff --git a/pandora_agents/mac_osx/pandora_agent.conf b/pandora_agents/mac_osx/pandora_agent.conf index 78b40b09dd..a673f9d6b8 100755 --- a/pandora_agents/mac_osx/pandora_agent.conf +++ b/pandora_agents/mac_osx/pandora_agent.conf @@ -57,7 +57,7 @@ transfer_mode local # cron_mode # If set to 1 allows the agent to be configured via the web console. -remote_config 1 +remote_config 0 # Module Definition @@ -221,17 +221,16 @@ module_end module_begin module_name DNS module_type generic_proc -module_exec ps aux | grep "sbin\/named" | wc -l +module_exec ps -A | grep "sbin\/named" | wc -l module_description DNS Server module_end -# Firewall always has 1 rule (allow) so we substract one. # You should have alerts in case the number of rules change module_begin module_name Firewall Status module_type generic_data -module_exec echo `sudo ipfw show | wc -l` - 1 | bc +module_exec ipfw show | wc -l module_description Firewall (number of rules) module_end @@ -252,14 +251,14 @@ module_end #module_begin #module_name Mail (SMTP) #module_type generic_proc -#module_exec ps -A | grep "master" | grep -v "grep" | wc -l +#module_exec ps -A | grep "smtpd -n smtp" | wc -l #module_description Mail - SMTP Server (postfix) #module_end #module_begin #module_name Mail (IMAP) #module_type generic_proc -#module_exec ps -A | grep "cyrus" | grep -v "grep" | wc -l +#module_exec ps -Au | grep "master" | grep "cyrus" | wc -l #module_description Mail - IMAP Server (cyrus) #module_end @@ -302,14 +301,14 @@ module_end #module_begin #module_name NFS #module_type generic_proc -#module_exec ps aux | grep "nfsd-master" | grep -v "grep" | wc -l +#module_exec ps -A | grep "nfsd-master" | grep -v "grep" | wc -l #module_description NFS File Server #module_end module_begin module_name Open Directory module_type generic_proc -module_exec ps aux | grep "bin\/krb5kdc" | wc -l +module_exec ps -A | grep "bin\/krb5kdc" | wc -l module_description Open Directory module_end @@ -330,7 +329,7 @@ module_end module_begin module_name Software Update module_type generic_proc -module_exec if [ `ps -A | grep "etc\/swupd" | wc -l` -gt "1" ]; then echo 1; else echo 0; fi +module_exec ps -A | grep "etc\/swupd" | wc -l module_description Software Update module_end diff --git a/pandora_agents/mac_osx/pandora_agent_installer b/pandora_agents/mac_osx/pandora_agent_installer index ee777ba432..1e6b3dad9a 100755 --- a/pandora_agents/mac_osx/pandora_agent_installer +++ b/pandora_agents/mac_osx/pandora_agent_installer @@ -96,18 +96,15 @@ install () { echo "Linking Pandora FMS Agent configuration to $PANDORA_CFG/pandora_agent.conf..." ln -s $PANDORA_HOME/pandora_agent.conf $PANDORA_CFG - echo "Linking Pandora FMS Agent user configuration to $PANDORA_CFG/pandora_user.conf..." - ln -s $PANDORA_HOME/pandora_user.conf $PANDORA_CFG - echo "Setting secure permissions and ownership for all Pandora FMS Agent files..." chown -R root $PANDORA_HOME chmod -R 600 $PANDORA_TEMP/data_out chmod 640 $PANDORA_LOG chgrp 3 $PANDORA_LOG - echo "Copyng start-up daemon script at $PANDORA_STARTUP"; + echo "Copying start-up daemon script at $PANDORA_STARTUP"; cp -R pandora_fms $PANDORA_STARTUP chown -R root:wheel $PANDORA_STARTUP - chmod -R 644 $PANDORA_STARTUP + chmod -R 744 $PANDORA_STARTUP chown -R root $PANDORA_BIN echo "Done." echo " " diff --git a/pandora_agents/mac_osx/pandora_fms/pandora_fms b/pandora_agents/mac_osx/pandora_fms/pandora_fms index 8e7355b30f..e6e67f96f8 100755 --- a/pandora_agents/mac_osx/pandora_fms/pandora_fms +++ b/pandora_agents/mac_osx/pandora_fms/pandora_fms @@ -24,7 +24,7 @@ StartService() if [ -f $PIDFILE ] then PID_BA=`cat $PIDFILE` - if [ ! -z "`ps -Af | awk '{ print $2 }' | grep $PID_BA`" ] + if [ ! -z "`ps -A | awk '{ print $1 }' | grep $PID_BA`" ] then echo "Pandora FMS Agent is currently running on this machine with PID $PID_BA" echo "Cannot launch again. Aborting." @@ -43,7 +43,7 @@ StopService() then echo "Stopping Pandora Agent." PID_2=`cat $PIDFILE` - if [ ! -z "`ps -f -p $PID_2 | grep -v grep | grep 'pandora_agent'`" ] + if [ ! -z "`ps -A | grep -v grep | grep 'pandora_agent'`" ] then kill -9 $PID_2 fi diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 49f5268436..cc7e0cf44b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,7 @@ +2008-07-09 Evi Vanoost + + * pandoradb.sql: Updated indexes + 2008-07-09 Sancho LErena * include/functions_html.php, include/functions_db.php, diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 217470288b..fb5aafa239 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -25,10 +25,10 @@ CREATE TABLE `taddress` ( `id_a` bigint(20) unsigned NOT NULL auto_increment, `ip` varchar(15) NOT NULL default '', `ip_pack` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id_a`) + PRIMARY KEY (`id_a`), + KEY `ip` (`ip`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - CREATE TABLE `taddress_agent` ( `id_ag` bigint(20) unsigned NOT NULL auto_increment, `id_a` bigint(20) unsigned NOT NULL default '0', @@ -49,7 +49,7 @@ CREATE TABLE `tagent_access` ( CREATE TABLE `tagente` ( `id_agente` mediumint(8) unsigned NOT NULL auto_increment, `nombre` varchar(100) NOT NULL default '', - `direccion` varchar(100) default '', + `direccion` varchar(100) default NULL, `comentarios` varchar(255) default '', `id_grupo` int(10) unsigned NOT NULL default '0', `ultimo_contacto` datetime NOT NULL default '0000-00-00 00:00:00', @@ -66,10 +66,11 @@ CREATE TABLE `tagente` ( `id_wmi_server` int(4) unsigned default '0', `id_parent` mediumint(8) unsigned default '0', PRIMARY KEY (`id_agente`), - KEY `nombre` (`nombre`), - KEY `direccion` (`direccion`), - KEY `disabled` (`disabled`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + KEY `nombre` (`nombre`), + KEY `direccion` (`direccion`), + KEY `disabled` (`disabled`), + KEY `id_grupo` (`id_grupo`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `tagente_datos` ( `id_agente_datos` bigint(10) unsigned NOT NULL auto_increment, @@ -117,7 +118,6 @@ CREATE TABLE `tagente_datos_string` ( KEY `data_string_index_1` (`id_agente`,`id_agente_modulo`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - CREATE TABLE `tagente_estado` ( `id_agente_estado` int(10) unsigned NOT NULL auto_increment, `id_agente_modulo` int(20) NOT NULL default '0', @@ -129,14 +129,15 @@ CREATE TABLE `tagente_estado` ( `last_try` datetime default NULL, `utimestamp` bigint(20) NOT NULL default '0', `current_interval` int(10) unsigned NOT NULL default '0', - `running_by` int(10) unsigned NULL default 0, + `running_by` int(10) unsigned default '0', `last_execution_try` bigint(20) NOT NULL default '0', PRIMARY KEY (`id_agente_estado`), - KEY `status_index_1` (`id_agente_modulo`), - KEY `status_index_2` (`id_agente_modulo`,`estado`), - KEY `current_interval` (`current_interval`), - KEY `last_execution_try` (`last_execution_try`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + KEY `status_index_1` (`id_agente_modulo`), + KEY `status_index_2` (`id_agente_modulo`,`estado`), + KEY `current_interval` (`current_interval`), + KEY `running_by` (`running_by`), + KEY `last_execution_try` (`last_execution_try`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /* @@ -167,21 +168,22 @@ CREATE TABLE `tagente_modulo` ( `ip_target` varchar(100) default '', `id_module_group` int(4) unsigned default '0', `flag` tinyint(3) unsigned default '1', - `id_modulo` int(11) unsigned NULL default 0, + `id_modulo` int(11) unsigned default '0', `disabled` tinyint(3) unsigned default '0', `id_export` tinyint(3) unsigned default '0', `plugin_user` varchar(250) default '', `plugin_pass` varchar(250) default '', - `plugin_parameter` text default '', + `plugin_parameter` text, `id_plugin` int(11) default '0', `post_process` double(18,2) default NULL, `prediction_module` bigint(14) default '0', `max_timeout` tinyint(3) unsigned default '0', - PRIMARY KEY (`id_agente_modulo`, `id_agente`), - KEY `tam_agente` (`id_agente`), - KEY `id_tipo_modulo` (`id_tipo_modulo`), - KEY `tam_plugin` (`id_plugin`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + PRIMARY KEY (`id_agente_modulo`,`id_agente`), + KEY `tam_agente` (`id_agente`), + KEY `id_tipo_modulo` (`id_tipo_modulo`), + KEY `tam_plugin` (`id_plugin`), + KEY `disabled` (`disabled`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- snmp_oid is also used for WMI query @@ -463,7 +465,6 @@ CREATE TABLE `tperfil` ( PRIMARY KEY (`id_perfil`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; - CREATE TABLE `trecon_task` ( `id_rt` int(10) unsigned NOT NULL auto_increment, `name` varchar(100) NOT NULL default '', @@ -478,11 +479,11 @@ CREATE TABLE `trecon_task` ( `status` tinyint(4) NOT NULL default '0', `interval_sweep` int(10) unsigned NOT NULL default '0', `id_network_server_assigned` int(10) unsigned NOT NULL default '0', - `extended_info` varchar(250) default NULL, + `extended_info` varchar(250) default NULL, `extended_value` varchar(250) default NULL, - PRIMARY KEY (`id_rt`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - + PRIMARY KEY (`id_rt`), + KEY `recon_task_daemon` (`id_network_server`,`utimestamp`,`status`,`interval_sweep`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `tserver` ( `id_server` int(10) unsigned NOT NULL auto_increment,