Bug 111566 - Net-SNMP 5.0.9 breaks linksysmon 1.1.2
Summary: Net-SNMP 5.0.9 breaks linksysmon 1.1.2
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: net-snmp
Version: 9
Hardware: i686
OS: Linux
medium
high
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-12-05 14:59 UTC by Mike Vanecek
Modified: 2015-03-05 01:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-12-10 14:56:51 UTC
Embargoed:


Attachments (Terms of Use)

Description Mike Vanecek 2003-12-05 14:59:04 UTC
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 15:26:44 UTC
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 14:56:51 UTC
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.