SNMP expressions?

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
mrw
Posts: 195
Joined: Mon Oct 08, 2012 6:11 am

SNMP expressions?

Post by mrw »

Hi,
I would like to get percentage of memory utilization from a firewall using snmp.
It doesn´t provide that but I can get Total RAM and Used/Free in MB.
Is it possible to create an expression with SNMP OIDs?

Something like:
(<Used OID value>/>Total OID value>)*100

Thanks
//Andreas..
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Starting from HostMonitor 9.18 SNMP Get test may request and calculate several OID counters at once.

You may specify the following expression, instead of OID in SNMP test properties dialog ("Alert when OID" field):
ram_percent = ([<used memory OID>]*100) div [<total memory OID>]

Please check for details at:
http://www.ks-soft.net/hostmon.eng/news.htm#v918
mrw
Posts: 195
Joined: Mon Oct 08, 2012 6:11 am

Post by mrw »

Ok, I´m running 9.16 so I´ll look into doing an upgrade then since that feature is very useful :)

BTW, I see that there are some fixes for SOAP in 9.18. Could that help my other problem? http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=7029

Thanks!
//Andreas..
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

BTW, I see that there are some fixes for SOAP in 9.18. Could that help my other problem? http://www.ks-soft.net/cgi-bin/phpBB/vi ... php?t=7029
In that case Web server couldn't accept double HTTP headers, sent by HostMonitor.
We have checked HostMonitor 9.16 with ESXi 4.1 and ESXi 5.1 with default settings and SOAP test works well on our systems.
Anyway, you may try to install trial version of newest HostMonitor on separate system and check if it works with your ESXi.
mrw
Posts: 195
Joined: Mon Oct 08, 2012 6:11 am

Post by mrw »

I´ve upgraded to v9.34 and started to test using an oid expression like you described above.
But I think I need some help getting this to work. I thought I could just replace the single oid in that field to [<used memory OID>]*100) div [<total memory OID>] with the relevant oids inplace, and get a value from that, but that didn´t work.

So how do I do that? Do I have to use the variable infront? If so, then how do I present that value and check if its above or below a static value?

Sorry for the n00b question.. ;)
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Yes, you have to use variable name - simply add anyname= in front of expression
Starting from version 9.18 HostMonitor allows you to use expressions like
TotalTraffic1 = [1.3.6.1.2.1.2.2.1.10.1] + [1.3.6.1.2.1.2.2.1.16.1]
In such case HostMonitor will retrieve 2 counters (1.3.6.1.2.1.2.2.1.10.1 - total number of octets received on interface #1; 1.3.6.1.2.1.2.2.1.16.1 - total number of octets transmitted out of interface #1) calculate sum of these counters and check result.
When you are using this expression, %MIBNAME%, %MIBNAMESHORT% and %PATH% variables will be set to TotalTraffic1 (name of the variable specified in this expression); while %OBJECT% variable will be set to [1.3.6.1.2.1.2.2.1.10.1] + [1.3.6.1.2.1.2.2.1.16.1]
If so, then how do I present that value and check if its above or below a static value?
Condition for alert
HostMonitor can compare values returned by the device with a specified string and start alert actions if the returned value is:

- less/more than the specified value
- equal to/different from the specified number or string
- contains/doesn't contain the specified string

Also HostMonitor has 9 alert conditions to check how new value changes compare to the previous test:
- "increases by" - HM sets "Bad" status when value increases by specified number or more
- "decreases by" - HM sets "Bad" status when value decreases by specified number or more
- "changes by" - HM sets "Bad" status when value changes by specified number or more
- "increases by (%)" - HM sets "Bad" status when value increases by specified (or greater) percentage
- "decreases by (%)" - HM sets "Bad" status when value decreases by specified (or greater) percentage
- "changes by (%)" - HM sets "Bad" status when value changes by specified (or greater) percentage
- "increases /sec" - HM sets "Bad" status when average increase of the counter (per second) is greater than the specified limit ((new value - old value)/elapsed time >= specified limit)
- "decreases /sec" - HM sets "Bad" status when average decrease of the counter (per second) is greater than the specified limit ((old value - new value)/elapsed time >= specified limit)
- "changes /sec" - HM sets "Bad" status when average change of the counter (per second) is greater than the specified limit (abs(new value - old value)/elapsed time >= specified limit)

Regards
Alex
nieaicai
Posts: 73
Joined: Fri Aug 03, 2012 9:05 pm

Post by nieaicai »

hello i have a problem:

why ss=[oid]*0.001 or ss=[1.3.6.3.3.4.34.34.]*[0.001] does not work.
it say: invalid oid or no such name
but ss=[oid]div1000 can work but result is integer division
how to get the result?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

That is correct behaviour.
You may use only integer values or values in binary format.
Result of the calculation will also be an integer or value in binary format.
nieaicai
Posts: 73
Joined: Fri Aug 03, 2012 9:05 pm

Post by nieaicai »

tks so much
now how i can get the result inclue decimal point?
is it possible?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

H'm... no HostMonitor does not allow this.

Regards
Alex
nieaicai
Posts: 73
Joined: Fri Aug 03, 2012 9:05 pm

Post by nieaicai »

can use the tune up reply fuction to get the result?

for example
now i get the capacity of ups is 3400w
now i want to chang to 3.4kw

is it possible?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

If your device returns reply formatted exectly like 8888w
you may use Tune up Reply value option with expression like the following:
[substr('%SuggestedReply%',1, indexof('%SuggestedReply%','w')-1) div 1000].[substr('%SuggestedReply%',1, indexof('%SuggestedReply%','w')-1) mod 1000 div 100]kw
Post Reply