cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1515
Views
0
Helpful
8
Replies
danielschmalen
Beginner

SNMP query usbflash

Hello,

I just searched hours for the solution of my problem, but couldn't find any good solution.

My goal:

I want to get the installed IOS version from a router via SNMP  query. So I execute a .php script on a server, which has the privileges  to send a SNMP query to the routers. I have 170 devices that have to be  checked.

My problem:

In 150 of 170 cases the SNMP query returns the IOS file e.g. "c870-advsecurityk9-mz.124-15.T15.bin". I used the OID "1.3.6.1.4.1.9.9.10.1.1.4.2.1.1.5.1.1.1", which represents the OID for ciscoFlashFileName. But in 20 of 170 cases it returns "

No Such Object available on this agent at this OID". In my  oppinion the reason for this error message is that the IOS file is not  saved in flash:, but in usbflash0:. The problem appeared just on Cisco  1921 routers.

My question:

Is there any possibility to get the installed IOS image via SNMP query from the usbflash?

I hope that you can understand my problem and my goal. If you don't, feel free to ask me for more information.

Kind regards,

Daniel Schmalen | regio iT

8 REPLIES 8
Michel Hegeraat
Rising star

You may want to do a snmp walk of 1.3.6.1.4.1.9.9.10.1., in a mib browser on the remaining devices to find the OID, that could provide this info on the 1921. It may show the other flash devices.

I could also be that the ios file is just not the first file in the flash, because your last 1.1 of the OID is the first file in the first partition. If the 1921 run the embeded management image, the bin file you are looking for, is somewhere else. 

snmp walk on 1.3.6.1.4.1.9.9.10.1.1.2.1.5

Or you could parse the running IOS from 1.3.6.1.2.1.1.1.0 :

system.sysDescr.0 : DISPLAY STRING- (ascii):  Cisco Internetwork Operating System Software
IOS (tm) 3600 Software (C3620-IS-M), Version 12.1(5), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Wed 25-Oct-00 00:17 by cmong

But this fails to mention the feature set,.....

Cheers,

Michel

I could also be that the ios file is just not the first file in the flash, because your last 1.1 of the OID is the first file in the first partition. If the 1921 run the embeded management image, the bin file you are looking for, is somewhere else. 

snmp walk on 1.3.6.1.4.1.9.9.10.1.1.2.1.5



I got this in my code:

  while($i < 10)

  {

        if(strpos($ciscoFlashFileName,".bin")===false)

        {

              $ciscoFlashFileName = snmp2_get($HOST, $SNMP_COMMUNITY,                "1.3.6.1.4.1.9.9.10.1.1.4.2.1.1.5.1.1.$i");

                $i++;

        }

       else

         $i=10;

  }

I will try a snmpwalk of 1.3.6.1.4.1.9.9.10.1.

//Edit: No Such Object available on this agent at this OID - I m trying a snmpwalk of 1.3.6.1.4.1.9.9 at the moment

Thanks so far.

I forgot to give you some information why I'm doing this.

In our company we are running a monitoring tool for our routers and other network devices. We are monitoring the cpu usage, network etc., but we want to get a warning if the flash disk installed in the routers is broken. Therefore we want to write a plugin for the monitoring tool to get this done. We thought it might be a good idea to query the IOS file on the flash disk via SNMP. If the query returns no correct file, the plugin is supposed to send a warning.

So do you think there is an easier way to handle this? Does a possbility exist to query/request the flash disk status, which returns the status of the flashdisk in a way like 0=ok, 1=warning, 2=error ?

danielschmalen
Beginner

Any idea?

Hi Daniel,

I was on leave. I just did a walk on a C1921.

I did not find any OID to get the status of the USB flash

It seems the usb flash is not covered by the flash mib at all.

Sorry,

Michel

Hey Michel,

I really appreciate your efforts to help me.

Do you know any other way to monitor the flash disk/usb flash status apart from SNMP queries?

My colleague said a script which initiates a SSH logon is not possible, because it takes too much time for all the network devices.

Kind regards,

Daniel

Running a 'sh flash | i bin' gives one or more lines with the binaries on the flash.

1     68184004 Jun 19 2013 08:10:02 +02:00 c1900-universalk9-mz.SPA.152-4.M2.bin

But if SSH is also impossible due to "too time comsuming" then there are no options left. However I don't see the problem really.

Not sure how things are organized in your network management but,

  • it seems pointless to me to check the flash every 5 minutes. Once a day gives you lots of time to contact the devices.
  • you can use threading in perl and python to connect to multiple devices at the same time to reduce the total time required. 
  • you don't need to connect to all devices, just a group.( the ones that can't be monitored via SNMP) (creating device groups is generaly a good idea since you don't want to apply the same thing on every device)

Ofcourse I see the nice side of an 'on the fly' php page that gets the current status, and indeed the ssh solution is probably not suited for that, so 'old' data must be included from a database instead, but often when I device becomes unreachable the last state is also very interesting.

Cheers,

Michel

Thanks alot for the answer.

I will give these information to my colleague and discuss it with him.

But the amount of devices, which can't be monitored by the SNMP php script, is getting bigger each day. In a current project we change old cisco routers with new cisco 1921, so all new ones couldn't be covered by the script.

Nevertheless we will consider your proposals and do a brainstorming

Content for Community-Ad