Community discussions

MikroTik App
 
CypherBit
just joined
Posts: 18
Joined: Tue Mar 06, 2012 10:06 am

Re: Probe Thread

Thu Jun 13, 2013 11:49 am

We run a couple of SQL Servers, and I found it useful to track the amount of memory that the SQLserver process was consuming - in this case I was looking for sqlsrvr.exe in the list of running processes, so to look for and plot the memory consumption for other processes, simply change "sqlservr.exe" for something else such as "System Idle Process".
Any idea how one would use this if we only have one central SQL server with multiple instances. It appears one is picked by Dude, but I need to follow all four.
 
homerkaro
just joined
Posts: 11
Joined: Mon Jul 16, 2012 4:40 pm

Re: Probe Thread

Fri Jun 21, 2013 3:31 pm

Hi!
I'm trying to create a probe to check if a program runs on my server or not.
First i'd like to test it with the notepad.exe so i created this probe:
Type: function
Available: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"NOTEPAD.EXE")>0, 1, -1)
Error: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"NOTEPAD.EXE")>0, "", "NOTEPAD.EXE not detected by SNMP probe")
Value: 1 (or anything else, is purely for charting purposes and I return 1 if the service is running)
Unit: running (or whatever you want to call the above values)
Rate: none

But its not working. I'm getting unreachable error message. The snmp is configured well because i can get other properties of my computer (cpu,hdd, memory).
What do i do wrong?
Thanks!
Daniek
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Mon Jun 24, 2013 5:01 pm

Hi Homerkaro, FYI, on the available line the -1 will always return true. Make a function and call it from a probe to make it work better.

The function;
Name: find_notepad
Description: find the array index to notepad or return False
Code: if(array_size(oid_column("1.3.6.1.2.1.25.4.2.1.2",10,0)), array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2",10,0),"notepad.exe"),"False")

The Probe;
Name: notepad
Type: Function
Available: find_notepad()<>"False"
Error: if(find_notepad()<>"False",if(find_notepad()<>-1, "", "Warning: notepad not running"), "Failed to read running programs")


Note: Windows 7 returns -1 if the program is not running. The available line works since -1 is "true" and when the SNMP section does not exist the function returns "False" (The probe will not automatically install on devices that do not have the OID for programs)

I suspect some operating systems will give you cpu utilization for a single process, maybe you could graph that.
Lebowski.
Available: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"NOTEPAD.EXE")>0, 1, -1)
 
ephillips
just joined
Posts: 3
Joined: Thu Jun 27, 2013 7:45 pm

Re: Probe Thread

Thu Jun 27, 2013 7:49 pm

I am new to The Dude and was trying to get a set up to see if a specific scm product and a sql server is running. Is it at all possible to do either of these tasks?
 
amokkatmt
newbie
Posts: 33
Joined: Mon Oct 24, 2011 3:31 pm

Re: Probe Thread

Thu Oct 31, 2013 11:13 pm

Hello. How can I count active interfaces? Please see screenshots. How can I count those with status "up" ? This is EPON OLT, so interface count is dynamic and their states are dynamic too.
oids1.png
oids2.png
Thank you for any help.
You do not have the required permissions to view the files attached to this post.
 
User avatar
itsupportschulen
just joined
Posts: 22
Joined: Fri May 24, 2013 10:57 am
Location: Germany, Herford
Contact:

Re: Probe Thread

Wed Nov 20, 2013 11:38 pm

Hello together,

here are some probes of mine of the last few days:

temperature of Fujitsu Siemens Server if you have Serverview installed:

Name: temp_FSC_01_AMBIENT
Available: if(string_size(oid("1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.0")), 1, 0)
Error: if(oid("1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.0")<10, concatenate("ACHTUNG Temperatur = ", oid("1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.0"), "° C"), "")
Value: oid("1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.0")
Unit: °C

some oids of other temperatures with which you can create some probes like the shown one:
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.1 (SYS1)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.2 (SYS2)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.3 (SYS3)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.4 (CPU)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.5 (MEM_A)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.6 (MEM_B)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.7 (MEM_C)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.8 (PSU1_Inlet)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.9 (PSU2_Inlet)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.10 (PSU1)
1.3.6.1.4.1.231.2.10.2.2.5.2.1.1.11.0.11 (PSU2)

Works on a FSC TX150 S8.


Name: HP_DriveArrayState
Available: if(string_size(oid("1.3.6.1.4.1.232.3.1.3.0")), 1, 0)
Error: if(oid("1.3.6.1.4.1.232.3.1.3.0")>2,if(oid("1.3.6.1.4.1.232.3.1.3.0")=3,"degrade",if(oid("1.3.6.1.4.1.232.3.1.3.0")=4,"failure","")),"")
Value:
Unit:

Checks the RAID on HP Servers, (this return a number: 2=ok, 3=degradate, 4=failure)
http://pandorafms.com/index.php?sec=Lib ... id_PUI=261


Name: FSC_GlobalState
Available: if(string_size(oid("1.3.6.1.4.1.231.2.10.2.11.2.1.0")), 1, 0)
Error: if(oid("1.3.6.1.4.1.231.2.10.2.11.2.1.0")>1,if(oid("1.3.6.1.4.1.231.2.10.2.11.2.1.0")=2,"degrade",if(oid("1.3.6.1.4.1.231.2.10.2.11.2.1.0")=3,"error",if(oid("1.3.6.1.4.1.231.2.10.2.11.2.1.0")=4,"fail",if(oid("1.3.6.1.4.1.231.2.10.2.11.2.1.0")=5,"unknown","")))),"")
Value:
Unit:

(This OID indicates the Global state, not only RAID disk failure. 1=OK, 2=Degradate,3=Error, 4= Failure)

HTH
Sebastian
 
kaipr
just joined
Posts: 4
Joined: Wed Oct 12, 2011 8:33 am

Re: Probe Thread

Tue Dec 03, 2013 3:52 pm

Hello there,

since the update for Dude isn't comming for years, and I need to check on IPv6 devices as well as on IPv4, I would like to consult you guys, if you have an idea how to implement IPv6 ping probe. For start, I have put the IPv6 address into the user parameter1 of the device, and have made a tool for hand checking:

ping [Device.CustomField1]

What I would like to achieve, is a service, which has a custom probe, using a function which evaluetes the output of the ping command. Any ideas for a simplistic solution here?

Thank you, i'm sure this would help a lot of people.

Vlasta
 
m2hewitt
just joined
Posts: 1
Joined: Mon Jan 06, 2014 3:16 pm

Re: Probe Thread

Mon Jan 06, 2014 3:27 pm

Hi guys

i have a probes for check the memory usage over application, for example:

Image

Image

And they has working OK, but i need configure alarm if this they exceed a memory consumption. how can i do?

Regrds,
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Probe Thread

Fri Mar 28, 2014 2:13 pm

I made one probe for check the status of ethernet or sfp port (connected or not):

http://forum.mikrotik.com/viewtopic.php ... 08#p418008
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Mon Apr 07, 2014 11:02 pm

If the dude is set to auto discover and you use -1 for false in the available line the probe will install on every device.
AVAILABLE: if((oid("1.3.6.1.2.1.25.2.3.1.6.1")/oid("1.3.6.1.2.1.25.2.3.1.5.1"))*100>0, 1, -1)
The available line is to determine if the OID exists on the device in question but negative one is not false in the available line...

It is way better to create a function that returns a value or False. Then call that function from a probe.
Function
disk03test
if(array_size(oid_column("1.3.6.1.2.1.25.2.3.1.6",10,5)),round((oid("1.3.6.1.2.1.25.2.3.1.6.3",10,5)/oid("1.3.6.1.2.1.25.2.3.1.5.3",10,5))*100),"False")

Another function to grabs the name of the disk then if it is in error the drive letter or unix name can be returned in the error message.
Funciton
disk03name
oid("1.3.6.1.2.1.25.2.3.1.3.3" ,10,5)

So now in the probe the available line is simplified to test for "False".
The error line can also detect if the probe can't read the disk or if the disk is full...
The Probe
Available: disk03test() <> "False"
Error: if(disk03test()<>"False",if(disk03test() < 90, "", concatenate("Warning: ", disk03name(), " is ", disk03test(),"%")), "Failed read 3rd disk")
Value: disk03test()
unit: %

HTH,
Lebowski
 
guisalazar
just joined
Posts: 6
Joined: Wed Nov 30, 2011 5:57 pm

Re: Probe Thread

Tue Jun 03, 2014 3:40 pm

