Discussion:
[rancid] ProcessHistory filter
Smirnoff Alexander
2009-07-22 07:28:46 UTC
Permalink
Hello all RANCID people!



I try to filter interface counters from output of Zyxel Prestige 791R ip route status :

- !IP ROUTE: defaultšššššššš 01 0šš mpoa01šššš 172.17.100.1ššššš 2ššš 00ab 0ššššš 409683

+ !IP ROUTE: defaultšššššššš 01 0šš mpoa01šššš 172.17.100.1ššššš 2ššš 00ab 0ššššš 412140



šusing these definitions:



if (/^(default)/)

ššššššš { ProcessHistory("","","","!IP ROUTE: default $1 $2$3 mpoa01šššš $5$6<___>\n") && next;ššš }



but šsomething wrong - i receive this:



!IP ROUTE: default defaultš mpoa01šššš <___>



How I can correctly setup this filter?
--
Regards,
Alexandr Smirnov
+7(812)3468600 # 54682
Head of Data Transmission Networks Monitoring Service mailto:***@office.beeline.ru <mailto:***@office.beeline.ru>
Smirnoff Alexander
2009-07-22 13:16:30 UTC
Permalink
And I have some other question about ProcessHistory - I make sub for parsing šcommands, and in output I see for every first line this:



!HOSTNAME: 777777777777Prestige_
!AUTOEXEC.NET: 777777777777777777777sys errctl 0
!AUTOEXEC.NET: sys trcl level 5
!AUTOEXEC.NET: sys trcl type 1180
!AUTOEXEC.NET: sys trcp cr 64 96
!AUTOEXEC.NET: sys trcl sw off
!AUTOEXEC.NET: sys trcp sw off
!AUTOEXEC.NET: ip tcp mss 512
!AUTOEXEC.NET: ip tcp limit 2
!AUTOEXEC.NET: ip tcp irtt 65000
!AUTOEXEC.NET: ip tcp window 2
!AUTOEXEC.NET: ip tcp ceiling 6000
!AUTOEXEC.NET: ip rip activate
!AUTOEXEC.NET: ip rip merge on
!AUTOEXEC.NET: ip icmp discovery enif0 off
!AUTOEXEC.NET: ppp ipcp compress off
!AUTOEXEC.NET: sys wdog sw on
!AUTOEXEC.NET: sys quick enable
!SYS FEATURE: 77777777777IPX: yes
!SYS FEATURE: IP ONLY: no
!SYS FEATURE: AUI: no
!SYS FEATURE: AB ADAPTER: no



e.g. I am ask about 777777777 symbols.



And this is my sub:



# is routine processes a "sys view autoexec.net"

sub ShowAutoexec {

ššš print STDERR "ššš In ShowAutoexec: $_" if ($debug);

ššš while (<INPUT>) {

ššš

ššššššš if (/^$prompt/) { $found_env=1; last};



ššššššššššššššš if (/>/) {

ššššššššššššššš $found_end = 1;

ššššššššššššššš ProcessHistory("","","","!AUTOEXEC.NET: $_");

ššššššššššššššš return(1);

ššššššššššššššš }

šššššššššššššššš $found_end = 1;

ššš

ššššššš ProcessHistory("","","","!AUTOEXEC.NET: $_");

ššš }šš

ššš return(0);

}šššššš



May be somebody know about this problem?



________________________________

From: rancid-discuss-***@shrubbery.net [mailto:rancid-discuss-***@shrubbery.net] On Behalf Of Smirnoff Alexander
Sent: Wednesday, July 22, 2009 11:29 AM
To: rancid-***@shrubbery.net
Subject: [rancid] ProcessHistory filter



Hello all RANCID people!



I try to filter interface counters from output of Zyxel Prestige 791R ip route status :

- !IP ROUTE: default 01 0 mpoa01 172.17.100.1 2 00ab 0 409683

