SNMP

NICE! Thanks a bunch for that oid!

while I’m on the topic, how can the “upgradable-till” oid be converted from hex to text. I am basically looking for a human readable text date with year/month/day or similar.

[admin@bht] > /system license print 
       software-id: "xxxxxxx"
  upgradable-until: sep/01/2006
            nlevel: 3
          features: 
[admin@bht] > /system license print oid
       software-id: .1.3.6.1.4.1.14988.1.1.4.1.0
  upgradable-until: .1.3.6.1.4.1.14988.1.1.4.2.0
             level: .1.3.6.1.4.1.14988.1.1.4.3.0

mocha:/usr/local/mis/bin # snmpwalk -v1 -c public 10.0.1.5 .1.3.6.1.4.1.14988.1.1.4.2.0
SNMPv2-SMI::enterprises.14988.1.1.4.2.0 = Hex-STRING: 07 D6 09 01 00 00 00 00

Hi,
the first two hexs concatenated are the year, the 3rd is the month and the
4th is the day

Converted to dec it looks like this:

perl -e ‘printf “%d. %d. %d\n”, 0x01, 0x09, 0x07d6’

    1. 2006

So your copy is upgradable until 1st september 2006

Best regards,
Michal

Now, I can have my database automatically update the version and hostname of my Mikrotiks! I run this script with cron each day. I use the database both as a glorified inventory spreadsheet, and to feed other scripts such as one that makes mrtg config files.

# more db.update.mt 
#!/bin/bash
MYCMD="mysql -B -N -h 127.0.0.1 -u xxxxxxxx -s -pxxxxxx -e "

for IP in `$MYCMD " use mt; select ip from router;"` ; do
  VER=`snmpget -r2 -v1 -c public -Ovq $IP .1.3.6.1.4.1.14988.1.1.4.4.0 |cut -d" " -f1|sed -e "s/\"//g"`
  NAME=`snmpget -r2 -v1 -c public -Ovq $IP SNMPv2-MIB::sysName.0 |cut -d: -f4`
  $MYCMD "use mt; update router set version='$VER' where IP='$IP'"
  $MYCMD "use mt; update router set hostname='$NAME' where ip='$IP'"
done

For some reason, I can’t get bash to print the month properly. I could use the perl example, but I’m almost there and don’t want to need two scripting languages to convert a hex date to decimal.

mocha:/usr/local/mis/bin # cat getle 
#!/bin/bash
HEXDATE=`snmpget -r2 -v1 -c public -Ovq $1 .1.3.6.1.4.1.14988.1.1.4.2.0`
CDHEXDATE=`echo 0x$HEXDATE |sed -e "s/\"//g" |sed -e "s/ //g"`
echo $HEXDATE
echo 0123456789
echo $CDHEXDATE

YEAR=`echo $CDHEXDATE|cut -b0-6`
echo YEAR
printf "%d\n" $YEAR

MONTH=`echo $CDHEXDATE|cut -b7-8`
echo MONTH
printf "%d\n" $MONTH

DAY=`echo $CDHEXDATE|cut -b9-10`
echo DAY
printf "%d\n" $DAY
mocha:/usr/local/mis/bin # ./getle 10.0.1.5
"07 D6 09 01 00 00 00 00 "
0123456789
0x07D6090100000000
YEAR
2006
MONTH
./getle: line 14: printf: 09: invalid number
0
DAY
1
mocha:/usr/local/mis/bin #

maybe something like this?

#!/bin/sh

OUT=`snmpget -r2 -v1 -c public -Ovq $1 .1.3.6.1.4.1.14988.1.1.4.2.0 |sed 's!\"!!g'`

YEAR=`echo $OUT |awk '{printf "%d", strtonum("0x" $1 $2)}'`
MONTH=`echo $OUT |awk '{printf "%d", strtonum("0x" $3)}'`
DAY=`echo $OUT |awk '{printf "%d", strtonum("0x" $4)}'`

Cheers :sunglasses:
Michal

The amount of registration on the AP is good to have throught SNMP.
Fixed MIBs for clients that are registred is good too, because I want to do MRTG graphics of the signal level of the clients registred in the AP.

Thanks

Fabrício

Netwatch (tools->netwatch) status of every host will be very helpful. Just up/down flag, nothing more.

Welldone, BGP in >2.9.20 looks great. SNMP status of every peer would be fine (Instance, Remote Address, Remote AS, Remote ID, Uptime, Prefix count and State).

Just to echo, I would like to have connected UPS stats.

The open API sounds fantastic. Any more info on this?

Can you be more specific on you SNMP requests? What traps would you like to see? What is THE SNMP feature that you miss the most now?

  1. Netwatch (tools->netwatch). It should´t be a trap, but simple OIDs for every Netwatch Host and his Status and Since.

  2. BGP - status of every peer (Instance, Remote Address, Remote AS, Remote ID, Uptime, Prefix count and State) will be very helpful.

We need to be able to use the same community string in different/multiple subnets.

On wireless which frequency is currently used (by station mode)
It’s very helpful with dude!

  • OID for per wireless interface RSSI without an MAC address together with the OID number, perhaps the interface index;

  • OID for per interface total wireless associations.

  • static oid’s for client signal strengths (without adding mac to access list)

  • ability to upload/execute commands (i.e. run / user set admin password=12345 on 40 systems at once)

  • UPS status details (online, battery charge state, voltage, load etc)

COOL! :slight_smile: This is a really cool thing I need in RouterOS!


In SNMP I’d like to see traps about extreme CPU and system temperature, extreme CPU load, failure of all the fans, that can be detected by system, change in state of serial or parallel port lines (to use it for any custom sensors like detection of opening of the box, where the router stands).

add or delete user and change their permissions.
We have tech support that come and go. They take a look from the tower at the client which is very helpful. Big pain to go do this to every access point we have manually.

You can use a radius server for administrator authentication, quite easily. Linking device administration access to an employee database can automate the whole process, without the need to alter individual device configs (via SNMP, or otherwise).

–Eric

it seems that Sergejs either A.) didn’t actually read the content of my email before writing back to me, or B.) he wants me to post it here… either way, here it is…

now can we get accurate interface speeds to be reported by SNMP? I hate having 10-15mb link speeds on routers that are reported as 100mbps because it’s a ethernet uplink, and 11mbps link speeds reported for 802.11a nstream links that are actually pushing 20mbps…

Re: [Ticket#2006071416000037] SNMP interface speed

Hello Brian,

To view available OIDs,
you can type e.g. ‘queue simple print oid’.

Follow this topic about SNMP,
http://forum.mikrotik.com//viewtopic.php?t=7453

Regards,
Sergejs

“Brian Higgins” wrote:

is there any way to set the interface speed that is reported via SNMP?
our monitoring system reads the reported speed and bases it’s graphing
off of what it reads. we have a vlan that is pushing about 8mpbs (SNMP
says the interface speed is 10mbps), and we get constant alerts about
the utilization because it’s over 80% of the reported speed. we also
have similar issues with our APs because they are reported as 11mbps,
but they are 802.11a radios running at 24mbps.

if this is not yet possible, can you please add this ability into 2.10
(or sooner??)

For Ethernet interfaces that are hooked into other connections such as
a DSL modem this would be nice as well so we can specify that the
interface speed is actually 3.0mbps even though it is a 100mbps
Ethernet port.

I have asked it many times that speed and description (comment) values be avaliable via snmp.