anyone know how to probe the status of an PPTP server?

Thanks
 
nhathaitrieu6
just joined
Posts: 5
Joined: Fri Jun 27, 2014 1:21 pm
Location: Hồ Chí Minh
Contact:

Re: Probe Thread

Fri Jun 27, 2014 1:26 pm

Hello

Someone maybe with an Hp Procurve 5406 switch ?? Im searching for CPU and Memory OID's

Thanks
 
User avatar
itsupportschulen
just joined
Posts: 22
Joined: Fri May 24, 2013 10:57 am
Location: Germany, Herford
Contact:

Re: Probe Thread

Thu Aug 28, 2014 12:12 am

Hello,

maybe someone :wink: here it comes:

Probe name : cpu_procurve
Type: Function
Available: if(string_size(oid("1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0")), 1, 0)
Error: if(oid("1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0")>80, concatenate("ATTENTION CPU usage =", cpu_procurve(), "%"), "")
Value: oid("1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0")
Unit: %


Probe name : temp_ProCurve_2 > 45 C
Type: Function
Available: if(string_size(oid("1.3.6.1.2.1.99.1.1.1.4.17")), 1, 0)
Error: if(oid("1.3.6.1.2.1.99.1.1.1.4.17")<45, "", concatenate("ATTENTION Temperature = ", oid("1.3.6.1.2.1.99.1.1.1.4.17"), "° C"))
Value: oid("1.3.6.1.2.1.99.1.1.1.4.17
Unit: °C

These probes works on most HP ProCurves Switches with CPU und Temperature sensors/feature.
Zwischenablage-13.jpg
Zwischenablage-2.jpg
Zwischenablage-1.jpg
HTH
Sebastian
You do not have the required permissions to view the files attached to this post.
 
WinWisp
just joined
Posts: 4
Joined: Thu Apr 24, 2014 8:51 pm

Re: Probe Thread

Thu Sep 04, 2014 1:42 am

Here is our ntp probe, tested and working on our ubuntu 12.04 ntpd servers
Capture.PNG
For ease of copy/paste, here is the 'Send' string:
\x1b\00000000000000000000000000000000000000000000000
You do not have the required permissions to view the files attached to this post.
 
Islander
just joined
Posts: 1
Joined: Sat Sep 13, 2014 1:52 pm

Re: Probe Thread

Sat Sep 13, 2014 2:01 pm

This is probably very simple, but I've been struggling for a few days now.

I'm running web-based VLC on a number of Raspberry Pi's (I'm an entertainment technician at a large leisure site, and these Pi's play music in various areas), and am using The Dude to alert me if any of the Pi's go down by way of using the Ping probe - works fine.

The web-based VLC has an XML status page, which has an assortment of information such as the state of the player ('playing', 'stopped'), volume, track being played etc. I'd really like a couple of probes to read/parse this xml, and a) alert me if a player isn't in the state 'playing', and b) display information on my map such as track playing, volume.

I've tried modifying the http probe, but with little luck, and I'm not sure where else to look. Any advice?

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

Re: Probe Thread

Mon Sep 15, 2014 7:46 pm

The HTTP probe will look for a word on the resulting page but displaying that word is problematic. The right way to do this is to grab the xml with an execute function and return you own result, then use that in a label for the device.

There are quite a few posts around asking how to use the execute function so search for them and read those first but here are the steps...
Install a text browser into your dude server(linx is linux based there has to be a windows one), put it in the root of the C: drive or at least in a folder with out spaces like c:\tools\linx.exe. That will hopefully simplify parameters

Create a batch job that runs linx and then use something like grep to parse the xml... There is a grep for windows as well. (note this is off the cuff so it is not exact)
Then the execute statement will be like;
execute("pstate.bat", "device.Firstaddress"," c:\\tools\")

The lines of the batch job will be something like
linx %1/webpagename.xml > tempxml.txt
if grep playing tempxml.txt echo playing
if grep stopped tempxml.txt echo stopped
if grep track tempxml.txt echo track

(%1 will be seen as device.firstaddress in the batch job)

Grep is probably not a very good thing to parse xml and maybe you will need to create a custom VB script or use Expect to give better results but you should be able to build something.

A good troubleshooting tip is to get the results of each step to display through a device label so you are certain it is working as planned.

You can modify the label refresh interval on the map settings but I am not certain how effective this will be to keep the label accurate.

HTH,
Lebowski
 
altecsole
just joined
Posts: 2
Joined: Thu Sep 25, 2014 10:01 pm

Re: Probe Thread

Thu Sep 25, 2014 10:44 pm

Here is our ntp probe, tested and working on our ubuntu 12.04 ntpd servers
Capture.PNG
For ease of copy/paste, here is the 'Send' string:
\x1b\00000000000000000000000000000000000000000000000
Many thanks, this worked for our Windows NTP servers too.
 
altecsole
just joined
Posts: 2
Joined: Thu Sep 25, 2014 10:01 pm

Re: Probe Thread

Fri Oct 10, 2014 6:27 pm

The function to display on device label UserName of user logged on a Windows Host.

You must know that:
1. There is no SNMP oid to check user logged on Windows host.
2. You can retreive UserName of logged user using WMI.
3. The Dude has not WMI support.
4. The Dude can run any executable file and retreive it's result using build in function execute.
5. It is easy to access any of WMI functions using simple VBScript.

Let put it all together and create sample function to retreive UserName of user logged on a Windows Host using WMI and put it on device label.
Thank you so much for this post. I'd been wrestling with something similar for several hours. Very much appreciated.
 
berny81
just joined
Posts: 3
Joined: Mon Oct 13, 2014 5:38 pm

Re: Probe Thread

Mon Oct 13, 2014 5:53 pm

I would like to start a thread that has custom Probe example on it. My hope is not only to further my Knowledge but hopefully help others with this great software.


Here are a few I have made.

Cisco CPU
Type: Function
Available: if(oid("1.3.6.1.4.1.9.2.1.58.0")>0, 1, -1)
Error: ""
Value: oid("1.3.6.1.4.1.9.2.1.58.0")
Unit: % of cpu load

APC PDU LOAD
Type:Function
Available:if(oid("1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1")>0, 1, -1)
Error: if(oid("1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1")>0, "", "No Load")
Value: oid("1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1")
Unit: Load amps in decimal
Hi All,

I am new to the Dude and i want to create a function then use it in a probe for example if the OID temp of a cisco switch goes above 65 degree to send an email notification indicating the actual temperature with a message "Please check server room temp"
I checked the example above but quite honestly i am not getting the programing language how it works.
per ex: what is >0, 1, -1)
>0, "", "No Load")

Can someone please explain to me with a simple example how to read the command line ?

Also what is confusing is that > 65 means lower than !
Thanks in advance
 
berny81
just joined
Posts: 3
Joined: Mon Oct 13, 2014 5:38 pm

Re: Probe Thread

Mon Oct 13, 2014 6:03 pm

I would like to start a thread that has custom Probe example on it. My hope is not only to further my Knowledge but hopefully help others with this great software.


Here are a few I have made.

Cisco CPU
Type: Function
Available: if(oid("1.3.6.1.4.1.9.2.1.58.0")>0, 1, -1)
Error: ""
Value: oid("1.3.6.1.4.1.9.2.1.58.0")
Unit: % of cpu load

APC PDU LOAD
Type:Function
Available:if(oid("1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1")>0, 1, -1)
Error: if(oid("1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1")>0, "", "No Load")
Value: oid("1.3.6.1.4.1.318.1.1.12.2.3.1.1.2.1")
Unit: Load amps in decimal
Hi All,

I am new to the Dude and i want to create a function then use it in a probe for example if the OID temp of a cisco switch goes above 65 degree to send an email notification indicating the actual temperature with a message "Please check server room temp"
I checked the example above but quite honestly i am not getting the programing language how it works.
per ex: what is >0, 1, -1)
>0, "", "No Load")

Can someone please explain to me with a simple example how to read the command line ?

Also what is confusing is that > 65 means lower than !
Thanks in advance
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Tue Oct 14, 2014 1:30 am

Make a file "who.vbs"

Set objNetwork = CreateObject("Wscript.Network")
Wscript.Echo objNetwork.UserName

Execute who.vbs in your label... I will finish this tomorrow...

THIS is crap... there are quite a few reasons why getting the username of the logged in machine is a pain. Running an escalated program is not too bad but windows management instrumentation console fails to run when integrated into a batch job called by the dude. Mostly I can't understand why the execute function is saying error when I can run the program on the command line... So I don't have a solution.