+ !IP ROUTE: default 01 0 mpoa01 172.17.100.1 2 00ab 0 412140



using these definitions:



if (/^(default)/)

{ ProcessHistory("","","","!IP ROUTE: default $1 $2$3 mpoa01 $5$6<___>\n") && next; }



but something wrong - i receive this:



!IP ROUTE: default default mpoa01 <___>



How I can correctly setup this filter?
--
Regards,
Alexandr Smirnov
+7(812)3468600 # 54682
Head of Data Transmission Networks Monitoring Service mailto:***@office.beeline.ru <mailto:***@office.beeline.ru>
Smirnoff Alexander
2009-07-23 14:19:12 UTC
Permalink
Hello!



Now I find some information about these symbols, but until can't
correctly work with them. For example zyxP791Rlogin must send command,
and wait for prompt before send next command - and this feature work in
one case and not word for another. I can't understand why. May be some
of RANCID scripts already solve this problem with scroll-like terminals
and scrolling symbols?





________________________________

From: rancid-discuss-***@shrubbery.net
[mailto:rancid-discuss-***@shrubbery.net] On Behalf Of Smirnoff
Alexander
Sent: Wednesday, July 22, 2009 5:17 PM
To: rancid-***@shrubbery.net
Subject: [rancid] Re: ProcessHistory filter



And I have some other question about ProcessHistory - I make sub for
parsing commands, and in output I see for every first line this:



!HOSTNAME: 777777777777Prestige_
!AUTOEXEC.NET: 777777777777777777777sys errctl 0
!AUTOEXEC.NET: sys trcl level 5
!AUTOEXEC.NET: sys trcl type 1180
!AUTOEXEC.NET: sys trcp cr 64 96
!AUTOEXEC.NET: sys trcl sw off
!AUTOEXEC.NET: sys trcp sw off
!AUTOEXEC.NET: ip tcp mss 512
!AUTOEXEC.NET: ip tcp limit 2
!AUTOEXEC.NET: ip tcp irtt 65000
!AUTOEXEC.NET: ip tcp window 2
!AUTOEXEC.NET: ip tcp ceiling 6000
!AUTOEXEC.NET: ip rip activate
!AUTOEXEC.NET: ip rip merge on
!AUTOEXEC.NET: ip icmp discovery enif0 off
!AUTOEXEC.NET: ppp ipcp compress off
!AUTOEXEC.NET: sys wdog sw on
!AUTOEXEC.NET: sys quick enable
!SYS FEATURE: 77777777777IPX: yes
!SYS FEATURE: IP ONLY: no
!SYS FEATURE: AUI: no
!SYS FEATURE: AB ADAPTER: no



e.g. I am ask about 777777777 symbols.



And this is my sub:



# is routine processes a "sys view autoexec.net"

sub ShowAutoexec {

print STDERR " In ShowAutoexec: $_" if ($debug);

while (<INPUT>) {



if (/^$prompt/) { $found_env=1; last};



if (/>/) {

$found_end = 1;

ProcessHistory("","","","!AUTOEXEC.NET: $_");

return(1);

}

$found_end = 1;



ProcessHistory("","","","!AUTOEXEC.NET: $_");

}

return(0);

}



May be somebody know about this problem?



________________________________

From: rancid-discuss-***@shrubbery.net
[mailto:rancid-discuss-***@shrubbery.net] On Behalf Of Smirnoff
Alexander
Sent: Wednesday, July 22, 2009 11:29 AM
To: rancid-***@shrubbery.net
Subject: [rancid] ProcessHistory filter



Hello all RANCID people!



I try to filter interface counters from output of Zyxel Prestige 791R ip
route status :

- !IP ROUTE: default 01 0 mpoa01 172.17.100.1 2
00ab 0 409683

+ !IP ROUTE: default 01 0 mpoa01 172.17.100.1 2
00ab 0 412140



using these definitions:



if (/^(default)/)

