ASNMTAP

 view release on metacpan or  search on metacpan

INSTALL  view on Meta::CPAN

 

  Perfparse integration
  ---------------------

    download latest snapshot from http://wiki.perfparse.org/cvs_snapshots/
    bzip2 -d perfparse-06-mm-dd.tar.bz2
    tar -xvf perfparse-06-mm-dd.tar
    cd perfparse-all

    ./configure --prefix=/opt/asnmtap/perfparse --with-imagedir=/opt/asnmtap/applications/htmlroot/img/ --with-cgidir=/opt/asnmtap/applications/htmlroot/cgi-bin --with-http_image_path=/asnmtap/img --with-data-source=asnmtap
    make
    make install-strip


  SNMPTT integration 
  ------------------

    Install net-snmp 5.4.x

    ... TODO ... NO PART OF NORMAL SETUP ...

lib/ASNMTAP/Asnmtap/Applications.pod  view on Meta::CPAN

We use the 'Pipe to Perfparse' methode

=over 4

=item Compiling Perfparse

 wget http://belnet.dl.sourceforge.net/sourceforge/perfparse/perfparse-0.106.1.tar.gz
 cd /export/download/
 tar -xvzf perfparse-0.106.1.tar.gz
 cd /export/download/perfparse-0.106.1
 ./configure --prefix=/opt/asnmtap/perfparse --with-imagedir=/opt/asnmtap/applications/htmlroot/img/ --with-cgidir=/opt/asnmtap/applications/htmlroot/cgi-bin --with-http_image_path=/asnmtap/img --with-data-source=asnmtap --disable-phpui
 make
 make install-strip

=item Installing Perfparse database

 cd /export/download/perfparse-0.106.1/scripts
 cat mysql_create.sql | mysql -u root -p -D asnmtap

=item Configuration of Perfparse v19 for ASNMTAP

plugins/nagios/check_pargs.pl  view on Meta::CPAN


use ASNMTAP::Asnmtap::Plugins::Nagios v3.001.003;
use ASNMTAP::Asnmtap::Plugins::Nagios qw(:NAGIOS);

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

my $objectNagios = ASNMTAP::Asnmtap::Plugins::Nagios->new (
  _programName        => 'check_pargs.pl',
  _programDescription => 'pargs',
  _programVersion     => '3.001.003',
  _programUsagePrefix => '--filter <filter> [--uid <uid>] [--gid <gid>] [--fname <fname>] [-w|--warning <process #>] |[-c--critical <process #>]',
  _programHelpPrefix  => "
--uid=<uid>
--gid=<gid>
--fname=<fname>
-w, --warning=<process #>
-c, --critical=<process #>",
  _programGetOptions  => ['filter=s', 'uid:s', 'gid:s', 'fname:s', 'warning|w:s', 'critical|c:s'],
  _timeout            => 10,
  _debug              => 0);

my $filter    = $objectNagios->getOptionsArgv ('filter');
$objectNagios->printUsage ('Missing command line argument filter') unless ( defined $filter );

my $uid       = $objectNagios->getOptionsArgv ('uid');
my $gid       = $objectNagios->getOptionsArgv ('gid');
my $fname     = $objectNagios->getOptionsArgv ('fname');

my $warning   = $objectNagios->getOptionsArgv ('warning');
my $critical  = $objectNagios->getOptionsArgv ('critical');

my $osType    = $objectNagios->getOptionsValue ('osType');
my $debug     = $objectNagios->getOptionsValue ('debug');

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

plugins/nagios/check_pargs.pl  view on Meta::CPAN


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

my ($processCount, $returnCode) = (0);

use Proc::ProcessTable;
my $tProcessTable = new Proc::ProcessTable;

foreach my $process ( @{$tProcessTable->table} ) {
  next if ( defined $uid and $uid ne $process->uid );
  next if ( defined $gid and $gid ne $process->gid );
  next if ( defined $fname and $fname ne $process->fname );

  if ( $debug ) {
    print 'uid   : ', $process->uid, "\n";
    print 'gid   : ', $process->gid, "\n";
    print 'fname : ', $process->fname, "\n";

    print 'pid   : ', $process->pid, "\n";
    print 'ppid  : ', $process->ppid, "\n";
    print 'cmnd  : ', $process->cmndline, "\n";
    print 'state : ', $process->state, "\n"; # run, onprocessor, sleep, defunct, ...

    print 'pargs : /usr/bin/pfexec /usr/bin/pargs -a -l '. $process->pid, "\n";
  }



( run in 0.788 second using v1.01-cache-2.11-cpan-ceb78f64989 )