Here is an interesting program that works but when I have the dude run it, it fails.

WMIC /NODE: 192.168.1.1 COMPUTERSYSTEM GET USERNAME /format:list - Note you would need to add a user/pass to escalate privileges to read other machines. But executing this in a batch job results in error and I can't figure out what to do to fix that.

If you could get the above command to run from a batch job you could later replace 192.168.1.1 with %1 then

WMIC /NODE: %1 COMPUTERSYSTEM GET USERNAME /format:list /user:priv /pass:priv

You could execute test.bat device.firstaddress but this is CRUD to work on and doesn't work. I will revisit later.

Lebowski
 
jdurrett
just joined
Posts: 2
Joined: Thu Apr 24, 2014 10:39 pm

Re: Probe Thread

Fri Dec 12, 2014 12:23 am

Greetings. I am on day 2 of using "TheDude" and I'm confused on the purpose of Services/Polls/SNMP/MIB's/Functions.

In a nutshell, I have all the MIB's imported, can SNMPWalk the device (Microwave Radio) and now I want to (SolarWinds terminology only perhaps) "Poll" the device for the values returned by the OID's SNMPWalk shows them...but the Polling service does'nt return the value of an OID...its just comparing it to a known value and giving Yes or No. I want VALUES reported not Yes/No. Thats what ping is for.

From reading forum posts, it seems the method to the madness is that I have to SNMPwalk to get OID's, then I have to create a Function to be responsible for getting the information, then I have to create a Polling Service - Not Mind you Based on Type SNMP, but Function, and then I must put in code to each section to get the value that SNMPWalk showed me without hesitation.

Oh, and I tried to use an example found and I'm getting parsing errors for reasons unknown.

Can someone please enlighten me On how an OID becomes an actual monitored value for a device?
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Fri Dec 12, 2014 6:49 pm

Greetings. I am on day 2 of using "TheDude" and I'm confused on the purpose of Services/Polls/SNMP/MIB's/Functions.

In a nutshell, I have all the MIB's imported, can SNMPWalk the device (Microwave Radio) and now I want to (SolarWinds terminology only perhaps) "Poll" the device for the values returned by the OID's SNMPWalk shows them...but the Polling service does'nt return the value of an OID...its just comparing it to a known value and giving Yes or No. I want VALUES reported not Yes/No. Thats what ping is for.

From reading forum posts, it seems the method to the madness is that I have to SNMPwalk to get OID's, then I have to create a Function to be responsible for getting the information, then I have to create a Polling Service - Not Mind you Based on Type SNMP, but Function, and then I must put in code to each section to get the value that SNMPWalk showed me without hesitation.

Oh, and I tried to use an example found and I'm getting parsing errors for reasons unknown.

Can someone please enlighten me On how an OID becomes an actual monitored value for a device?
How the dude works is already documented to death. You just need to keep reading till you understand what your doing but I will help by trying to describe some of the details. An OID becomes a graphed value buy using it in a probe and adding a probe to a device as a service. The simplest way to graph a value is by sticking the OID in the Value: of a probe. So click on probes click + to add a new one, put test in the name, switch the type to function which will add some more fields. Note; This is not a function in the functions panel. It means the probe will function like a tool and can call functions or use OIDs directly.
Leave everything else alone but put your OID in the Value, as follows;
Value: oid("1.3.6.1.4.1.318.1.1.1.2.2.2.0", 10 ,5)

Add the test probe to a device by selecting services and clicking + and make sure history is enabled "graph poll times".

When I build a probe I create a function and use it on a label before building a probe. Open the function panel click+ type the name and put some code in the function, place the function in the appearance of a device by right clicking then select appearance in the "label" put your function in brackets and if you get a value you have created your function correctly if you get parse error you have to examine your function. Here is a function that returns the temperature from an APC UPS.

Name: ups_bat_temp
code: oid("1.3.6.1.4.1.318.1.1.1.2.2.2.0", 10 ,5)

So now I can modify the appearance of a UPS and add the function to the label. Note click the down arrow on the right to enable a custom label
Label: [ups_bat_temp()]
This will cause the device to show that oid in the label. Custom labels can be configured on individual devices and map wide but not on device types (bummer).

Now go to your test probe and in the value line replace oid("1.3.6.1.4.1.318.1.1.1.2.2.2.0", 10 ,5) with ups_battery_temp()
The available line is for auto discovery (don't use it till you understand the implications), the error line is for notifications so you can work on those later.

HTH
Lebowski

edit one incorrect statement
 
alekstef
just joined
Posts: 1
Joined: Fri Apr 24, 2015 4:43 pm

Re: Probe Thread

Fri Apr 24, 2015 4:45 pm

Does anybody know if it is possible to query a unit through its XML API using The Dude? I'm not very into all this kind of stuff, and would like to know if it is even possible, before I spend a lot of time trying to make it work :-)
 
User avatar
serhio
just joined
Posts: 3
Joined: Thu May 14, 2015 1:03 pm
Contact:

Re: Probe Thread

Fri May 15, 2015 11:55 am

After few hours of investigating protocol and analyzing WireShark traces, I made my TFTP server probe:
<?xml version="1.0" ?>
<dude version="4.0beta3">
 <Probe>
  <sys-type>13</sys-type>
  <sys-id>2039720</sys-id>
  <sys-name>tftp</sys-name>
  <typeID>6</typeID>
  <defaultPort>69</defaultPort>
  <tcpSend1>\00\01dude.txt\00octet\00</tcpSend1>
  <tcpReceive1>^.*</tcpReceive1>
 </Probe>
Key is in this string \00\01dude.txt\00octet\00. Here is explanation:
1. You need 2 bytes OpCode. 00 01 is read request.
2. We will ask for some file, like dude.txt. This string must be null terminated, so we have \00 after name.
3. We should specify transfer mode. We will use binary mode or octet, ending will binary zero or \00.
4. If anything return (even something like Access denied to dude.txt), TFTP works. There fore, just put ^. as return.

Cheers,
Srdjan
 
User avatar
itsupportschulen
just joined
Posts: 22
Joined: Fri May 24, 2013 10:57 am
Location: Germany, Herford
Contact:

Re: Probe Thread

Wed Sep 09, 2015 12:37 am

Hello together,

I search for a way to compare the DNS-Name, or NETBIOS, or SNMP-Systemname of a device with the [Device.Name] in one probe. If equal, it's ok, otherwise there should be an error. Anyone an idea?

Background:
We have all our Client-Computer with DNS Names in the Dude (with DNS Lookup: name to adress). Sometimes it happens that a client seems to be "up", but if you look carefully, you see that this is not the client which should be "probed" because the DNS Lookup isn't working perfect.

Maybe someone has an idea how to monitor such DNS-Errors ;-)

thanks
Sebastian
 
R4id0
just joined
Posts: 1
Joined: Mon Nov 16, 2015 9:35 am

Re:

Mon Nov 16, 2015 9:38 am

Check if a certain program is running on a Windows system ('OUTLOOK.EXE' in this example):

Type: function
Available: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"OUTLOOK.EXE")>0, 1, -1)
Error: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"OUTLOOK.EXE")>0, "", "OUTLOOK.EXE not detected by SNMP probe")
Value: 1 (or anything else, is purely for charting purposes and I return 1 if the service is running)
Unit: running (or whatever you want to call the above values)
Rate: none

This of course requires the SNMP agent is running and configured properly on the Windows system.
This works great but is it possible to monitor if an application is in "Not responding" state?
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Re:

Tue Nov 17, 2015 11:47 pm

Check if a certain program is running
Applications in the not responding state do not show up in Window 7 SNMP view as not responding... They show as running which sucks. I had a not responding program, found it in the registry then found the run index and checked all entries of the run index so I doubt it is updated in SNMP. Maybe build a tool that checks the program and use execute to handle the query.

Lebowski
 
hanscker
just joined
Posts: 1
Joined: Wed Nov 18, 2015 2:24 pm

Re: Probe Thread

Wed Nov 18, 2015 2:44 pm

Hi,

I'm starting to create some functions and I'm really frustasted with an issue with the device_property and if statement.

The current type of the device is "OPE" and I created the following probe for testing:

if(device_property("Type")="DES",device_property("Type"),"error")

and I got the result "OPE", but i should get "error" as result.

Could you tell me if it is a bug or i'm wrong?

I'm using version 4.0 beta 3
You do not have the required permissions to view the files attached to this post.
 
jbhainsworth
just joined
Posts: 2
Joined: Wed Nov 25, 2015 5:54 pm
Location: USA