{ ProcessHistory("","","","!IP ROUTE: default $1 $2$3 mpoa01
$5$6<___>\n") && next; }



but something wrong - i receive this:



!IP ROUTE: default default mpoa01 <___>



How I can correctly setup this filter?
--
Regards,
Alexandr Smirnov
+7(812)3468600 # 54682
Head of Data Transmission Networks Monitoring Service
mailto:***@office.beeline.ru <mailto:***@office.beeline.ru>
john heasley
2009-07-23 17:50:25 UTC
Permalink
Post by Smirnoff Alexander
Hello!
Now I find some information about these symbols, but until can't
correctly work with them. For example zyxP791Rlogin must send command,
and wait for prompt before send next command - and this feature work in
one case and not word for another. I can't understand why. May be some
of RANCID scripts already solve this problem with scroll-like terminals
and scrolling symbols?
there are a bunch of vt/screen manipulation code in the o/p. this is
probably the issue that you're facing because it makes a mess for
regex matches/etc.

you can try setting the terminal type to something that doesnt support
it (like agmrancid), which might cause the device to stop sending this
junk or try hlogin (or adapt it) to filter it out.
Post by Smirnoff Alexander
________________________________
Alexander
Sent: Wednesday, July 22, 2009 5:17 PM
Subject: [rancid] Re: ProcessHistory filter
And I have some other question about ProcessHistory - I make sub for
!HOSTNAME: 777777777777Prestige_
!AUTOEXEC.NET: 777777777777777777777sys errctl 0
!AUTOEXEC.NET: sys trcl level 5
!AUTOEXEC.NET: sys trcl type 1180
!AUTOEXEC.NET: sys trcp cr 64 96
!AUTOEXEC.NET: sys trcl sw off
!AUTOEXEC.NET: sys trcp sw off
!AUTOEXEC.NET: ip tcp mss 512
!AUTOEXEC.NET: ip tcp limit 2
!AUTOEXEC.NET: ip tcp irtt 65000
!AUTOEXEC.NET: ip tcp window 2
!AUTOEXEC.NET: ip tcp ceiling 6000
!AUTOEXEC.NET: ip rip activate
!AUTOEXEC.NET: ip rip merge on
!AUTOEXEC.NET: ip icmp discovery enif0 off
!AUTOEXEC.NET: ppp ipcp compress off
!AUTOEXEC.NET: sys wdog sw on
!AUTOEXEC.NET: sys quick enable
!SYS FEATURE: 77777777777IPX: yes
!SYS FEATURE: IP ONLY: no
!SYS FEATURE: AUI: no
!SYS FEATURE: AB ADAPTER: no
e.g. I am ask about 777777777 symbols.
# is routine processes a "sys view autoexec.net"
sub ShowAutoexec {
print STDERR " In ShowAutoexec: $_" if ($debug);
while (<INPUT>) {
if (/^$prompt/) { $found_env=1; last};
if (/>/) {
$found_end = 1;
ProcessHistory("","","","!AUTOEXEC.NET: $_");
return(1);
}
$found_end = 1;
ProcessHistory("","","","!AUTOEXEC.NET: $_");
}
return(0);
}
May be somebody know about this problem?
________________________________
Alexander
Sent: Wednesday, July 22, 2009 11:29 AM
Subject: [rancid] ProcessHistory filter
Hello all RANCID people!
- !IP ROUTE: default 01 0 mpoa01 172.17.100.1 2
00ab 0 409683
+ !IP ROUTE: default 01 0 mpoa01 172.17.100.1 2
00ab 0 412140
if (/^(default)/)
{ ProcessHistory("","","","!IP ROUTE: default $1 $2$3 mpoa01
$5$6<___>\n") && next; }
!IP ROUTE: default default mpoa01 <___>
How I can correctly setup this filter?
--
Regards,
Alexandr Smirnov
+7(812)3468600 # 54682
Head of Data Transmission Networks Monitoring Service
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
Loading...