Community discussions

MikroTik App
 
SayaniB
just joined
Topic Author
Posts: 12
Joined: Wed Aug 13, 2014 12:18 pm

Monitoring CPU, Memory utilization of HP V1910-24G switch

Thu Oct 16, 2014 3:29 pm

Dear Friends,

I have number of HP V1910-24G switches for which dude is fetching all information except CPU, memory utilization temperature etc.
For CPU monitoring I created:

Function:
Name: HP_CPU_a
Code: if(array_size(oid_column("1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8", 10 ,29)), oid("1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8", 10, 29)+1 ,"False")

Probe:
Name:HP_CPU
Type: Function
Available: HP_CPU_a() <> "False"
Error:if(HP_CPU_a()<>"False",if(HP_CPU_a() < 50, "", concatenate("Warning: high CPU =", HP_CPU_a(), "%")), "Failed read")
Value: oid("1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8", 10, 29)
Unit:%

But it did not return me expected result. I got the message "Failed read"

Please help me in understanding my mistake...

Thanks in advance..

Sayani
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Monitoring CPU, Memory utilization of HP V1910-24G switc

Thu Oct 16, 2014 5:03 pm

Hey Sayani, try either one of these in your function;

if(string_size(oid("1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8")), oid("1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8")+1 ,"False")
if(string_size(oid("1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8.0")), oid("1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8.0")+1 ,"False")

Checking for a string in one oid is probably more efficient than checking for an array in a few oids.

If I have to guess why your function is not working I would say the array size is not returning true therefore the function returns False and the probe fails.
Maybe deleting .8 would fix it... Since examining more of the MIB would likely produce an array of values.
if(array_size(oid_column("1.3.6.1.4.1.25506.2.6.1.1.1.1.6", 10 ,29)), oid("1.3.6.1.4.1.25506.2.6.1.1.1.1.6.8", 10, 29)+1 ,"False")
BUT I would still use the first thing I suggested. Don't forget you can always use device labels for troubleshooting.
[HP_CPU_a()] Should show a value and not false on the appearance of a device.

HTH,
Lebowski
 
SayaniB
just joined
Topic Author
Posts: 12
Joined: Wed Aug 13, 2014 12:18 pm

Re: Monitoring CPU, Memory utilization of HP V1910-24G switc

Fri Oct 17, 2014 12:06 pm

Hi Lebowski,

Your suggestion is absolutely wonderful...Thank you so much.
using the first option suggested by you I could get both CPU and Memory utilization and temperature for all my HP switches..

Thanks once again..

Next I have another problem in my life.

I have few Fortigate devices in my network for which dude has not picked up any information so far other than pinging them successfully..

Any suggestion on this?

Sayani
 
SayaniB
just joined
Topic Author
Posts: 12
Joined: Wed Aug 13, 2014 12:18 pm

Re: Monitoring CPU, Memory utilization of HP V1910-24G switc

Fri Oct 17, 2014 3:44 pm

Hi Lebowski,

I followed your that suggestion for the Fortigate 90D device. but got the error false for the function given below.

if(string_size(oid("1.3.6.1.4.1.12356.101.1.630.1.3")), oid("1.3.6.1.4.1.12356.101.1.630.1.3")+1 ,"False")

The OID for Fortigate 90D family shows four OIDs in the website http://www.oidview.com/mibs/12356/FORTI ... E-MIB.html

fgt90D 1.3.6.1.4.1.12356.101.1.630
fgt90DPOE 1.3.6.1.4.1.12356.101.1.631
fwf90D 1.3.6.1.4.1.12356.101.1.632
fwf90DPOE 1.3.6.1.4.1.12356.101.1.633


The site gives the OIDs for the system details like info, version, CPU and memory usage like this:

fgSystem 1.3.6.1.4.1.12356.101.4
fgSystemInfo 1.3.6.1.4.1.12356.101.4.1
fgSysVersion 1.3.6.1.4.1.12356.101.4.1.1
fgSysCpuUsage 1.3.6.1.4.1.12356.101.4.1.3
fgSysMemUsage 1.3.6.1.4.1.12356.101.4.1.4

I tried combining the OIDs to get CPU usage % of the FG device but every time I got "False" for the above mentioned function.

Please help if you can..

I think again I am committing some mistake..

Thanks in advance..

Sayani
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Monitoring CPU, Memory utilization of HP V1910-24G switc

Fri Oct 17, 2014 4:58 pm

You are welcome, it is such a great program I hope someday they continue to develop it.

First just right click on the device in question and SNMPwalk the device. (You will see how awesome this tool is)
In the new window check to see if values are returned.
If values are returned click on subtree and put part of the oid that you are interested in.
SnmpWalkoid.png
If you do not get any values, make sure the community string is the same in the dude and on the device. Change to SNMP v1 if v2 doesn't work.

Then you can simplify steps to help figure out what is not working. Place a known working OID on the appearance of the device label. If it is blank the dude is having trouble using SNMP to read the device.
[oid("1.3.6.1.4.1.12356.101.1.630.1.3")]
maybe you need .0
[oid("1.3.6.1.4.1.12356.101.1.630.1.3.0")]

Expand your label to prove your function is correct...
[if(string_size(oid("1.3.6.1.4.1.12356.101.1.630.1.3")), oid("1.3.6.1.4.1.12356.101.1.630.1.3")+1 ,"False")]
Place the label directly into a function.
Function
Fortigate_90D_CPU_a
if(string_size(oid("1.3.6.1.4.1.12356.101.1.630.1.3")), oid("1.3.6.1.4.1.12356.101.1.630.1.3")+1 ,"False")

Try the function on a label...
[Fortigate_90D_CPU_a()]

Later in the value of the probe you can subtract 1.
Fortigate_90D_CPU_a() -1

since the added 1 keeps the probe from failing when CPU=0% utilization.

Finally if you can't determine the trouble...
Run wireshark add a filter "host 192.168.1.1" then start a capture, see the exact packets being sent and received, does it look like a conversation?

Lebowski
You do not have the required permissions to view the files attached to this post.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Monitoring CPU, Memory utilization of HP V1910-24G switc

Fri Oct 17, 2014 5:07 pm

I should have mentioned you do not need to compile a MIB for the dude to read an OID but if the value returned is not a standard value snmpwalk might not be able to show a meaningful result. Compiling the MIB lets SNMPwalk show the correct description for a value and if the value is something interesting like a floating 64bit number with 3 decimal places than the value will be displayed correctly as well.

You should just use OIDs directly in any function and if you are having trouble with a returned value and you have tried everything then go compile a MIB.
I try to avoid compiling MIBs into the dude to keep the memory footprint smaller. (Note: some of my work is meaningless, lol).

Lebowski
 
SayaniB
just joined
Topic Author
Posts: 12
Joined: Wed Aug 13, 2014 12:18 pm

Re: Monitoring CPU, Memory utilization of HP V1910-24G switc

Tue Nov 11, 2014 11:06 am

Some modifications in the SNMP configuration has solved the problem.

Thanks a lot.

Sayani

Who is online

Users browsing this forum: Google [Bot] and 20 guests