2010-02-22 Pablo de la Concepción <pablo.concepcion@artica.es>

* 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.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2401 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
pabloconcepcion 2010-02-22 19:32:10 +00:00
parent 5f136b3033
commit beb85ab9f0
5 changed files with 265 additions and 12 deletions

View File

@ -1,4 +1,18 @@
2010-02-18 Sancho Lerena <slerena@artica.es>
2010-02-22 Pablo de la Concepción <pablo.concepcion@artica.es>
* 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 <slerena@artica.es>
* unix/Linux/pandora_agent.conf,
linux/pandora_agent.conf: Modified way to get loadaverage, taken from

View File

@ -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

View File

@ -1,3 +1,18 @@
2010-02-22 Pablo de la Concepción <pablo.concepcion@artica.es>
* 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 <pablo.concepcion@artica.es>
* Linux/pandora_agent.conf: Fixed Load Average module example
2010-02-16 Pablo de la Concepción <pablo.concepcion@artica.es>
Updated tentacle from the tentacle repository and generated

View File

@ -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

View File

@ -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<pandora home> >>
=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) {
"<agent_data description='" . $Conf{'description'} ."' group='" . $Conf{'group'} .
"' os_name='$OS' os_version='$OS_VERSION' interval='" . $Conf{'interval'} .
"' version='" . AGENT_VERSION . ($Conf{'autotime'} eq '1' ? '' : "' timestamp='" . strftime ('%Y/%m/%d %H:%M:%S', localtime ())) .
"' agent_name='" . $Conf{'agent_name'} . "' timezone_offset='". $Conf{'timezone_offset'}. "' longitude='" .$Conf{'longitude'} .
"' latitude='" .$Conf{'latitude'} ."' altitude='" .$Conf{'altitude'}."'>\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</etc/pandora> as B<home configuration directory>. There is the F<pandora_agent.conf> 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