Cisco MRTG temperature graphing with the 7200 router

In a way, this post is a sequel to the previous MRTG tutorial I wrote. Then again, it’s slightly more specific towards the Cisco 7200 series router, so it wouldn’t be as applicable to everyone. If you are interested in graphing Cisco MRTG temperature though, read on.

Once again the disclaimer follows – I’m using Debian distribution 2.4.18-bf2.4.


#1 Knowing what’s good and what’s not

It’s not very useful to know the temperature if you don’t know what you’re looking out for.

Ambient operating temperature: Cisco advises a minimum of 32°F (0°C) and maximum of 104°F (40°C). 40 degrees Celsius doesn’t sound like it’s enough to cook the router though.

If we check the table displayed in our router’s CLI by going into exec mode:

Router#show environment table

We get:

Sample Point LowCritical LowWarning HighWarning HighCritical
I/O Cont Inlet 40C/104F 50C/122F
I/O Cont Outlet 43C/109F 53C/127F
NPE Inlet 75C/167F 75C/167F
NPE Outlet 50C/122F 60C/140F

Seems to be a wee bit higher than what the website said? Oh well, I guess it’s a good thing.


#2 Checking your router’s temperature the quick and easy way

Login to your router (telnet, console whatever) and go into exec mode.

Router#show environment all

I believe the display differs according to the NPE (Network Processing Engine) you’ve got, but this is what mine says.

Power Supplies:

Power Supply 1 is Zytek AC Power Supply. Unit is on.
Power Supply 2 is Zytek AC Power Supply. Unit is on.

Temperature readings:

I/O Cont Inlet measured at 25C/77F
I/O Cont Outlet measured at 27C/80F
NPE Inlet measured at 28C/82F
NPE Outlet measured at 29C/84F

Voltage readings:

+3.45 V measured at +3.50 V
+5.15 V measured at +5.25 V
+12.15 V measured at +12.39 V
-11.95 V measured at -11.85 V

Envm stats saved 94 time(s) since reload

The bolded section’s what we want, period.


#3 Using MRTG to plot your router’s temperature

Takes a bit more effort, but at least you’ve got some historical data to rely on for comparison. Plus, you don’t have to keep logging into your router to check!

We can’t use cfgmaker this time round as it takes a bit of typing to get things done.
Here’s a sample .cfg template of what I used:

Target[router.temp]:1.3.6.1.4.1.9.9.13.1.3.1.3.1&1.3.6.1.4.1.9.9.13.1.3.1.3.2:CommunityName@RouterIP
Directory[router.temp]: temperature
WithPeak[router.temp]: wmy
YLegend[router.temp]: Degrees C
ShortLegend[router.temp]: °C
MaxBytes[router.temp]: 50
Options[router.temp]: nopercent, growright, gauge
Unscaled[router.temp]: dwmy
AbsMax[router.temp]: 50
Title[router.temp]: Router
Colours[router.temp]: GREEN#00eb0c,BLUE#1000ff,BLUE#1000ff,VIOLET#ff00ff
Legend1[router.temp]: Average 1 minute Inlet Temperature
Legend2[router.temp]: Average 1 minute Outlet Temperature
Legend3[router.temp]: Average 5 minute Inlet Temperature
Legend4[router.temp]: Average 5 minute Outlet Temperature
LegendI[router.temp]:  Inlet:
LegendO[router.temp]:  Outlet:
PageTop[router.temp]: <H1> Router temperature - Degrees C<BR></H1>
<TABLE>
<TR><TD>System:</TD><TD>Router</TD></TR>
<TR><TD>Maintainer:</TD><TD>Admin</TD></TR>
</TABLE>

There’s actually four points of temperature measurement for the 7200, but since we only need two for the MRTG, I used the inlet temperature and one of the outlets, which makes more sense than checking the temperature of two outlets.

OIDs for the four points are as follow:


