[rancid] Dell Powerconnect (smc)

C Bagsale c.bagsale at gmail.com
Tue Aug 11 01:57:20 UTC 2020


Hi,

Need help in ignoring 'temperature and uptime' for this switch, but couldnt
figure it out, found this page (
https://www.bityard.org/blog/2015/10/01/dell_powerconnect_m-series_rancid)
but it doesnt work.

Below is my srancid file (sh system portion), can anyone assist on how to
ignore those 2 commands.































































































*sub ShowSys {    print STDERR "    In ShowSys: $_" if ($debug);    $_ =~
s/^[^#]*//;    ProcessHistory("COMMENTS","keysort","C1","!\n! $_");
while (<INPUT>) {        s/^\s+\015//g;        tr/\015//d;        next if
/^\s*$/;        last if(/$prompt/);        # pager remnants like: ^H^H^H
 ^H^H^H content        s/[\b]+\s*[\b]*//g;        # Remove Uptime        /
up time/i && next;        # filter temperature sensor info for Dell 6428
stacks, Powerconnect 7048        # /Temperature Sensors:/        if
(/Temperature \(Celsius\)/) {
ProcessHistory("COMMENTS","keysort","C1","! $_");
ProcessHistory("COMMENTS","keysort","C1","! Unit\tStatus\n");
ProcessHistory("COMMENTS","keysort","C1","! ----\t------\n");
while (<INPUT>) {                s/^\s+\015//g;                tr/\015//d;
              goto ENDSHOWSYS if(/$prompt/);
/(\d+)\s+\d+\s+(.*)$/ &&
ProcessHistory("COMMENTS","keysort","C1","! $1\t$2\n");
/^\s*$/ && last;            }        } elsif (/Temperature/) {            #
Filter temperature sensor info for Dell M6348 and M8024 blade            #
switches.            #            # M6348 and M8024 sample lines:
  #   Unit     Description       Temperature    Status            #
                      (Celsius)            #   ----     -----------
-----------    ------            #   1        System            39
    Good            #   2        System            39             Good
      ProcessHistory("COMMENTS","keysort","C1",
 "! Unit\tDescription\tStatus\n");
ProcessHistory("COMMENTS","keysort","C1",                           "!
----\t-----------\t------\n");            while (<INPUT>) {
/\(celsius\)/i && next;                s/^\s+\015//g;
tr/\015//d;                goto ENDSHOWSYS if(/$prompt/);
/(\d+)\s+(\w+)\s+\d+\s+(.*)$/ &&
ProcessHistory("COMMENTS","keysort","C1","! $1\t$2\t\t$3\n");
  /^\s*$/ && last;            }        }        # filter power rates and
tmestamps from 7024 power supply info        # Power Supplies:        #
      # Unit  Description    Status     Average     Current          Since
      #                                  Power       Power
Date/Time        #                                 (Watts)     (Watts)
  # ----  -----------  -----------  ----------  --------
 -------------------        # 1     System       OK            1.4
 65.2        # 1     Internal     OK           N/A         N/A
10/05/2017 20:18:35        if (/power supplies/i) {
ProcessHistory("COMMENTS","keysort","C1", "!\n");
ProcessHistory("COMMENTS","keysort","C1",                "!
Unit\tDescription\tStatus\n");
ProcessHistory("COMMENTS","keysort","C1",                "!
----\t-----------\t------\n");            while (<INPUT>) {
s/^\s+\015//g;                tr/\015//d;                goto ENDSHOWSYS
if(/$prompt/);                /^(unit\s|--+\s|\s)/i && next;
if (/(\d+)\s+(\w+)\s+(\w+(\s\w+)?)\s/) {                    if (length($2)
>= 8) {                        ProcessHistory("COMMENTS","keysort","C1","!
$1\t$2\t$3\n");                    } else {
ProcessHistory("COMMENTS","keysort","C1","! $1\t$2\t\t$3\n");
      }                }                /^\s*$/ && last;            }
  }        /system description: (.*)/i &&
ProcessHistory("COMMENTS","keysort","A1", "!Chassis type: $1\n") &&
    next;        ProcessHistory("COMMENTS","keysort","C1","! $_");
}ENDSHOWSYS:    return(0);}*

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20200811/ec0d28a2/attachment.htm>


More information about the Rancid-discuss mailing list