I'm trying to get a pass_persist based extension working with my 
Net-SNMP install.

I have the handler registered in snmpd.conf:

pass_persist  .1.3.6.1.4.1.9999 /usr/local/bin/test.pl

After the PING/PONG response, the code seems to get an EOF and the input 
reception loop terminates:

    my %ACTION_DISPATCH = (
        PING    => \&Ping,
        GET     => \&Get_Input,
        GETNEXT => \&Get_Input,
        SET     => \&Set_Input,
    );

    while( my $line = <> ) {

        LOG_MSG defined $line ? "'$line'" : 'Input line undefined.';

        chomp $line;

        if( exists $ACTION_DISPATCH{$line} ) {
            $ACTION_DISPATCH{$line}($line);
        }
    }

    if( $! ) {
        LOG_MSG "OS Error: $!";
    }

    LOG_MSG "Loop finished, exiting";


What I see in my log file is:
Mon Jul  6 14:18:48 2009 : Pinged
Mon Jul  6 14:18:48 2009 : Loop finished, exiting

For those on the list who are not conversant with Perl, the $line = <> 
reads a line of data from STDIN.  The loop will terminate when an EOF 
character is received.

I am running Net-SNMP version 5.4.1 on an Ubuntu 8.10 system.  Perl is 
version 5.8.8.

I'd appreciate any suggestions for which part of TFM to R to clear this 
up, troubleshooting suggestions or or other ideas.  If I need to provide 
additional details to get this sorted, please let me know and I'll 
provide them.

Thanks,

--Mark Swayne


 

------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to