Re: Probe Thread

Wed Nov 25, 2015 6:24 pm

New to the forum and not sure if this is the right place to post a question.
I am trying to adjust the probes so that the value is rounded to only 2 decimal places. Mainly to reduce the device image from constantly changing sizes.
jbhainsworth
 
jbhainsworth
just joined
Posts: 2
Joined: Wed Nov 25, 2015 5:54 pm
Location: USA

Re: Probe Thread

Mon Nov 30, 2015 8:30 pm

New to the forum and not sure if this is the right place to post a question.
I am trying to adjust the probes so that the value is rounded to only 2 decimal places. Mainly to reduce the device image from constantly changing sizes.
jbhainsworth
I got this corrected, It took me realizing how the label was created and the sub components that created it.
 
User avatar
HiltonT
Frequent Visitor
Frequent Visitor
Posts: 77
Joined: Mon Feb 07, 2011 4:24 am
Location: 'Srayamate
Contact:

Re: Probe Thread

Sat Jan 30, 2016 2:57 am

I got this corrected, It took me realizing how the label was created and the sub components that created it.
Any more info on what you did here as this has been annoying me for a while, too.
 
JamesMcCarthy
just joined
Posts: 9
Joined: Wed Feb 17, 2016 5:53 am

Re: Probe Thread

Sun Apr 24, 2016 10:56 pm

Hi I was wondering if anyone could help me. I would like to return the value of the {Device.ServicesDownCount] as a percentage of the overall services down to display in each devices appearance. Is this possible and how would I go about doing this. Would be good to get it to return an error if over a certain percentage
 
navrik
just joined
Posts: 3
Joined: Tue May 24, 2016 8:43 am

Re: Probe Thread

Tue May 24, 2016 11:03 am

Hi!
I'm trying to start monitor port states on our switches in Dude. So, using some guides from this topic i created Function like this:
Name: D-Link_port_1_state
Type: Function
Agent: Default
Available: if(oid("1.3.6.1.2.1.2.2.1.8.1")=1)
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")=2, "", concatenate("Link to ",  oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
So this function doesn't work properly - always stay in down position, seems like port state is down. However, the port description is taken from the switch correctly by oid("1.3.6.1.2.1.31.1.1.1.18.1"):
snmpwalk 172.31.100.1 1.3.6.1.2.1.31.1.1.1.18.1
iso.3.6.1.2.1.31.1.1.1.18.1 = STRING: "some hardware"
But if i try to use snmpwalk, i see correct state (1 - UP, 2 - Down):
snmpwalk 172.31.100.1 1.3.6.1.2.1.2.2.1.8.1
iso.3.6.1.2.1.2.2.1.8.1 = INTEGER: 1
Maybe somebody can help me - where i can start looking for the problem, or there is an error?
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Wed Jun 01, 2016 7:55 pm


if(device_property("Type")="DES",device_property("Type"),"error")
In the error line any value returned is considered an error. You must return "" if you are not in an error state. In your case you are returning a value so it is in an error state.

if(device_property("Type")="DES","","error")
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Wed Jun 01, 2016 8:05 pm

Hi!
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")=2, "", concatenate("Link to ", oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
place this on the device label [oid("1.3.6.1.2.1.2.2.1.8.1")]

Use the exact match that is displayed in your device label to check the error...
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")="down (2)", "", concatenate("Link to ", oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
 
navrik
just joined
Posts: 3
Joined: Tue May 24, 2016 8:43 am

Re: Probe Thread

Thu Jun 02, 2016 9:50 am

Hi!
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")=2, "", concatenate("Link to ", oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
place this on the device label [oid("1.3.6.1.2.1.2.2.1.8.1")]

Use the exact match that is displayed in your device label to check the error...
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")="down (2)", "", concatenate("Link to ", oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
Perhaps I have misunderstood something. However, a survey on the state of oid I see only numbers (1 or 2) without the words up/down:
link on 1st port is up
snmpwalk 172.31.100.1 1.3.6.1.2.1.2.2.1.8.1
iso.3.6.1.2.1.2.2.1.8.1 = INTEGER: 1
link on 15th port is down
snmpwalk 172.31.100.1 1.3.6.1.2.1.2.2.1.8.15
iso.3.6.1.2.1.2.2.1.8.15 = INTEGER: 2
Accordingly, their writing and in function without "up/down". So this function get correct description by oid port, the state - no.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Mon Jun 13, 2016 4:40 pm

Hi!
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")=2, "", concatenate("Link to ",  oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
place this on the device label [oid("1.3.6.1.2.1.2.2.1.8.1")]

