You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added some Cisco MDS devices running NX-OS and noticed when it runs "show environment fan" it dumps the current fan (or fans) speed, causing a diff on every run.
After some testing I've added the below to sub ShowEnv, and although it isn't as neat as the process in ShowEnvTemp it seems to work.
if (/(fan speed)/i) {
ProcessHistory("COMMENTS","","","!Env: $_");
while (<$INPUT>) {
tr/\015//d;
goto EndShowEnv if (/^$prompt/);
if (/(^ChassisFan)(.*)(\d\d\d\d\s\s[-]\s\s\d\d\d\d)/) {
$_ = sprintf("%s%-". length($2)."s%s\n", $1, $2, "");
}
ProcessHistory("COMMENTS","","","!Env: $_");
last if (/^\s*$/);
}
next;
}
Perhaps someone who is more skilled than me could take this and do it more cleanly? ShowEnvTemp removes the unused column text (CurTemp), although I'm not sure how.
The text was updated successfully, but these errors were encountered:
Cisco# show env fan
Fan:
-----------------------------------------------------------------------------------------------------------------
Fan Model Hw Status Airflow direction Fan Speed[Fan0-Fan1] (rpm)
-----------------------------------------------------------------------------------------------------------------
ChassisFan1 FAN Module 1 -- Ok Back to Front 7077 - 5268
ChassisFan2 FAN Module 2 -- Ok Back to Front 7133 - 5351
ChassisFan3 FAN Module 3 -- Ok Back to Front 7142 - 5335
ChassisFan4 FAN Module 4 -- Ok Back to Front 7124 - 5278
Fan_in_PS1 -- -- Ok Back to Front --
Fan_in_PS2 -- -- Ok Back to Front --
Fan Air Filter : NotSupported
I added some Cisco MDS devices running NX-OS and noticed when it runs "show environment fan" it dumps the current fan (or fans) speed, causing a diff on every run.
After some testing I've added the below to sub ShowEnv, and although it isn't as neat as the process in ShowEnvTemp it seems to work.
Perhaps someone who is more skilled than me could take this and do it more cleanly? ShowEnvTemp removes the unused column text (CurTemp), although I'm not sure how.
The text was updated successfully, but these errors were encountered: