GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Proc::ProcessTable::Match(3) User Contributed Perl Documentation Proc::ProcessTable::Match(3)

Proc::ProcessTable::Match - Matches a Proc::ProcessTable::Process against a stack of checks.

Version 0.0.1

    use Proc::ProcessTable::Match;
    use Proc::ProcessTable;
    use Data::Dumper;
    
    # looks for a kernel proc with the PID of 0
    my %args=(
              checks=>[
                       {
                        type=>'PID',
                        invert=>0,
                        args=>{
                               pids=>['0'],
                               }
                       },{
                        type=>'KernProc',
                        invert=>0,
                        args=>{
                               }
                      }
                      ]
                     );
    
    # hits on every proc but the idle proc
    %args=(
              checks=>[
                       {
                        type=>'Idle',
                        invert=>1,
                        args=>{
                               }
                       }
                      ]
                     );
    
    my $ppm;
    eval{
        $ppm=Proc::ProcessTable::Match->new( \%args );
    } or die "New failed with...".$@;
    
    my $pt = Proc::ProcessTable->new;
    foreach my $proc ( @{$t->table} ){
        if ( $ppm->match( $proc ) ){
            print Dumper( $proc );
        }
    }

This ininitates the object.

One argument is taken and it is a hashref with the key "checks". That value needs to contains a array of hashs of checks to run.

checks hash

Every check must hit for it to beconsidered a match.

Each of these should always be defined.

type

This is the module to use to use to run the check.

The name is relative 'Proc::ProcessTable::Match::', so 'PID' becomes 'Proc::ProcessTable::Match::PID'.

invert

This inverts inverts the returned value from the check.

args

This is a hash that will be pashed to the checker module's new method.

For any required keys, check the documents for that checker.

If it does not take any arguments, just pass a blank hash.

    my %args=(
              checks=>[
                       {
                        type=>'PID',
                        invert=>0,
                        args=>{
                               pids=>['0'],
                               }
                       },{
                        type=>'KernProc',
                        invert=>0,
                        args=>{
                               }
                       }
                      ]
                     );
    
    my $ppm;
    eval{
        $ppm=Proc::ProcessTable::Match->new( \%args );
    } or die "New failed with...".$@;

Checks if a single Proc::ProcessTable::Process object matches the stack.

One object is argument is taken and that is the Net::Connection to check.

The return value is a boolean.

    if ( $ppm->match( $conn ) ){
        print "It matched.\n";
    }

Zane C. Bowers-Hadley, "<vvelox at vvelox.net>"

Please report any bugs or feature requests to "bug-proc-processtable-match at rt.cpan.org", or through the web interface at <https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Proc-ProcessTable-Match>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.

    perldoc Proc::ProcessTable::Match

You can also look for information at:

  • RT: CPAN's request tracker (report bugs here)

    <https://rt.cpan.org/NoAuth/Bugs.html?Dist=Proc-ProcessTable-Match>

  • AnnoCPAN: Annotated CPAN documentation

    <http://annocpan.org/dist/Proc-ProcessTable-Match>

  • CPAN Ratings

    <https://cpanratings.perl.org/d/Proc-ProcessTable-Match>

  • Search CPAN

    <https://metacpan.org/release/Proc-ProcessTable-Match>

  • Repository

    <https://gitea.eesdp.org/vvelox/Proc-ProcessTable-Match>

This software is Copyright (c) 2019 by Zane C. Bowers-Hadley.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
2019-08-27 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.