diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index 07c62ecd5d..de3239d897 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,4 +1,18 @@ -2010-02-18 Sancho Lerena +2010-02-22 Pablo de la Concepción + + * unix/Linux/pandora_agent.conf: Added parameters position_description + and parent_agent_name, and updated loadaverage with a more efficient + version. + + * unix/pandora_agent: Added POD documentation, modified to only add + to the XML the minimum parameters (positional parameters, + parent_agent_name,...) are not sent with default values if not + deffined in the config file. Updated verion and build. + + * man/man1/pandora_agent.1: ManPage generated from unix/pandora_agent + first version of the manpage. + +2010-02-17 Sancho Lerena * unix/Linux/pandora_agent.conf, linux/pandora_agent.conf: Modified way to get loadaverage, taken from diff --git a/pandora_agents/man/man1/pandora_agent.1 b/pandora_agents/man/man1/pandora_agent.1 new file mode 100644 index 0000000000..0d4a9cb528 --- /dev/null +++ b/pandora_agents/man/man1/pandora_agent.1 @@ -0,0 +1,160 @@ +.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "PANDORA_AGENT 1" +.TH PANDORA_AGENT 1 "2010-02-22" "perl v5.10.0" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +pandora_agent \- Pandora FMS Agent +.SH "VERSION" +.IX Header "VERSION" +Version 3.1 +.SH "USAGE" +.IX Header "USAGE" +\&\f(CW\*(C`pandora_agent \f(CIpandora home\f(CW\*(C'\fR +.SH "EXIT STATUS" +.IX Header "EXIT STATUS" +.IP "0 on Success" 4 +.IX Item "0 on Success" +.PD 0 +.IP "1 on Error" 4 +.IX Item "1 on Error" +.PD +.SH "CONFIGURATION" +.IX Header "CONFIGURATION" +By default pandora_agent uses \fI/etc/pandora\fR as \fBhome configuration directory\fR. There is the \fIpandora_agent.conf\fR file with all the configuration of the agent. +.SH "DEPENDENCIES" +.IX Header "DEPENDENCIES" +.SH "LICENSE" +.IX Header "LICENSE" +This is released under the \s-1GNU\s0 Lesser General Public License. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +.SH "COPYRIGHT" +.IX Header "COPYRIGHT" +Copyright (c) 2005\-2010 Artica Soluciones Tecnologicas S.L diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index 7b9dd2e645..adce9b6e19 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,18 @@ +2010-02-22 Pablo de la Concepción + + * Linux/pandora_agent.conf: Added parameters position_description + and parent_agent_name, and updated loadaverage with a more efficient + version. + + * pandora_agent: Added POD documentation, modified to only add + to the XML the minimum parameters (positional parameters, + parent_agent_name,...) are not sent with default values if not + deffined in the config file. Updated verion and build. + +2010-02-16 Pablo de la Concepción + + * Linux/pandora_agent.conf: Fixed Load Average module example + 2010-02-16 Pablo de la Concepción Updated tentacle from the tentacle repository and generated diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 82f02cbd25..6c0545ec90 100755 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -22,6 +22,9 @@ debug 0 # By default, agent takes machine name #agent_name adama +#Parent agent_name +#parent_agent_name parent_name + # Agent description #description Demo agent @@ -46,6 +49,9 @@ debug 0 # altitude #altitude 0 +#Position description +#position_description Madrid, centro + # By default agent try to take default encoding defined in host. # encoding iso-8859-15 @@ -116,7 +122,7 @@ module_end module_begin module_name Load Average module_type generic_data -module_exec cat /proc/loadavg |awk '{print $1}' +module_exec cat /proc/loadavg | cut -d' ' -f1 module_description Average process in CPU (Last minute) module_end diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index adeb40f485..664ea8fcf3 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -1,11 +1,26 @@ #!/usr/bin/perl # ********************************************************************** # Pandora FMS Generic Linux Agent -# (c) 2009 Artica Soluciones Tecnológicas +# (c) 2010 Artica Soluciones Tecnológicas # with the help of many people. Please see http://pandorafms.org # This code is licensed under GPL 2.0 license. # ********************************************************************** +=head1 NAME + +pandora_agent - Pandora FMS Agent + +=head1 VERSION + +Version 3.1 + +=head1 USAGE + +C<< pandora_agent F >> + +=cut + + use strict; use warnings; @@ -14,8 +29,8 @@ use Sys::Hostname; use File::Basename; use File::Copy; -use constant AGENT_VERSION => '3.0'; -use constant AGENT_BUILD => '091118'; +use constant AGENT_VERSION => '3.1'; +use constant AGENT_BUILD => '100222'; # OS and OS version my $OS = $^O; @@ -48,7 +63,7 @@ my %Conf = ( 'server_ssl' => 'no', 'server_opts' => '', 'delayed_startup' => 0, - 'pandora_nice' => 0, + 'pandora_nice' => 0, # FIXME: ¿DEPRECATED? 'cron_mode' => 0, 'remote_config' => 0, 'secondary_mode' => 'never', @@ -60,10 +75,7 @@ my %Conf = ( 'secondary_server_ssl' => 'no', 'secondary_server_opts' => '', 'autotime' => 0, - 'timezone_offset' => 0, - 'latitude' => 0, - 'longitude' => 0, - 'altitude' => 0 + 'timezone_offset' => 0 # Missing: group, ); @@ -540,8 +552,21 @@ while (1) { "\n"; + "' agent_name='" . $Conf{'agent_name'} . "' timezone_offset='". $Conf{'timezone_offset'}; + + if (defined ($Conf{'parent_agent_name'})) { + $xml .= "' parent_agent_name='" .$Conf{'parent_agent_name'}; + } + if (defined ($Conf{'longitude'}) && defined ($Conf{'latitude'})) { + $xml .= "' longitude='" .$Conf{'longitude'} . "' latitude='" .$Conf{'latitude'}; + if (defined ($Conf{'altitude'})) { + $xml .= "' altitude='" .$Conf{'altitude'}; + } + if (defined ($Conf{'position_description'})) { + $xml .= "' position_description='" .$Conf{'position_description'}; + } + } + $xml .= "'>\n"; # Execute modules foreach my $module (@Modules) { @@ -615,3 +640,36 @@ while (1) { # Go to sleep sleep ($Conf{'interval'}); } + + +__END__ + +=head1 EXIT STATUS + +=over + +=item 0 on Success + +=item 1 on Error + +=back + +=head1 CONFIGURATION + +By default pandora_agent uses F as B. There is the F file with all the configuration of the agent. + +=head1 DEPENDENCIES + + +=head1 LICENSE + +This is released under the GNU Lesser General Public License. + +=head1 SEE ALSO + + +=head1 COPYRIGHT + +Copyright (c) 2005-2010 Artica Soluciones Tecnologicas S.L + +=cut