Use the exact match that is displayed in your device label to check the error...
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")="down (2)", "", concatenate("Link to ",  oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
Perhaps I have misunderstood something. However, a survey on the state of oid I see only numbers (1 or 2) without the words up/down:
link on 1st port is up
snmpwalk 172.31.100.1 1.3.6.1.2.1.2.2.1.8.1
iso.3.6.1.2.1.2.2.1.8.1 = INTEGER: 1
link on 15th port is down
snmpwalk 172.31.100.1 1.3.6.1.2.1.2.2.1.8.15
iso.3.6.1.2.1.2.2.1.8.15 = INTEGER: 2
Accordingly, their writing and in function without "up/down". So this function get correct description by oid port, the state - no.
Does this work?
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")="INTEGER: 2", "", concatenate("Link to ",  oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
Or does this work? with 2 in quotes...
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")="2", "", concatenate("Link to ",  oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
You could also try oid_raw to grab values.
Error: if(oid_raw("1.3.6.1.2.1.2.2.1.8.1")="2", "", concatenate("Link to ",  oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
I don't know exactly how links are handled inside the program
#
 
navrik
just joined
Posts: 3
Joined: Tue May 24, 2016 8:43 am

Re: Probe Thread

Fri Jul 22, 2016 1:58 pm

Does this work? 
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")="INTEGER: 2", "", concatenate("Link to ",  oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
Or does this work? with 2 in quotes...
Error: if(oid("1.3.6.1.2.1.2.2.1.8.1")="2", "", concatenate("Link to ",  oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
You could also try oid_raw to grab values. 
Error: if(oid_raw("1.3.6.1.2.1.2.2.1.8.1")="2", "", concatenate("Link to ",  oid("1.3.6.1.2.1.31.1.1.1.18.1"), " is down"))
All this 3 variants doesn't work. Tried last builds include 6.36. Already end versions of why it has worked for 45 minutes and broke without the possibility of recover.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Fri Jul 22, 2016 7:06 pm

navrik; Place the following on the device label;
[oid("1.3.6.1.2.1.2.2.1.8.1")]
What exactly is displayed on the device? use that in your comparison.
#
 
hengst
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Sun Jan 03, 2010 3:04 pm

Re: Probe Thread

Sat Dec 10, 2016 4:39 pm

How to write a probe / function for a NON SNMP device in Dude,



The plan :



I have a telecom cabinet for example with a "door sensor"


i would like to send (Hex?) code to an IP:port ( TCP )
to a dumb sensor/device that gives back an Hex with 1 bit changed when a door/sensor is open/closed.

code i would like to send : 7e303230303031343230313030303041410d


i need (to convert) the received (Hex?) code.
as i need bit number XX to be 0 or 1 ( door open or door closed )



Found the way to send correct command from the Dude TCP probe. "send" field.

i came to this when i made from the original hex

7e303230303031343230313030303041410d

this in the dude tcp probe "Send" field.

\x7e\x30\x32\x30\x30\x30\x31\x34\x32\x30\x31\x30\x30\x30\x30\x41\x41\x0d

after clicking "apply"

the dude converted to

~02000142010000AA\r

now when entering " ^. " in the receive field.

and do a packet scan. i see the command send, and i get the correct answer back .

meaning :

~020001420000274257AE140000000000000000000000000000000041C8000041C800000141C80000000000010001F2 ( door open )
~020001420000274257AE140000000000000000000000000000000041C8000041C800000141C80000000000010000F2 ( door closed , looks like last bit changed from 1 to 0 )

now , how do i get my right bit ( door open/closed ) from that ?
.

Update ! , found the ( simple ) way to extract the right bit. direct from "receive" section.

~[0-9A-Fa-f]{91}0.* seems to work for me, if i enter that in the "receive" window of the tcp probe. and it works.

( read and learn about wildcards : http://wordmvp.com/FAQs/General/UsingWildcards.htm )

( to test your "RegEx" code you can use http://www.regexr.com/ )

Now i would like to create a function to do this , and be able to generate different errors parsed from the received data string.

1 bit is for "door" sensor
1 bit is for "water" sensor
1 bit is for "power" sensor

how can help with that ?
Last edited by hengst on Fri Feb 03, 2017 5:53 pm, edited 7 times in total.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Fri Jan 06, 2017 5:00 pm

(Future) request :
How to write a probe / function for a NON SNMP device in Dude,
Look at execute, you can call other programs/scripts and batch jobs.
 
hengst
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Sun Jan 03, 2010 3:04 pm

Re: Probe Thread

Fri Jan 27, 2017 10:26 am

(Future) request :
How to write a probe / function for a NON SNMP device in Dude,
Look at execute, you can call other programs/scripts and batch jobs.
Lebowski , i found direct way to send the right command from default tcp probe. ( see my edited post ) . can you / or someone give some light on how to write the function to parse the data that comes back ?
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Fri Feb 03, 2017 4:40 pm

Lebowski , i found direct way to send the right command from default tcp probe. ( see my edited post ) . can you / or someone give some light on how to write the function to parse the data that comes back ?
Can you put a regex that matches door closed in the receive? ~[0-9A-Fa-f]+0F2$ or ~[0-9A-Fa-f]+1F2$
Then you could at least make multiple probes with different "returns" so if the door is closed the tcp probe is true and then when ever the door is open, false.

Get the program regex designer from rad software and you can test your expressions much faster.

If you can put a TCP probe in a "Function" then you can use IF and make a much better probe but I can't figure out the syntax. Functions were meant to be called from a probe.

Lebowski
 
hengst
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Sun Jan 03, 2010 3:04 pm

Re: Probe Thread

Fri Feb 03, 2017 4:54 pm

Can you put a regex that matches door closed in the receive?
Then you could at least make multiple probes with different "returns" so if the door is closed the tcp probe is true and then when ever the door is open, false.
the Probe is already working for the door sensor.

the received regex =
~020001420000274257AE140000000000000000000000000000000041C8000041C800000141C80000000000010001F2 ( door open )
~020001420000274257AE140000000000000000000000000000000041C8000041C800000141C80000000000010000F2 ( door closed , looks like last bit changed from 1 to 0 )

i retrieve that last bit from this regex by entering
~[0-9A-Fa-f]{91}0.*
in the "receive" window of the probe. this works very well and simple.

i can do that for different "bit" alarms with several probes, but i think this may come as a DoS attack on the dump device/
ideal would be to send 1 request. and parse several "bit" alarms from 1 received regex.

for this i think it needs some little script/function. but that is little to difficult for me at the moment.
 
hengst
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Sun Jan 03, 2010 3:04 pm

Re: Probe Thread

Fri Feb 03, 2017 5:07 pm

so the Big question would be ;

can you put a TCP probe in a "Function"

or

can you use a "Function" in or with a TCP probe

right ?

i think if plausible it would make the Dude VERY useful out of the box.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Fri Feb 03, 2017 5:13 pm

~[0-9A-Fa-f]{91}0.*
in the "receive" window of the probe. this works very well and simple.
Seriously nice work figuring that all out.

If your TCP Probe has ~[0-9A-Fa-f]+0F2$ of course it should show "up" when the door is shut.
The regex ~[0-9A-Fa-f]{91}0.* doesn't work in regex designer but... If that was an OID it would be trivial, it looks like creating it as an execute is going to be way better in the long run.
=http://stackoverflow.com/questions/244 ... Python TCP

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

Re: Probe Thread

Fri Feb 03, 2017 5:16 pm

so the Big question would be ;
can you put a TCP probe in a "Function"
Call any type of probe from a function would be a great addition.

L
 
hengst
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Sun Jan 03, 2010 3:04 pm

Re: Probe Thread

Fri Feb 03, 2017 5:34 pm

Seriously nice work figuring that all out.
I figured out with bits and bytes gathered from others. its more of an endless trial and error which leads me often to the right results.
some call it "obsessive" ...

such a good feeling when code starts working eh..

Thnks for the help Lebowski , if you want to or like to play with the real device i can give you access just send me a pm.
anyway i going to check your hints this weekend.
 
thomsen
newbie
Posts: 27
Joined: Wed Sep 28, 2016 10:50 am

Re: Probe Thread

Fri Apr 14, 2017 3:09 pm

Hello all!

I'have a lot of point of sale where we use the mikrotik routers. Some shops have dual WAN interfaces for failover by recursive routing. I want to monitor each of WAN interface thru ping to google DNS. How can i do that by dude?
 
thomsen
newbie
Posts: 27
Joined: Wed Sep 28, 2016 10:50 am

Re: Probe Thread

Fri Apr 14, 2017 4:35 pm

Hello all!

I'have a lot of point of sale where we use the mikrotik routers. Some shops have dual WAN interfaces for failover by recursive routing. I want to monitor each of WAN interface thru ping to google DNS. How can i do that by dude?
In other words, it is necessary to start the ping from the device to 8.8.8.8
 
Shadeofspirit
Member Candidate
Member Candidate
Posts: 203
Joined: Fri May 27, 2016 12:15 am
Location: Minsk
Contact:

Re: RE: Re: Probe Thread

Fri May 05, 2017 4:53 pm

Hello all!

I'have a lot of point of sale where we use the mikrotik routers. Some shops have dual WAN interfaces for failover by recursive routing. I want to monitor each of WAN interface thru ping to google DNS. How can i do that by dude?
In other words, it is necessary to start the ping from the device to 8.8.8.8
Why ping? What kind of wan connection do you have? In some cases you can monitor state (running or not) or count tx/rx packets in particular period of time.
When i was looking for the same probe (ping from different wans in device from dude) i didn't find. But if you want to ping, you can use not dude, but netwatch on device (add route to google DNS from particular wan and write script on down event)

Отправлено с моего Redmi 3S через Tapatalk
 
thomsen
newbie
Posts: 27
Joined: Wed Sep 28, 2016 10:50 am

Re: RE: Re: Probe Thread

Fri May 05, 2017 5:23 pm

Hello all!

I'have a lot of point of sale where we use the mikrotik routers. Some shops have dual WAN interfaces for failover by recursive routing. I want to monitor each of WAN interface thru ping to google DNS. How can i do that by dude?
In other words, it is necessary to start the ping from the device to 8.8.8.8
Why ping? What kind of wan connection do you have? In some cases you can monitor state (running or not) or count tx/rx packets in particular period of time.
When i was looking for the same probe (ping from different wans in device from dude) i didn't find. But if you want to ping, you can use not dude, but netwatch on device (add route to google DNS from particular wan and write script on down event)

Отправлено с моего Redmi 3S через Tapatalk
Shadeofspirit, can i explain my situation in russian language? How to write private messages here?
 
Shadeofspirit
Member Candidate
Member Candidate
Posts: 203
Joined: Fri May 27, 2016 12:15 am
Location: Minsk
Contact:

Re: RE: Re: Probe Thread

Fri May 05, 2017 5:34 pm

Hello all!

I'have a lot of point of sale where we use the mikrotik routers. Some shops have dual WAN interfaces for failover by recursive routing. I want to monitor each of WAN interface thru ping to google DNS. How can i do that by dude?
In other words, it is necessary to start the ping from the device to 8.8.8.8
Why ping? What kind of wan connection do you have? In some cases you can monitor state (running or not) or count tx/rx packets in particular period of time.
When i was looking for the same probe (ping from different wans in device from dude) i didn't find. But if you want to ping, you can use not dude, but netwatch on device (add route to google DNS from particular wan and write script on down event)

Отправлено с моего Redmi 3S через Tapatalk
Shadeofspirit, can i explain my situation in russian language? How to write private messages here?
there are no private messages on this forum try skype (victorspirit) ot telegram (+375445fourfour340five)
 
spasko
just joined
Posts: 1
Joined: Fri Aug 04, 2017 10:43 am

Re: Probe Thread

Fri Aug 04, 2017 11:23 am

Check if a certain program is running on a Windows system ('OUTLOOK.EXE' in this example):

Type: function
Available: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"OUTLOOK.EXE")>0, 1, -1)
Error: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"OUTLOOK.EXE")>0, "", "OUTLOOK.EXE not detected by SNMP probe")
Value: 1 (or anything else, is purely for charting purposes and I return 1 if the service is running)
Unit: running (or whatever you want to call the above values)
Rate: none

This of course requires the SNMP agent is running and configured properly on the Windows system.
This works great but is it possible to monitor if an application is in "Not responding" state?
Could it be that you use the wrong OID. I check Windows services as following:

Available: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"), "db2sec.exe")>0, 1, -1)
Error: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"), "db2sec.exe")>0, "", "DB2_db2sec.exe not detected by SNMP probe")
Value: 1
Unit: running
Rate: none

Change "db2sec.exe" with the name of the service you like to monitor. One thing I also noticed is, that the name is case-sensitive! Write the service name the same as you see it in the Windows Task Manager.

Sometimes it also helps to use the if() function for debugging. If you are not shure what you will get with "if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"), "db2sec.exe")>0" and want to see it, put the same command as "to do". For example:

Error: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"), "db2sec.exe")>0, array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"), "db2sec.exe"), array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"), "db2sec.exe"))

With this error line you will see the output of the command in the "Problem" column of the "Services" table. Sometimes it helps me a lot to find bugs in my commands.

Hi
i've a question about function array_find !
i've integrate in the device appareance a count for process running (in my case HTTPD naming httpd.exe
my code
[array_element(oid_column("1.3.6.1.2.1.25.4.2.1.2"), array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"httpd.exe"))]
[array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"httpd.exe")]

the prolem il : i've 2 httpd.exe running (look with process explorer) and i watch on device 12 process ! !
it's a syntax function problem or bug on Dude program (version 4 running on windows server)

PS : (sorry for my english , i'm French)
 
eriitguy
Member Candidate
Member Candidate
Posts: 197
Joined: Thu Jan 26, 2017 1:16 pm

Re: Probe Thread

Sun Aug 20, 2017 4:39 pm

Hello, everyone!

I'm trying to setup HP Procurve Cpu probe from the following post.

Now I have configured:
Function
Name: Procurve_Cpu
Code: oid("1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0")

Probe
Name: Procurve_Cpu
Type: Function
Available: Procurve_Cpu() <> ""
Error: if(Procurve_Cpu() > 80, "", concatenate("Cpu load is = ", Procurve_Cpu(), "%"))
Value: Procurve_Cpu()
Unit: %

It seems that it working, but I need some advises:
1. I periodically get "Not available" - how this may be fixed?
2. Should I use Procurve_Cpu() > 80 or Procurve_Cpu() < 80 for Error? I need a notification when Cpu load is over 80%.
With current setup I get periodically errors: Cpu load is = 0%, Cpu load is = 4%
3. I also tried to configure something like this but without success - I got the error: parse failed

Function
Name: Procurve_Cpu_Test
Code: if(oid("1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0",10,5), oid("1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0",10,5), "False")

Probe
Name: Procurve_Cpu_Test
Type: Function
Availavble: Procurve_Cpu_Test() <> "False"
Error: if(Procurve_Cpu_Test()<>"False", if(Procurve_Cpu_Test()<80), "", concatenate("Cpu load is = ", Procurve_Cpu_Test(), "%"))
Value: Procurve_Cpu_Test()
Unit: %

Thank you!
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Sat Aug 26, 2017 4:10 am

Add 1 in the function since the CPU can return 0% utilization. subtract 1 in the value and error lines...

Name: Procurve_Cpu_Test
Code: if(oid("1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0",10,5), oid("1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0",10,5)+1, "False")


in your error line
if(Cisco_CPU_a()<>"False",if(Cisco_CPU_a() -1<80, "", concatenate("Warning: high CPU = ", Cisco_CPU_a(), "%")), "Cisco Device down")
 
eriitguy
Member Candidate
Member Candidate
Posts: 197
Joined: Thu Jan 26, 2017 1:16 pm

Re: Probe Thread

Mon Aug 28, 2017 9:00 am

lebowski,

Thank you for help!
I have configured a function and probe per you recommendation. Now it look like this:
2017-08-28_084819.png
2017-08-28_084903.png
But I see multiple outages:
2017-08-28_084955.png
And my chart look like this:
2017-08-28_085542.png
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: Probe Thread

Fri Sep 01, 2017 11:23 pm

eriitguy, the only idea I have is your probe interval is conflicting with the probe. On the appearance of the device place your function for CPU [Procurve_Cpu_Test()] and see what the label does. Check your label refresh interval and modify it to be the same as your probe interval and see if they act the same. I have my probe interval set for 1 minutes and probe timeout to 25 seconds and the down count to 3.
 
jmay
Member
Member
Posts: 336
Joined: Tue Jun 23, 2009 8:26 pm

Re: Probe Thread

Thu Sep 14, 2017 6:45 pm

Is it possible to graph all the time and still have a notification on failure if a probe fails? For example, I'm graphing DC voltage from MT's and I want an alert if that Voltage drops down to a certain point. I used to do this with 2 probes, but if would be nice if I could just have one probe. The problem I'm running into is when voltage gets below 24V I get the alert like I should, but I stop graphing.

Here's my current function:

Available: oid("iso.org.dod.internet.private.enterprises.mikrotik.mikrotikExperimentalModule.mtXRouterOs.mtxrHealth.mtxrHlVoltage.0")

Error: if(oid("iso.org.dod.internet.private.enterprises.mikrotik.mikrotikExperimentalModule.mtXRouterOs.mtxrHealth.mtxrHlVoltage.0")>24,"","failed")

Value: oid("iso.org.dod.internet.private.enterprises.mikrotik.mikrotikExperimentalModule.mtXRouterOs.mtxrHealth.mtxrHlVoltage.0")
 
pablolite
just joined
Posts: 4
Joined: Tue Oct 10, 2017 1:20 pm

Re: Probe Thread

Tue Oct 10, 2017 1:27 pm

Hello,

I got 600 routers in Dude with (10 probes). Now I define email notification and Im wondering how to configure it for all devices?

Ex.
My 600 devices in Services tab got probe "Internet" without notification. I want to change "Internet" probe to notification "email" in my all devices?
There is any way to change that with command line?

Best,
Pawel

sorry for my english :(


EDIT:
I find solution.

In DUDE->Services->select multiple ones->open context menu->Settings
 
User avatar
LogicalNZ
Frequent Visitor
Frequent Visitor
Posts: 59
Joined: Sat Oct 19, 2013 6:35 am
Location: New Zealand
Contact:

Re: Probe Thread

Mon Dec 04, 2017 10:53 pm

Hey All,

Just having a bit of a test with creating probes. In particular we have been working with SNMP to see if a windows service is running. It works fine :)

My problem is that when the service fails, the monitor only turns "Orange" rather than RED.

Is there any way to change this?

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

Re: Probe Thread

Thu Dec 07, 2017 1:10 am

Is it possible to graph all the time and still have a notification on failure if a probe fails?
Only if you make 2 probes, one to graph and one to notify, on the one to graph just put "" in the error line and don't put anything in the graph on the 2nd probe....
 
miro
Trainer
Trainer
Posts: 40
Joined: Mon May 09, 2011 1:44 pm

Re: Probe Thread

Wed Jan 31, 2018 3:43 pm

Hi guys.
I monitor with dude WIndows servers. On Icon in Network map I've following info:
CPU: [cpu_usage()]%
RAM: [mem_usage()]%
DiskC Free: [win_diskC_free_MB()] MB
DiskE Free: [win_diskE_free_MB()] MB
[failed_services()]


[services_info()]

I would like to display information from function services_info() in notification email, which is sent, when some probe is down.
Here is my message body tekst... I don't know what is correct sintaks to display value of function in email message.
Service [Probe.Name] on [Device.Name] is now [Service.Status] ([Service.ProblemDescription])

Stanje servisov:
[Device.services_info()]
 
eine
just joined
Posts: 16
Joined: Thu Sep 10, 2015 9:50 pm

Re: Probe Thread

Wed Jan 31, 2018 4:42 pm

.. I don't know what is correct sintaks to display value of function in email message.
syntax <> sintaks

On what platform is the dude server installed (rb, windows OS, something else)? What version do you have there? What do you receive in the notification? Why there's no description of the obvious? As I can see you're network professional, then pretty please act as one.
 
miro
Trainer
Trainer
Posts: 40
Joined: Mon May 09, 2011 1:44 pm

Re: Probe Thread

Thu Feb 01, 2018 10:53 am

For correct syntaks in notifications imho versions are not important...
But anyway, here they are:
Dude is on CHR ver 6.41 and server is Windows Server 2012...
In notification I receive no output of function services_info(), just plain text [Device.services_info()]
 
ryz
just joined
Posts: 13
Joined: Sun May 27, 2007 5:10 pm

Re: Probe Thread

Thu Mar 01, 2018 9:31 am

Hi that's my problem too. I don't know how to display function/probe values in email/sms body...
Please help.


Regards
 
dmain
just joined
Posts: 10
Joined: Tue Mar 13, 2018 8:44 pm

Re: Probe Thread

Tue Mar 13, 2018 9:49 pm

Hello, another new to Dude user struggling with alerting on utilization. I found the post below from 2009, is there something more recent?


"Mon Aug 03, 2009 4:02 pm

To get the bandwidth displayed in the links between devices the Dude uses the delta of sent/received octets multiplied by 8 averaging over each second of collected data.
Nice to know and I have often wanted to alert on high and or zero utilization but it is not obvious how to do it, like you are finding out.

I looked into data sources but they look like this "serial0/0 (2) @ router1 tx" and I don't know how you would use one in a function or a probe...
Maybe you can figure out how to use a data source in a probe?

All data sources can be seen by selecting chart, make a chart if you don't have one, click on + to add a new chart line then click on the edit all data sources (the "..." button). In there you can see a list of "interface @ devicename tx or rx" which is where I assume that you discovered how exactly the builtin source works."
 
dmain
just joined
Posts: 10
Joined: Tue Mar 13, 2018 8:44 pm

Re: Probe Thread

Tue Mar 13, 2018 10:35 pm

Hello, another new to Dude users here struggling with utilization notifications. I found the below from long ago. Is there a more recent example?

"Mon Aug 03, 2009 4:02 pm

To get the bandwidth displayed in the links between devices the Dude uses the delta of sent/received octets multiplied by 8 averaging over each second of collected data.
Nice to know and I have often wanted to alert on high and or zero utilization but it is not obvious how to do it, like you are finding out.

I looked into data sources but they look like this "serial0/0 (2) @ router1 tx" and I don't know how you would use one in a function or a probe...
Maybe you can figure out how to use a data source in a probe?

All data sources can be seen by selecting chart, make a chart if you don't have one, click on + to add a new chart line then click on the edit all data sources (the "..." button). In there you can see a list of "interface @ devicename tx or rx" which is where I assume that you discovered how exactly the builtin source works."
 
nikc
Member Candidate
Member Candidate
Posts: 208
Joined: Wed Jul 13, 2016 6:05 pm

Re: Probe Thread

Mon Jun 18, 2018 5:49 pm

Another new Dude user ... nice thread this .... worried after reading it that MT arent that interested in Dude though :S
 
autostoper76
Frequent Visitor
Frequent Visitor
Posts: 72
Joined: Sat Apr 14, 2012 12:13 pm
Location: Serbia- Belgrade
Contact:

Re: Probe Thread

Fri Jul 20, 2018 5:21 am

when will the new versions?
There is no improvement for a long time

6.39 === the latest version
https://wiki.mikrotik.com/wiki/Manual:T ... _changelog
 
User avatar
Noa
just joined
Posts: 11
Joined: Sun Dec 06, 2009 10:33 am
Location: Russia

Re: Probe Thread

Wed Jul 25, 2018 10:06 am

Hi guys. I try to make disk usage probe for large disk 9Tb but snmp give negative value of disk size.
Can i do something with this?
Безымянный.png
You do not have the required permissions to view the files attached to this post.
 
kenjix
just joined
Posts: 13
Joined: Wed Aug 28, 2019 5:31 pm

Re: Probe Thread

Wed Aug 28, 2019 5:44 pm

Hi, I've been using the dude for a while now and was trying to get the bandwidth probe and alerts to work, but haven't been able to find any documentation as to how to start. Was this project/work ever followed up? All I can find are post from 2010 and back. Any help will be greatly appreciated.
I've been using the Dude for about a month now and am very impressed, the Probe Thread has been very useful. One probe I am having trouble creating is for current bandwidth utilization, giving a notification at a ceratin percentage. Here's what I've done so far:

Using the idea that (InOctets + OutOctets)*8*100/ifSpeed gives the percentage of utilization I created the function:

Function
Name: Bandwidth
Code: (oid("1.3.6.1.2.1.2.2.1.16.21")+oid("1.3.6.1.2.1.2.2.1.10.21")*8*100/oid("1.3.6.1.2.1.2.2.1.5.21")

From there I applied this function to a probe

Probe
Available: Bandwidth()
Error: if(Bandwidth()<50, "", concatenate("Bandwidth Utilization is at ", array(Bandwidth()),"%")
Value: Bandwidth()
Unit:
Rate: none

The does work in the fact that it does return a percentage, and when that percentage is passed I receive an email stating that percentage has passed and it gives me what the current percentage is.

The two problems are that this percentage does not match up with the link status given by The Dude in the network map, nor does it line up with the percentage shown on the port in the switch's web based console. Second, because these OIDs are counters if I watch this in real time in The Dude, I can see the percentage start low and then get higher and higher for 90 seconds until the next poll interval when it drops and starts again. Is there a way for it to give an average of the poll interval to show more accurate data?
 
tomislav91
Member
Member
Posts: 303
Joined: Fri May 26, 2017 12:47 pm

Re: Probe Thread

Thu Oct 22, 2020 3:16 pm

ping over200 dude.jpg
I wanted to get an info message when there is a ping more than 250ms on isp to know and change to another ISP mannualy.
Why this dont work? I didnt get any notification....
You do not have the required permissions to view the files attached to this post.
 
aleab
Member Candidate
Member Candidate
Posts: 110
Joined: Sat Sep 22, 2018 6:13 pm

Re: Probe Thread

Fri Feb 12, 2021 11:56 pm

Hello,
i would monitor client connected to wifi so i setup dude with this rules

dude - functions
new
name: client_wifi_function
code: ros_command("/interface wireless registration-table print count-only")

dude - probes
new

name: client_wifi_probe
type: function
agent: default

available: client_wifi_function()
error: if(client_wifi_function(), "", "down")
value: client_wifi_function()
unit: Client

work correctly, but when mikrotik have nobody connected to wifi (tipically when office is close) probe result down.
can i setup probe without error?
in other words probes never mark as down...

i tried various error ,like
error: if(client_wifi_function(), "", "")
or
error: if(client_wifi_function()>999, "", "down")
but i have always error or probe not work...

thank you in advance...
 
aleab
Member Candidate
Member Candidate
Posts: 110
Joined: Sat Sep 22, 2018 6:13 pm

Re: Probe Thread

Mon Feb 22, 2021 9:37 am

just for info...

simply i edit in this
available: 1=1

error: if (1>0,"","")

so i have never error :)

thank you again
 
aleab
Member Candidate
Member Candidate
Posts: 110
Joined: Sat Sep 22, 2018 6:13 pm

Re: Probe Thread

Fri Apr 30, 2021 10:21 pm

sorry, i'm here again to ask help....

i try to monitor an asustor NAS with the dude.
i can upload mib on the dude correctly and now get value with snmpwalk .

my goal is monitor CPU and disk status (health)

i create a function with code
oid("iso.org.dod.internet.private.enterprises.asustor.asustorDisk.diskTable.diskEntry.diskTemperature.1")
then i probe this temp and alert me if is too hot.

now i try to do same thing with health
on snmpwalk i find oid and see value as Healthy
create function with code
oid("iso.org.dod.internet.private.enterprises.asustor.asustorDisk.diskTable.diskEntry.diskStatus.1")
but return 0 on data chart
i want as last value Healthy and compare it with a probe.

Thank you in advance
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Probe Thread

Fri Apr 30, 2021 10:27 pm

sorry, i'm here again to ask help....

i try to monitor an asustor NAS with the dude.
i can upload mib on the dude correctly and now get value with snmpwalk .

my goal is monitor CPU and disk status (health)

i create a function with code
oid("iso.org.dod.internet.private.enterprises.asustor.asustorDisk.diskTable.diskEntry.diskTemperature.1")
then i probe this temp and alert me if is too hot.

now i try to do same thing with health
on snmpwalk i find oid and see value as Healthy
create function with code
oid("iso.org.dod.internet.private.enterprises.asustor.asustorDisk.diskTable.diskEntry.diskStatus.1")
but return 0 on data chart
i want as last value Healthy and compare it with a probe.

Thank you in advance
snmpwalk translate raw value to corresponding string,
but if you call the oid, you just have 0 or not 0 as value...
healty from MIB = 0
non-healty = not 0
 
aleab
Member Candidate
Member Candidate
Posts: 110
Joined: Sat Sep 22, 2018 6:13 pm

Re: Probe Thread

Sat May 01, 2021 12:46 am

thank you for reply.
ok i try as you described...

but if I wanted to value can i use ?
oid_raw("..................")

thank you in advance
You do not have the required permissions to view the files attached to this post.
 
aleab
Member Candidate
Member Candidate
Posts: 110
Joined: Sat Sep 22, 2018 6:13 pm

Re: Probe Thread

Sat May 01, 2021 1:01 am

ok, i understand
if i create a probe as in the attachement.

probe is ok when is Healthy, but return error when is "not equal" Healthy.
correct?

thank you
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Probe Thread

Sat May 01, 2021 1:16 am

ok, i understand
if i create a probe as in the attachement.

probe is ok when is Healthy, but return error when is "not equal" Healthy.
correct?

thank you
Probably.. yes... but I do not have any device to test directly simulating not-healt status...

The string (non raw) values can be Healthy / Normal / Risky / Dangerous / Bad

ehm.. sorry for my english...

Healty = like new disk
Normal = like used, but with full functionality
Risky = Something on S.M.A.R.T. pre advise problems like end of expected lifetime
Dangerous = near broken disk (from S.M.A.R.T. or too many bad sectors)
Bad = the disk is gone

iso.org.dod.internet.private.enterprises.asustor.asustorDisk.diskTable.diskEntry.diskStatus.1 = disk 1 (1.1.3.6.1.4.1.44738.4.1.1.5.1)
iso.org.dod.internet.private.enterprises.asustor.asustorDisk.diskTable.diskEntry.diskStatus.2 = disk 2 (1.1.3.6.1.4.1.44738.4.1.1.5.2)

some other values can be see for volumes (iso.org.dod.internet.private.enterprises.asustor.asustorVolume.volumeTable.volumeEntry.volumeStatus.x):
Healthy
Clean
Active
Resyncing
Recovering
Reshaping
Appending
Migrating
fsExpanding
fsIniting
Degraded
Failed
Inactive

the respective volume name can be read with iso.org.dod.internet.private.enterprises.asustor.asustorVolume.volumeTable.volumeEntry.volumeName.x

with
iso.org.dod.internet.private.enterprises.asustor.1.sysAsustorID.0
you can check is is available new version of internal ADM
Possible string values: Available / Unavailable

and you can put on device appearance / label the function:
[Device.Name]
[device_performance()][rex_adm_available()]
[Device.ServicesDown]
(your must differ for mine because I replace original)

function name: rex_adm_available()
function:
if ( oid("iso.org.dod.internet.private.enterprises.asustor.1.sysAsustorID.0") = "Available"
, "Aggiornamento ADM disponibile"
, ""
)
Last edited by rextended on Sun May 02, 2021 11:13 pm, edited 1 time in total.
 
aleab
Member Candidate
Member Candidate
Posts: 110
Joined: Sat Sep 22, 2018 6:13 pm

Re: Probe Thread

Sun May 02, 2021 12:16 am

thank you!!!!

i try and for now i use this way (monitor volume instead disk)

on VolumeStatus – 4 = Healthy (snmpwalk) right click
create probe
name asustor_volume_status_healthy
type SNMP
agent default
snmp profile v2-public
oid iso.org.dod.internet.private.enterprises.asustor.asustorVolume.volumeTable.volumeEntry.volumeStatus.1
oid type octet string
compare method ==(equal)
string value healthy

now i check also firmware and disk
thank you again
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Probe Thread

Fri May 07, 2021 2:52 pm

Don't ask for random things that have nothing to do with it.

Chose another forum.
 
rfwilliams
just joined
Posts: 1
Joined: Tue Jun 08, 2021 3:08 pm

Re: Probe Thread

Tue Jun 29, 2021 9:28 pm

After a little research, I have found a method for polling the Amazon Alexa (Echo, Echo Dot) devices on a network. There are a few ports open, but the listed ports I could find did little good. The open port I did find, that seems to work, is as follows;

#Amazon Echo Probe
Name = Amazon Echo
Type = TCP
Agent = default
Port = 55442
Send = \n
Receive = ^.

I hope this saves someone a little time.
 
User avatar
Masyanich
Frequent Visitor
Frequent Visitor
Posts: 50
Joined: Mon Jan 21, 2013 8:19 am
Location: Russian province
Contact:

Re: Probe Thread

Mon Oct 17, 2022 1:06 pm

Hello!
I got a value to be like 90BLABLABLA from some oid, how can i use only number (in this example 90)(without BLABLA) in functions?
 
jbfavre
just joined
Posts: 20
Joined: Mon Mar 17, 2014 11:10 am

Re: Probe Thread

Mon Feb 13, 2023 12:19 pm

Hello everyone,
I'm trying to monitor my network Connectivity using RouterOS netwatch & Dude.
Here's my routeros setup:
/tool/netwatch/add name="ipv4.google.com" host=8.8.8.8
This properly reflect my IPv4 Connectivity.
On Dude side, I setup a custom function as follow:
Name: netwatch_ipv4
Description: Netwatch to check IPv4 Connectivity
Code: ros_command(":put ([/tool netwatch print as-value where name=\"ipv4.google.com\"]->0->\"status\")")
Expected output is either "up" or "down" depending on /tool/netwatch status.

Then, I set up a probe:
Name: IPv4 Connectivity
Type: Function
Agent: default
Available: netwatch_ipv4() = "up"
Error: if(netwatch_ipv4() = "up", "", "down")
Value: if(netwatch_ipv4() = "up", 1, 0)
Finally, I also used Labels to visually check what's going on:
function
->[netwatch_ipv4()]<-
function + if
->[if(netwatch_ipv4()="up","up","down")]<-
ros_command
->[ros_command(":put ([/tool netwatch print as-value where name=\"ipv4.google.com\"]->0->\"status\")")]<-
ros_command + if
->[if(ros_command(":put ([/tool netwatch print as-value where name=\"ipv4.google.com\"]->0->\"status\")")="up", "up", "down")]<-
Actual output is:
function
->up
<-
function + if
->up<-
ros_command
->up
<-
ros_command + if
->up<-
So far, so good. Let's test un unreachable IP address:
/tool/netwatch/set 1 host=172.16.0.100
Expected output
function
->down
<-
function + if
->down<-
ros_command
->down
<-
ros_command + if
->down<-
Actual output:
function
->down
<-
function + if
->up<-
ros_command
->down
<-
ros_command + if
->up<-
And my probe keeps being up.

Apparently, the `if` function doesn't work the way I'm expecting it.
What am I missing ?
 
Atentaduh
newbie
Posts: 32
Joined: Wed Dec 14, 2011 3:34 pm

Re: Probe Thread

Fri Feb 24, 2023 6:11 pm

Dear The Dude Forum

Is it possible to monitor a https webserver?

this is for the http version
HEAD / HTTP/1.0\r\n\r\n

^HTTP/1\\.

can it be changed to https?
 
sikkim87
just joined
Posts: 1
Joined: Mon May 22, 2023 9:56 pm
Location: Switzerland

Re: Probe Thread

Mon May 22, 2023 10:12 pm

\x1b\00000000000000000000000000000000000000000000000
The probe on UDP port 123 (NTP) above does not seem to work anymore?

I tested on time.cloudflare.com
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Probe Thread

Tue May 23, 2023 10:35 am

...
 
warfy
just joined
Posts: 4
Joined: Fri Aug 19, 2022 7:20 am

Re: Probe Thread

Thu Jun 15, 2023 6:13 am

I've been attempting to make a function / probe for an APC UPS. Got stuck for a little bit figuring out the syntax. But I think I've got it. Two functions, and a probe listed below.

this is the function:
name: apc_status
if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=1),"Running OK",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=2),"High line voltage",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=3),"Brownout",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=4),"Loss of mains power",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=5),"Small temporary power drop",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=6),"Large temporary power drop",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=7),"Small Spike",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=8),"Large spike",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=9),"UPS self test",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=10),"Excessive input voltage fluctuation","No Data")))))))))))))))))))

This next function returns a 0 for working status and a 1 for a fault status for use in a probe
name: apc_probe
if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=1),"0",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=2),"1",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=3),"1",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=4),"1",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=5),"1",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=6),"1",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=7),"1",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=8),"1",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=9),"0",
(if((oid("1.3.6.1.4.1.318.1.1.1.3.2.5.0")=10),"1","0")))))))))))))))))))

Probe:
type: function
available: if(apc_probe()=0,"True","")
Error: if(apc_probe()=1,apc_status(),"")
Value: apc_status()

Who is online

Users browsing this forum: No registered users and 14 guests