diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index de0cfc7187..b1063c5691 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,5 +1,10 @@ 2012-03-07 Sancho Lerena + * util/pandora_xml_stress.conf + util/pandora_xml_stress.pl: Now xml_stress tool can use units + in the XML generated files. Default configuration file is useful + to generate "real" scenarios. + * lib/PandoraFMS/Core.pm: Updated version. * lib/PandoraFMS/DataServer.pm: Support for "UNIT" tag in the diff --git a/pandora_server/util/pandora_xml_stress.conf b/pandora_server/util/pandora_xml_stress.conf index f5b75db229..5535594b2f 100644 --- a/pandora_server/util/pandora_xml_stress.conf +++ b/pandora_server/util/pandora_xml_stress.conf @@ -1,8 +1,12 @@ -# Maximum number of threads, by default 10. -max_threads 10 +# Sample configuration file for pandora_xmlstress +# (c) 2012, http://pandorafms.org +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# Maximum number of threads, by default 5 +max_threads 5 # File containing a list of agent names (one per line). -agent_file agent_names.txt +agent_file /tmp/agent_names.txt # Directory where XML data files will be placed, by default /tmp. # When sending files to a local Tentacle server make sure this directory @@ -28,17 +32,17 @@ os_version 2.6 agent_interval 300 # Data file generation start date, by default now. -time_from 2009-06-01 00:00:00 +time_from 2012-03-01 00:00:00 # Data file generation end date, by default now. -time_to 2009-06-05 00:00:00 +time_to 2012-03-08 00:00:00 # Get conf from Pandora Server -get_and_send_agent_conf 1 +get_and_send_agent_conf 0 # Delay after generating the first data file for each agent to avoid # race conditions when auto-creating the agent, by default 2. -startup_delay 2 +startup_delay 1 # Timezone offset: Difference with the server timezone timezone_offset 0 @@ -73,38 +77,64 @@ position_radius 10 # Module definitions. Similar to pandora_agent.conf. module_begin -module_name Module 1 +module_name Connections opened module_type generic_data -module_description A long description. -module_max 100 -module_min 10 -module_exec type=RANDOM;variation=60;min=20;max=80 +module_description Network connections used in this machine +module_exec type=RANDOM;variation=20;min=50;max=500 +module_unit conns module_end module_begin -module_name Module 2 +module_name Network Traffic (Incoming) module_type generic_data -module_description A long description. -module_max 80 -module_min 20 -module_exec type=SCATTER;prob=1;avg=40;min=0;max=80 +module_description Network throughtput for incoming data +module_exec type=RANDOM;variation=50;min=0;max=100000 +module_unit kbit/sec module_end +module_begin +module_name Network Traffic (Outgoing) +module_type generic_data +module_description Network throughtput for Outgoing data +module_exec type=RANDOM;variation=50;min=0;max=100000 +module_unit kbit/sec +module_end module_begin -module_name Module 3 +module_name Server Status +module_type generic_proc +module_description Status of my super-important daemon / service / process +module_exec type=RANDOM;variation=5;min=0;max=1 +module_end + +module_begin +module_name CPU Usage module_type generic_data -module_description A long description. -module_max 80 -module_min 20 +module_description % of CPU usage in this machine +module_unit % +module_exec type=SCATTER;prob=5;avg=10;min=0;max=80 +module_end + +module_begin +module_name Disk_Free +module_type generic_data +module_description Disk space available in MB. +module_unit MB +module_exec type=SCATTER;prob=2;avg=1000;min=200;max=1200 module_exec type=CURVE;min=20;max=80;time_wave_length=3600;time_offset=0 module_end module_begin -module_name Module 4 -module_type generic_data_string -module_description A long description. -module_max 100 -module_min 10 -module_exec type=RANDOM;variation=60;min=20;max=80 +module_name Memory_free +module_type generic_data +module_description RAM memory available in MB. +module_unit MB +module_exec type=CURVE;min=5;max=8000;time_wave_length=360000;time_offset=0 +module_end + +module_begin +module_name System Log File +module_type generic_data_string +module_description Messages from the system in logfile format +module_exec type=RANDOM;variation=60;min=40;max=40 module_end diff --git a/pandora_server/util/pandora_xml_stress.pl b/pandora_server/util/pandora_xml_stress.pl index f9d8aea06b..968ad7d9fe 100755 --- a/pandora_server/util/pandora_xml_stress.pl +++ b/pandora_server/util/pandora_xml_stress.pl @@ -3,7 +3,7 @@ # Pandora XML Stress tool. ################################################################################ # Copyright (c) 2009 Ramon Novoa, rnovoa@artica.es -# Copyright (c) 2009 Artica Soluciones Tecnologicas S.L. +# Copyright (c) 2012 Artica Soluciones Tecnologicas S.L. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -147,6 +147,8 @@ sub generate_xml_files ($$$$$$) { # Read module configuration my $module_type = get_conf_token ($module, 'module_type', 'generic_data'); my $module_description = get_conf_token ($module, 'module_description', ''); + my $module_unit = get_conf_token ($module, 'module_unit', ''); + #my $module_min = get_conf_token ($module, 'module_min', '0'); #my $module_max = get_conf_token ($module, 'module_max', '255'); #my $module_variation = get_conf_token ($module, 'module_variation', '100'); @@ -168,8 +170,7 @@ sub generate_xml_files ($$$$$$) { $xml_data .= "\t\t$module_name\n"; $xml_data .= "\t\t$module_description\n"; $xml_data .= "\t\t$module_type\n"; - - + $xml_data .= "\t\t\n"; # Generate data my $rnd_data = $module->{'module_data'};