Inlet .1.3.6.1.4.1.9.9.13.1.3.1.3.1
Outlet 1 .1.3.6.1.4.1.9.9.13.1.3.1.3.2
Outlet 2 .1.3.6.1.4.1.9.9.13.1.3.1.3.3
Outlet 3 .1.3.6.1.4.1.9.9.13.1.3.1.3.4

Follow up with the usual steps to creating the index and populating the cron job (refer to my previous MRTG article), and we should be done.


Credits for the solution goes to a whole ton of Googled results, and I sort of lost track along the way after reading numerous websites. One of the major help sites is the MRTG mailing list, and the people there are seriously good.

I hope this post helps some other poor soul out there who’s trying to do the same thing, and here’s to you saving two hours of research on doing up a Cisco MRTG temperature graph for your router.

Cisco IOS: password recovery notes

I’m pretty sure any CCNA worth his salt has this procedure down pat, but here’s a summary with things to remember if you’re too lazy to plow through Cisco.

1. Reboot the router, have your console terminal all connected and ready.

2. Send break signal to the router before the POST – on Teraterm this means Alt-B or click on Control then Send break

3. Alter the configuration register value to ignore NVRAM contents.

confreg 0x2142

4. Reboot the router again, so that you can boot into the router without a need for password.

5. Don’t get this command wrong after you enter privilege exec:

copy start run

Doing the reverse means a dump of an empty config onto your router. We are trying to edit the startup configuration, not overwrite the startup with the running (which is empty!).

6. Change the console and secret, change the configuration register back to default value.

config terminal

line con 0

password NEWPASSWORD

exit

enable secret NEWSECRET

configuration-register 0x2102

end

Don’t forget to write your new passwords down.

7. Save the configuration.

copy run start

8. Reboot the router, and enjoy.

Tech: Polarcloud’s Tomato firmware for Linksys WRT54G router

This post is to written to remind myself and all the people out there of this – use a Linksys WRT54G series router only after applying third-party firmware on it.


Here’s what the router looks like, incase you have no idea you actually own one.
(img via spreadfon.org)

Why?

Quoted from Wikibooks:

Tomato is free open source Linux-based firmware for several Broadcom-based Wi-Fi routers, including the Linksys WRT54G. The major emphasis of Tomato is on stability, speed and efficiency..

Tomato is notable for its web-based user interface that includes several types of bandwidth usage charts, advanced QoS access restriction features , raised connection limits which enables P2P networking..

My own review: Performance skyrockets, and stability is greatly increased. Not to mention the whole bunch of nifty features that appear in the new GUI – scheduler, execution of custom scripts, traffic graphs and even skinning of the GUI via CSS, woohoo.

Story:

I signed up for Unwired recently, and had this persistent problem with my connection (cannot open bloody Google and Yahoo! Mail WTF) and kept thinking it was due to the bloody wireless WAN factor, reception being crappy and all that.

Seriously, I was on the verge of hurling the wireless modem out the window; the only things that stopped me:

  • the fact that I couldn’t get my window open wide enough to do that; the window opens to a maximum of probably 15 degrees and not much more.
  • throwing the modem out through closed window = broken window. Broken window = cold nights + big repair bill = stupid idea.

