Search
j0ke.net Open Build Service
>
Projects
>
server:monitoring
>
rancid-stable
> rancid-3.2.p2
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File rancid-3.2.p2 of Package rancid-stable
Index: lib/junos.pm.in =================================================================== --- lib/junos.pm.in (revision 3067) +++ lib/junos.pm.in (revision 3068) @@ -439,13 +439,18 @@ # licenses used changes constantly. distill it to a percentage. if (/^(\s+scale-subscriber)(\s+)(\d+)(\s+\d+)(.*$)/) { - my($a, $sp, $used, $avail, $rem) = ($1, $2, $3, $4, $'); + my($a, $sp, $used, $avail, $rem) = ($1, $2, $3, $4, $5); my($spl, $usedl) = (length($sp), length($used)); - my($pcnt) = int(($used + 0.0) / ($avail + 0.0) * 100); + my($pcnt); + if ($avail < 1) { + $pcnt = ">100"; + } else { + $pcnt = int(($used + 0.0) / ($avail + 0.0) * 100); + } my($pcntl) = length($pcnt) + 1; $spl = $spl + $usedl - $pcntl; - my($fmt) = "%s%-" . $spl . "s%d%%%s%s"; + my($fmt) = "%s%-" . $spl . "s%s%%%s%s\n"; $_ = sprintf($fmt, $a, "", $pcnt, $avail, $rem); } Index: CHANGES =================================================================== --- CHANGES (revision 3067) +++ CHANGES (revision 3068) @@ -1,4 +1,6 @@ 3.2.99 + junos.pm: fix showsystemlicense for errant licenses w/ 0 available + rancid.pm: check result from inet_pton() ciscowlc.pm: comment a few config lines that can not be imported