Bug 111566 - Net-SNMP 5.0.9 breaks linksysmon 1.1.2
Net-SNMP 5.0.9 breaks linksysmon 1.1.2
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: net-snmp (Show other bugs)
9
i686 Linux
medium Severity high
: ---
: ---
Assigned To: Phil Knirsch
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-12-05 09:59 EST by Mike Vanecek
Modified: 2015-03-04 20:13 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-12-10 09:56:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike Vanecek 2003-12-05 09:59:04 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031016

Description of problem:
linksysmon 1.1.2 worked with net-snmp-5.0.6 but fails with
net-snmp-5.0.9. 

linksysmon starts snmptrapd with the following perl call:

my $snmptrapd = $linksysmon->TrapdPath().' -C -P -F "%A
%y-%02.2m-%02.2l %02.2h:%02.2j:%02.2k %v\n" 2>&1 1>/dev/null';

It then monitors incoming log packets from a linksys router looking
for a match:

# Match on activity log line
       
     
/^(\S+)\s+([0-9]{4}-[0-9]{2}-[0-9]{2})\s+([0-9]{2}:[0-9]{2}:[0-9]{2})\s+(?:\S+::)?enterprises\.[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\s+=\s+(?:\S+:\s+)?"@(in|out)\s+(\S+)\s+([0-9]+)\s+(\S+)\s+([0-9]+)\."$/
&& do {
           
          if ($3 eq $lasttime) {
              $secondsindex++;
          }
          else {
              $secondsindex = 0;
          }
           
          &log ("$1$d$2$d${3}\-$secondsindex$d$4$d$5$d$6$d$7$d$8\n");
 
          my $host = $1;
          my $date = $2;
          my $time = $3;
          ....

After the update, the match function never detects the linksys packet.

Theory, the -P option is inserting carriage returns in 5.0.9 which it
did not in 5.0.6?


Version-Release number of selected component (if applicable):
net-snmp-5.0.9-2.90.1

How reproducible:
Always

Steps to Reproduce:
1.Install 5.0.9
2.start linksysmon which uses snmptrapd
3.
    

Actual Results:  Linksysmon detects the failure of a match and puts

Parse error: >192.168.1.1 2003-12-03 19:52:45  
SNMPv2-SMI::enterprises.3955.1.1.0 = Hex-STRING: 40 69 6E 20 36 33 2E
31 34 38 2E 39 39 2E 32 35<
Parse error: >33 20 35 36 34 33 34 20 31 39 32 2E 31 36 38 2E<
Parse error: >31 2E 39 35 20 38 30 0A <

in the log.

Expected Results:  Before the update, linksysmon made log entries such as:

192.168.1.1     2003-12-01      01:52:29-1      out     192.168.1.95 
  25      postfix.org     2711


Additional info:

Author of linksys has been emailed, questions posted on shrike and
redhat lists, and google searched.
Comment 1 Mike Vanecek 2003-12-07 10:26:44 EST
Thanks to Sean Dodd, who found that adding -Oa to the 

my $snmptrapd = $linksysmon->TrapdPath().' -C -P -F "%A
%y-%02.2m-%02.2l %02.2h:%02.2j:%02.2k %v\n" 2>&1 1>/dev/null';

call

my $snmptrapd = $linksysmon->TrapdPath().' -C -P -Oa -F "%A
%y-%02.2m-%02.2l %02.2h:%02.2j:%02.2k %v\n" 2>&1 1>/dev/null';

causes 5.0.9 to output data in the format expected by linksysmon. This
option was not needed with version 5.0.6.


Comment 2 Phil Knirsch 2003-12-10 09:56:51 EST
Yeah, the options might have changed a little between 5.0.6 and 5.0.9
and 5.1.

I'll close this bug as it's something that linksysmon needs to take
care of in the end, supporting the same options for net-snmp is not
really possible in the long run.

Thanks,

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.