It was a last-ditch attempt to salvage the situation that resulted in upgrading the firmware, and the process was pretty straightforward.

  • RTFM mode: Read the fcuking FAQ
  • Download the firmware at Polarcloud, and unzip the file.
  • Check if your WRT54G series router (that includes WRT54G/GL/GS) to see if the firmware applies to your model. Important: choose the right firmware that applies to your model!
  • Stop all internet activities – prevent any possible disruptions to the upgrade process.
  • Login to your router’s GUI (default http://192.168.1.1 – admin/admin) and Administration – select the right firmware, and upgrade the damn firmware!
  • Cross your fingers and hope everything goes well.
  • Voila – new firmware, new GUI, bloody good router!

Cisco IOS: scheduled task options – kron and Kiwi CatTools

There was a need to run a command at midnight on the first of every month on the 7200 router, so I began researching on ways and means to accomplish it.

Option #1: kron
Many of us have probably heard of cron from the Linux/Unix operating system, and kron is Cisco’s IOS CLI (command-line interface) version of it. Basically you define a policy-list, which contains the commands that you want to run.

Router(config)# kron policy-list displayCONFIG
Router(config-kron-policy)# show run
Router(config-kron-policy)# exit

The above example does nothing but a show running-configuration, which of course does nothing helpful at all.

After that, you create a kron, which is the scheduler that runs the task on a defined timeframe.

Router(config)# kron occurrence TEST at 00:00 Mon recurring
Router(config-kron-occurrence)# policy-list displayCONFIG

This sets the ocurrence (named TEST) to run the policy-list (named displayCONFIG) at midnight on Monday everyday.

Router(config)#kron occurrence TEST at 00:00 ?
Day of month
DAY Day of Week eg mon, tue, etc
MONTH Month of year eg jan, feb, etc
oneshot Schedule kron occurrence exactly once
recurring Schedule kron occurrence repeatedly

As you can see, there are a variety of options that you can play with to set your desired schedule.

Drawback: however, there is a main drawback to using kron: configuration commands are not allowed. That sort of takes all the fun out of it, as I can imagine.

Option #2: Kiwi CatTools
Although not a proprietary Cisco product, Kiwi CatTools proves to have required functionality that is needed to run a scheduled task at a required time. Best of all? It’s fully functional even in the freeware version; licensed copies get to control more devices.


After starting the program up, you add a device.


Enter the required passwords.


Add an activity.


Enter the time required.


Enter the required commands.

And you’re all set to do a test run after that. All in all, a pretty nifty tool.

Drawback: as you would have noticed from the time interface, the existing interface options do not allow you to schedule tasks on the Xth of each month. Here’s what a Kiwi rep replied when I emailed them last week.

Hi Kein,

Thanks for your enquiry regarding CatTools.

At present, there is no easy way to setup a monthly activity apart from (as you may have found already) setting up an activity is a custom schedule.
To set up a monthly custom schedule, you enter in the time (or times) you want the activity to run in the ‘Custom schedule’ box; and then in the Dates box you Add a line for the 1st day of each month.

e.g. ‘Include’ ‘Start date’ = 1/01/2008 ‘End date’ = 1/01/2008

Repeat, adding a line for each of the 1st day of the month.

As this isn’t the nicest or most practical of solutions to adding a monthly activity, we have added a task to the project enhancements list to overhaul the whole scheduler.
I’m afraid however that at this point in time, there is no firm date as to when we will be looking at revising the scheduler, mainly because there are many other tasks that the scheduler would be dependent on, which need to be completed and rolled out first.

Kind regards,

Steve Welsh
Kiwi Enterprises

I’ll be keeping an eye out for this added feature, but until then Kiwi CatTools works fine.

Cisco IOS: 7200 series router – dumping the IOS

[Cisco 7200 Series Routers] – ^tt^ on Flickr, 27 Oct ’07.

I was fiddling around with a Cisco 7204 VXR yesterday, wondering how the hell it was supposed to work without an IOS. (The vendor blandly admitted that his new warehouse manager stuffed it up.) After a bit of reading, I concluded that I had to get the IOS into the PCMCIA flash card somehow.

Option 1: rip the IOS off the existing router. Troublesome; not within walking distance and no car.
Option 2: download the IOS and ram it into the card somehow. I had no idea on how this could be done.

I was about to resign myself to option 1 when the answer finally appeared: I could just download the IOS off the Cisco site, plug the card into my laptop and transfer it over.

(Incase you were wondering why I didn’t think of that: I thought the file systems weren’t compatible, which was why I hadn’t tried.)

So I copied it into the card, stuffed it into the slot0 on my router and rebooted it. And all was good after that. Just remember to format the card before that:

Router# format slot0: