and the device label will show the number of CPU's in the system and the load on each separate CPU (for example: 'Load on 4 CPU('s): 12, 15, 46, 2').Load on [array_size(oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad"))] CPU('s): [oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad")]
What do you mean? Status like 'up' or 'down' (perhaps for external disks)? Or status like '80% full'?Are there any probes to check the disk status?
with a raid 5 i want to check if al disk are oke,What do you mean? Status like 'up' or 'down' (perhaps for external disks)? Or status like '80% full'?Are there any probes to check the disk status?
By itself that is not possible. The OS (and thus the standard SNMP agent) just sees a RAID-set as a 'single disk'. It wouldn't know the status of any of its sub-parts. However, I do know that for example IBM ServeRAID adapters allow you to install the IBM ServeRAID Manager program, which optionally includes an additional SNMP agent. That makes RAID-info available through SNMP and thus to the Dude.with a raid 5 i want to check if al disk are oke,
So when one of the disks go down i gets a notification
I have a question about this probeCheck 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.
So, what I am thinking is that something like this should detect a rogue on the wire and if I have notifications setup for this, I should get a near immediate alert when it is detected. Does anyone have any input or suggestions, I'm open to them.name: dhcp probe..............................................//just a name
type:snmp......................................//may or may not be the right way to go
oid: 1.3.6.1.4.1.5.1.1.55.1.1.22........................//DhcpSrvDomainServer IpAddress used to match against known dhcp server address
oid type: IP Address
compare method: !=(not equal)...........................//this will provide my comparison
ip address:xxx.xxx.xxx.xxx................................//ip addy of known dhcp server
Nice, but not entieryly correct (I suspect copy-paste error ): established TCP connections is on oid("1.3.6.1.2.1.6.9.0")<snip>
function
tcp_currestab
number of tcp established or closewait connections
oid("1.3.6.1.2.1.6.12.0")
<snip>
for exapmle - what to do to monitor oper state of first port on switch DLink DES 3526:Thanks, its a port on a switch and a router I need to moniter
Regards
Breazer
The function "string_substring" you may use basically with string variables. With "concatenate" you can put them together.
NAME: Disk1UsedSpace
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)
ERROR: 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<80, "", concatenate("Disk 1 (", string_substring(oid("1.3.6.1.2.1.25.2.3.1.3.1"),0,2), ") used space is currently at (", string_substring (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 , ") % "))
VALUE: (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
UNIT: %
RATE: none
Did I need string_substring in there?
I suppose - not the best documentation - is the price we have to pay for this great piece of software For my share I misinterpret the AVAILABLE line at the beginning. First I thought only if the AVAILABLE line is true, the ERROR line will be done. But with some tests I saw that this is wrong. Somewhere I read it will be used for the DISCOVER function. But to your questions:Is there a manual that shows what all the parameters for AVAILABLE and ERROR are? For example, the second set of quotes in ERROR is acting as a placeholder, but for what? Or in the AVAILABLE what is the 0,1,-1 at the end? I'm assuming these are LOGICAL operators but would love to know where to find a list of all the combinations.
That should be possible. Adamd292 showed a similar example a few posts above. I also changed the outfit of devices on the map. They show additional the uptime of the device. I may give you proper information when I'm back in the office after Christmas.In regards to my disk percentage number, is there a way to get that to display in the interface? Right now when my circle turns orange, it simply tells me that disk1usedspace is the problem, but I would think I could get it to say the % as well.
You must be mistaken, I haven't wrote an probe/function which checks the status of all disks together. But it is an interesting idea. Maybe something for 2009Finally, and I think you answered this in your previous post but I didn't understand the answer, is there a way to make an NAME:Alldisksusedspace check whereupon we use arrays to look at all disk percentages, and if any of them is over 80% used it alerts? I went and made disk1, disk2, disk3, and disk4 alerts and apply them as appropriate since I needed to get this up and running, but I really don't care WHAT disk flags as an alert for me. Whichever one flags will cause me to have to investigate, so that is why I wonder if i can use some type of array concept.
if(
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:")<>4294967295,
string_substring(
(
1
- oid(
concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageUsed.",
array_find(
oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_substring(
oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"),
string_find(
oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
",",
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"))
- string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:")
)
)
+1)
)
/ oid(
concatenate("iso.org.dod.internet.mgmt.mib-2.host.hrStorage.hrStorageTable.hrStorageEntry.hrStorageSize.",
array_find(
oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_substring(
oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"),
string_find(
oid_column("1.3.6.1.2.1.25.2.3.1.3",600),
",",
string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:"))
- string_find(oid_column("1.3.6.1.2.1.25.2.3.1.3",600),"C:")
)
)
+1)
)
)*100,
0,
4)
,
""
)
ros_function("/ip hotspot active print count-only")
Omega, I had this problem also and decided to just monitor the qty of wireless clients connected which seems to be a pretty indicative figure for the hotspot users. Obviously if you need to do non-wireless hotspot connections this will not help.Hello all,
Was working on a simple hotspot user count function to be part of a graph similar to the one shown in (http://www.tiktube.com/?video=206) but obviously monitoring hotspot rather than pppoe.
The function is simple, justbut in practice the polling of it only works for a couple of hours then stops probing and gives no results.Code: Select allros_function("/ip hotspot active print count-only")
If I modify the query (for example using the line above as a script on the router and calling the script in the function instead) I can get it displaying results again but sure enough after a couple of hours it just stops again.
The other graphs I have on my chart (snmp ones) continue to function with no problem.
any ideas? Am running Dude 3.1 and polling an RB1000 running 3.20
I don't quite know if this is right or not. When I type this in, it works, but when I try to trip it by setting the 350 in the error line to 100 or 50 or even 1000, it still says ok when it should fail. My question is with the syntax. If I am reading this correctly, then for the error line is says " if "OID" < (is less than) 350, ""(don't know what this part means), "Over Temp 95". If that is true then, shouldn't it use the other sign (>), so it reads "greater than?" Also, I have found that on my system, the OID is a little different than what you have, i.e. iso.3.6.1.4.1.674.10892.1.700.20.1.6.1.1. Has anyone else tried this? Thanks!Dell temperature alert if it gets over 95
available
if(oid("iso.3.6.1.4.1.674.10892.1.700.20.1.6.1.3")>0, 1, -1)
error
if(oid("iso.3.6.1.4.1.674.10892.1.700.20.1.6.1.3")<350, "", "Over Temp 95")
value
iso.3.6.1.4.1.674.10892.1.700.20.1.6.1.3
C
none
I can't think of any way to do it. The method below doesn't seem any good, I have never seen "regular expressions" or variables used in functions...Help!I hope get counter of all running programm that name is match condition.How?
array_find only find out the first match running programm,but not all.such as:
I hope can get counter of svchost.exe in a running computer system.
How??
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.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.
network-clock-participate wic 3
network-clock-select 1 T1 0/3/0
!
controller T1 0/3/0
framing esf
linecode b8zs
pri-group timeslots 1-24 service mgcp
!
interface Serial0/3/0:23
no ip address
isdn switch-type primary-ni
isdn incoming-voice voice
isdn map address 011* plan unknown type unknown
isdn bind-l3 ccm-manager
no cdp enable
!
voice-port 0/3/0:23
!
Me too, cool probe by Julian, though I guess you would need to identify the oid for your servers, right?. Since it didn't matter what device used the probe, everything failed when they indeed had 40GB freeHi everyone,
I'm new to the Dude too and I'm trying to set up the win_diskc_free_percent probe as defined by pjulian Feb.10.2009 in this thread. I have the SNMP community defined correctly and I can do an SNMP walk from The Dude to my servers. I created the function exactly as pjulian describes and same for the probes. Doesn't work for the MB or % probe. It applies the probe but always shows as 'down' for all servers meaning the disk space is low even though it is not. I'm using The Dude v3.5 and have all Dell poweredge servers.
Can anyone shed some light on why this isn't working for me? I would be very appreciative.
Thank you!
BTW - very cool tool this Dude, if only I can get this working...
Now make the probes:<?xml version="1.0" ?>
<dude version="3.6">
<Function>
<sys-type>57</sys-type>
<sys-name>toner1</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.1")/oid("1.3.6.1.2.1.43.11.1.1.8.1.1"),0,4)*100</code>
<descr>the first toner index for HP Laserjet and XEROX Workcentre (usually black)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>toner2</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.2")/oid("1.3.6.1.2.1.43.11.1.1.8.1.2"),0,4)*100</code>
<descr>the second toner index for HP Laserjet and XEROX Workcentre (usually yellow, for XEROX Phaser4510 it's the Maintenance Kit status</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>toner3</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.3")/oid("1.3.6.1.2.1.43.11.1.1.8.1.3"),0,4)*100</code>
<descr>the third toner index for HP Laserjet and XEROX Workcentre (usually magenta)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>toner4</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.4")/oid("1.3.6.1.2.1.43.11.1.1.8.1.4"),0,4)*100</code>
<descr>the fourth toner index for HP Laserjet and XEROX Workcentre (usually cyan)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>xerox_drum</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.24")/oid("1.3.6.1.2.1.43.11.1.1.8.1.24"),0,4)*100</code>
<descr>calculates the remaining life for the drum cartridge for XEROX Workcentre printers</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>paper1</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.8.2.1.10.1.1")/oid("1.3.6.1.2.1.43.8.2.1.9.1.1"),0,4)*100</code>
<descr>the first paper tray for XEROX workcentre (usually A3)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>paper2</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.8.2.1.10.1.2")/oid("1.3.6.1.2.1.43.8.2.1.9.1.2"),0,4)*100</code>
<descr>the second paper tray for XEROX workcentre (usually A4)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>paper3</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.8.2.1.10.1.3")/oid("1.3.6.1.2.1.43.8.2.1.9.1.3"),0,4)*100</code>
<descr>the third paper tray for XEROX workcentre (usually A4)</descr>
</Function>
</dude>
<?xml version="1.0" ?>
<dude version="3.6">
<Probe>
<sys-type>13</sys-type>
<sys-name>paper_1</sys-name>
<typeID>8</typeID>
<functionAvailable>paper1()</functionAvailable>
<functionError>if (paper1() > 0, "" , concatenate("PAPER " ,oid("1.3.6.1.2.1.43.8.2.1.13.1.1") , " (", oid("1.3.6.1.2.1.43.8.2.1.12.1.1") , ") is empty" ))</functionError>
<functionValue>paper1()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>paper_2</sys-name>
<typeID>8</typeID>
<functionAvailable>paper2()</functionAvailable>
<functionError>if (paper2() > 0, "" , concatenate("PAPER " ,oid("1.3.6.1.2.1.43.8.2.1.13.1.2") , " (", oid("1.3.6.1.2.1.43.8.2.1.12.1.2") , ") is empty" ))</functionError>
<functionValue>paper2()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>paper_3</sys-name>
<typeID>8</typeID>
<functionAvailable>paper3()</functionAvailable>
<functionError>if (paper3() > 0, "" , concatenate("PAPER " ,oid("1.3.6.1.2.1.43.8.2.1.13.1.3") , " (", oid("1.3.6.1.2.1.43.8.2.1.12.1.3") , ") is empty" ))</functionError>
<functionValue>paper3()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Toner_1</sys-name>
<typeID>8</typeID>
<functionAvailable>toner1()</functionAvailable>
<functionError>if (toner1() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.1") , " has less than 10% remaining" ))</functionError>
<functionValue>toner1()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Toner_2</sys-name>
<typeID>8</typeID>
<functionAvailable>toner2()</functionAvailable>
<functionError>if (toner2() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.2") , " has less than 10% remaining" ))</functionError>
<functionValue>toner2()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Toner_3</sys-name>
<typeID>8</typeID>
<functionAvailable>toner3()</functionAvailable>
<functionError>if (toner3() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.3") , " has less than 10% remaining" ))</functionError>
<functionValue>toner3()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Toner_4</sys-name>
<typeID>8</typeID>
<functionAvailable>toner4()</functionAvailable>
<functionError>if (toner4() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.4") , " has less than 10% remaining" ))</functionError>
<functionValue>toner4()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Xerox_Drum</sys-name>
<typeID>8</typeID>
<functionAvailable>xerox_drum()</functionAvailable>
<functionError>if (xerox_drum() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.24") , " has less than 10% remaining" ))</functionError>
<functionValue>xerox_drum()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
</dude>
[Device.Name]
Toner levels:
Black: [toner1()]%
Yellow: [toner2()]%
Magenta: [toner3()]%
Cyan: [toner4()]%
Drum Cartridge
Condition: [xerox_drum()]%
Paper Levels:
A3 white: [paper1()]%
A4 white: [paper3()]%
Corp Paper: [paper2()]%
'loggeduser.vbs
' Sample VBScript to discover which user is logged on
' Author Guy Thomas and John Eck
' Version 2.5 - December 2005
' -------------------------------------------------------'
'Modified by gsandul to logon to remote host using
'username and password specified from command line
'
Set objPassword = CreateObject("ScriptPW.Password")
'strComputer = "192.168.0.60"
'You can uncomment the following 3 lines and
'specify hardcoded domain, username and password
'strDomain = "WORKGROUP"
'strUser = "gsandul"
'strPassword = "SuperPass"
strComputer = wscript.arguments(0)
'If you hardcoded domain, username and password
'comment the following 3 lines
strDomain = wscript.arguments(1)
strUser = wscript.arguments(2)
strPassword = wscript.arguments(3)
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _
"root\CIMV2", _
strUser, _
strPassword, _
"MS_409", _
"NTLMDomain:" + strDomain)
' You suppose to be authentificated
' Now you can write any WMI function
Set colComputer = objWMIService.ExecQuery ("Select * from Win32_ComputerSystem")
For Each objComputer in colComputer
If not objComputer.UserName = "" Then
strLogonUser = Split(objComputer.UserName,"\")
strLogonUser(1) = UCase(Left(strLogonUser(1),1))& Trim(Mid(strLogonUser(1),2,20))
Wscript.Echo strLogonUser(1)
Else
Wscript.Echo "No_one_is_logged"
End If
Next
' End of Sample Logged on VBScript
cscript //NoLogo C:\dudescr\loggeduser.vbs IPAddress DomainName UserName Password
concatenate(device_property("FirstAddress")," ",device_property("CustomField3")," ",device_property("UserName")," ",device_property("Password"))
array_element(execute("cscript.exe",concatenate("//NoLogo C:\dudescr\loggeduser.vbs ",User_Pass()),"C:\WINDOWS\system32\"),1)
CPU Load 5sec /1min/ 5min: [oid("1.3.6.1.4.1.9.9.109.1.1.1.1.3.1")] / [oid("1.3.6.1.4.1.9.9.109.1.1.1.1.4.1")] / [oid("1.3.6.1.4.1.9.9.109.1.1.1.1.5.1")]
Memory Free/Used: [round((oid("1.3.6.1.4.1.9.9.48.1.1.1.6.1")/1024)/1024)]MB / [round((oid("1.3.6.1.4.1.9.9.48.1.1.1.5.1")/1024)/1024)]MB
Total Connections: [oid("1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6")]
[Device.Name] | [device_performance()]Up - [Device.ServicesUp] | Down - [Device.ServicesDown]
Disk Space: C:\=[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.1")-oid("1.3.6.1.2.1.25.2.3.1.6.1"))*oid("1.3.6.1.2.1.25.2.3.1.4.1"))/1024)/1024)/1024)]/[round(((oid("1.3.6.1.2.1.25.2.3.1.5.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024)/1024)/1024)] GB D:\=[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.3")-oid("1.3.6.1.2.1.25.2.3.1.6.3"))*oid("1.3.6.1.2.1.25.2.3.1.4.3"))/1024)/1024)/1024)]/[round(((oid("1.3.6.1.2.1.25.2.3.1.5.3")*oid("1.3.6.1.2.1.25.2.3.1.4.3")/1024)/1024)/1024)] GB
Normis, can u help me? How to make a function that connects via FTP, passing username and password, then copy a file folder location to the destination user (PUT)?
I do not know how to do that, maybe Lebowski or Gsandul can helpNormis, can u help me? How to make a function that connects via FTP, passing username and password, then copy a file folder location to the destination user (PUT)?
For sure, I can help, but I need to know what do you meanI do not know how to do that, maybe Lebowski or Gsandul can help
Just explain how do you plan to use it.function that connects via FTP
You should involve user and password in any case, so I do not see the difference in specifying password in a script and in The Dude. Specifying password in The Dude is not more secure, than specifying password in the script.in this case, involves users and passwords from other agencies and the security policy does not allow to be done this way. The ideal would be a function inside on the dude.
The code for Logged_User in 3.6 was:With Dude 4 beta2 the "Logged User" Script/Function doesn't work anymore. Any ideas ?
array_element(execute("cscript.exe",concatenate("//NoLogo C:\dudescr\loggeduser.vbs ",User_Pass()),"C:\WINDOWS\system32\"),1)
array_element(execute("cscript.exe",concatenate("//NoLogo C:\\dudescr\\loggeduser.vbs ",User_Pass()),"C:\\WINDOWS\\system32\\"),1)
Cisco ASA 5510 - Performance
Code: Select allCPU Load 5sec /1min/ 5min: [oid("1.3.6.1.4.1.9.9.109.1.1.1.1.3.1")] / [oid("1.3.6.1.4.1.9.9.109.1.1.1.1.4.1")] / [oid("1.3.6.1.4.1.9.9.109.1.1.1.1.5.1")] Memory Free/Used: [round((oid("1.3.6.1.4.1.9.9.48.1.1.1.6.1")/1024)/1024)]MB / [round((oid("1.3.6.1.4.1.9.9.48.1.1.1.5.1")/1024)/1024)]MB Total Connections: [oid("1.3.6.1.4.1.9.9.147.1.2.2.2.1.5.40.6")]
Windows Disk Space: Free/Total
Code: Select allDisk Space: C:\=[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.1")-oid("1.3.6.1.2.1.25.2.3.1.6.1"))*oid("1.3.6.1.2.1.25.2.3.1.4.1"))/1024)/1024)/1024)]/[round(((oid("1.3.6.1.2.1.25.2.3.1.5.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024)/1024)/1024)] GB D:\=[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.3")-oid("1.3.6.1.2.1.25.2.3.1.6.3"))*oid("1.3.6.1.2.1.25.2.3.1.4.3"))/1024)/1024)/1024)]/[round(((oid("1.3.6.1.2.1.25.2.3.1.5.3")*oid("1.3.6.1.2.1.25.2.3.1.4.3")/1024)/1024)/1024)] GB
Yes it worked! THANX!See how I changed the last # in each of the OIDs from 1 to 2? That is the next drive in the system... Since this is hard coded the drive it is pointing to is incorrect for your server. The best way to see what OID your drive "C" is on is to start an SNMPwalk using the sub tree of 1.3.6.1.2.1.25.2.3.1.
C:\=[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.2")-oid("1.3.6.1.2.1.25.2.3.1.6.2"))*oid("1.3.6.1.2.1.25.2.3.1.4.2"))/1024)/1024)/1024)]/[round(((oid("1.3.6.1.2.1.25.2.3.1.5.2")*oid("1.3.6.1.2.1.25.2.3.1.4.2")/1024)/1024)/1024)] GB
HTH
Lebowski
Because I was tired of running after printers that run out of toner and/or paper (and people calling me for not fixing this) I created the following probes/functions to help me with that
Monitoring toner and paper levels for me and warning me if one drops below 10% (the paper level has only 5 sensors, it seems, 100,75,50,25 and empty but even that helps (see attachment for appearance)
It even polls the name of the Toner/Paper tray by SNMP and puts it in the Error Description so you can use it in automatic alarms (email, etc...)
first create some functions to poll the toner levels, paper levels and the maintenance kit's (drum) condition:
Now make the probes:<?xml version="1.0" ?>
<dude version="3.6">
<Function>
<sys-type>57</sys-type>
<sys-name>toner1</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.1")/oid("1.3.6.1.2.1.43.11.1.1.8.1.1"),0,4)*100</code>
<descr>the first toner index for HP Laserjet and XEROX Workcentre (usually black)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>toner2</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.2")/oid("1.3.6.1.2.1.43.11.1.1.8.1.2"),0,4)*100</code>
<descr>the second toner index for HP Laserjet and XEROX Workcentre (usually yellow, for XEROX Phaser4510 it's the Maintenance Kit status</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>toner3</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.3")/oid("1.3.6.1.2.1.43.11.1.1.8.1.3"),0,4)*100</code>
<descr>the third toner index for HP Laserjet and XEROX Workcentre (usually magenta)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>toner4</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.4")/oid("1.3.6.1.2.1.43.11.1.1.8.1.4"),0,4)*100</code>
<descr>the fourth toner index for HP Laserjet and XEROX Workcentre (usually cyan)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>xerox_drum</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.11.1.1.9.1.24")/oid("1.3.6.1.2.1.43.11.1.1.8.1.24"),0,4)*100</code>
<descr>calculates the remaining life for the drum cartridge for XEROX Workcentre printers</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>paper1</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.8.2.1.10.1.1")/oid("1.3.6.1.2.1.43.8.2.1.9.1.1"),0,4)*100</code>
<descr>the first paper tray for XEROX workcentre (usually A3)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>paper2</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.8.2.1.10.1.2")/oid("1.3.6.1.2.1.43.8.2.1.9.1.2"),0,4)*100</code>
<descr>the second paper tray for XEROX workcentre (usually A4)</descr>
</Function>
<Function>
<sys-type>57</sys-type>
<sys-name>paper3</sys-name>
<code>string_substring(oid("1.3.6.1.2.1.43.8.2.1.10.1.3")/oid("1.3.6.1.2.1.43.8.2.1.9.1.3"),0,4)*100</code>
<descr>the third paper tray for XEROX workcentre (usually A4)</descr>
</Function>
</dude><?xml version="1.0" ?>
<dude version="3.6">
<Probe>
<sys-type>13</sys-type>
<sys-name>paper_1</sys-name>
<typeID>8</typeID>
<functionAvailable>paper1()</functionAvailable>
<functionError>if (paper1() > 0, "" , concatenate("PAPER " ,oid("1.3.6.1.2.1.43.8.2.1.13.1.1") , " (", oid("1.3.6.1.2.1.43.8.2.1.12.1.1") , ") is empty" ))</functionError>
<functionValue>paper1()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>paper_2</sys-name>
<typeID>8</typeID>
<functionAvailable>paper2()</functionAvailable>
<functionError>if (paper2() > 0, "" , concatenate("PAPER " ,oid("1.3.6.1.2.1.43.8.2.1.13.1.2") , " (", oid("1.3.6.1.2.1.43.8.2.1.12.1.2") , ") is empty" ))</functionError>
<functionValue>paper2()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>paper_3</sys-name>
<typeID>8</typeID>
<functionAvailable>paper3()</functionAvailable>
<functionError>if (paper3() > 0, "" , concatenate("PAPER " ,oid("1.3.6.1.2.1.43.8.2.1.13.1.3") , " (", oid("1.3.6.1.2.1.43.8.2.1.12.1.3") , ") is empty" ))</functionError>
<functionValue>paper3()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Toner_1</sys-name>
<typeID>8</typeID>
<functionAvailable>toner1()</functionAvailable>
<functionError>if (toner1() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.1") , " has less than 10% remaining" ))</functionError>
<functionValue>toner1()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Toner_2</sys-name>
<typeID>8</typeID>
<functionAvailable>toner2()</functionAvailable>
<functionError>if (toner2() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.2") , " has less than 10% remaining" ))</functionError>
<functionValue>toner2()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Toner_3</sys-name>
<typeID>8</typeID>
<functionAvailable>toner3()</functionAvailable>
<functionError>if (toner3() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.3") , " has less than 10% remaining" ))</functionError>
<functionValue>toner3()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Toner_4</sys-name>
<typeID>8</typeID>
<functionAvailable>toner4()</functionAvailable>
<functionError>if (toner4() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.4") , " has less than 10% remaining" ))</functionError>
<functionValue>toner4()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
<Probe>
<sys-type>13</sys-type>
<sys-name>Xerox_Drum</sys-name>
<typeID>8</typeID>
<functionAvailable>xerox_drum()</functionAvailable>
<functionError>if (xerox_drum() > 10, "" , concatenate(oid("1.3.6.1.2.1.43.11.1.1.6.1.24") , " has less than 10% remaining" ))</functionError>
<functionValue>xerox_drum()</functionValue>
<functionUnit>%</functionUnit>
</Probe>
</dude>
To get it to show nicely on the map I put this into "appearance" instead of link levels:[Device.Name]
Toner levels:
Black: [toner1()]%
Yellow: [toner2()]%
Magenta: [toner3()]%
Cyan: [toner4()]%
Drum Cartridge
Condition: [xerox_drum()]%
Paper Levels:
A3 white: [paper1()]%
A4 white: [paper3()]%
Corp Paper: [paper2()]%
The more I do with the Dude the more I love it!
Thanks to all the contributors!
???When we will see next version of the Dude?
Yes! errpt.cmd delivers only one attribute, a number from 0-65535@steen Do you want the first element?
Code: array_element(execute("C:\errpt.cmd"),0)
Broke, bad. I am using Dude 3.6. How do I workaround it ?I put [execute("c:\test.bat")] on a device label and saw " -1,, " it seems like execute is broke! test.bat contained @echo 3
Thanks, strange things start to happen, I run 3.6, I got the counter value out, but also error message about host does not exist.This worked on a device label!
[execute("test.bat",1,"c:\\")]
You can't put the path in the command and as above you need to escape the backslash for version 4.x I suppose...
I want the 1st result. Also I did try with 0 same result, flag is red.Not sure about the host thing but you did recognize you want the 2nd result? at least in 4.x it is the 2nd result.
array_element(execute("test.bat",1,"c:\\"),1)
strangely enough, since i too still continue cell phone spy software to experience that very problem. i tried to reinstall 3.6. but nothing made any difference..Thanks, strange things start to happen, I run 3.6, I got the counter value out, but also error message about host does not exist.This worked on a device label!
[execute("test.bat",1,"c:\\")]
You can't put the path in the command and as above you need to escape the backslash for version 4.x I suppose...
When the script is executed from command line all works and no output about host does not exist arrives so that must come from dude. Any more suggestions ?
This will return service stateThis works fine with stopped service, but not paused.
if(array_find(oid_column("1.3.6.1.4.1.77.1.2.3.1.1"),"Netlogon")>0, 1, 0)
if(array_find(oid_column("1.3.6.1.4.1.77.1.2.3.1.1"),"Netlogon")>0, "", "Netlogon not detected by SNMP probe")
array_element(oid_column_raw("1.3.6.1.4.1.77.1.2.3.1.3"),array_find(oid_column("1.3.6.1.4.1.77.1.2.3.1.1"),"Netlogon"))
Thanks! It really worked!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.
Name: ast_version
Description: Text version string of the version of Asterisk that the SNMP Agent was compiled to run against.
Code: oid("1.3.6.1.4.1.22736.1.1.1.0")
--------------------------------------------------------------------------------
Name: ast_version
Description: Time ticks since Asterisk was started.
Code: oid("1.3.6.1.4.1.22736.1.2.1.0")
--------------------------------------------------------------------------------
Name: ast_reload_time
Description: Time ticks since Asterisk was last reloaded.
Code: oid("1.3.6.1.4.1.22736.1.2.2.0")
--------------------------------------------------------------------------------
Name: ast_active_calls
Description: The number of calls currently active on the Asterisk PBX.
Code: oid("1.3.6.1.4.1.22736.1.2.5.0")
--------------------------------------------------------------------------------
Name: ast_info
Description: Asterisk ToolTip Information (version, uptime, reload time, active calls, etc.). NOTE: Monitored device must be assigned the device type"Asterisk PBX" in order to show this info in the tooltip.
Code: if(not(string_find(device_property("Type"), "Asterisk PBX")),
concatenate(
concatenate(
"Asterisk v", ast_version(), "
", " Uptime: ", ast_uptime(), "
", " ReloadTime: ", ast_reload_time(), "
"),
" Active Calls: ", ast_active_calls(), "
"),
"")
NOTE: Multiple concatenations were needed because there is a limit on how many elements you can concatenate.
NOTE: To use the ast_info as ToolTip, add it to: Global Settings -> Map -> Device Appearance -> Tooltip, just after ros_info() and before the notes. Also note that you need to add a device type named "Asterisk PBX" and assigned to any asterisk device you wish to show the ast_info() for!
Name: astActiveCalls
Type: Function
Available: string_size(ast_active_calls())
Error: if(string_size(ast_active_calls()), "", "down")
Value: ast_active_calls()
Unit: calls
Yes I know its possible on windows installation but my is on RouterOS.If your dude is installed on a windows box, the you could configure a 'execute on server' type of notification which can call a windows tool that does the job. You can pass a bunch of variables to that tool/program.
Also, please post such questions in a different topic. The probe tread is meant for sharing ready to use probes. I think
Thank you.check the fetch tool, i think it can be used to upload a file to a webpage:
/tool fetch user=<> password=<> upload=yes mode=http address=<> src-path="/something/something/page.php"
Hi An Probe picture is attached, hopefullyIs there any way to make HTTP GET request from Dude?
I mean that when device goes down instead of sending mail or other notification, Dude must make Get request.
The Dude installed on routeros
Disk Space: C:\=[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.1")-oid("1.3.6.1.2.1.25.2.3.1.6.1"))*oid("1.3.6.1.2.1.25.2.3.1.4.1"))/1024)/1024)/1024)]/[round(((oid("1.3.6.1.2.1.25.2.3.1.5.1")*oid("1.3.6.1.2.1.25.2.3.1.4.1")/1024)/1024)/1024)] GB D:\=[round(((((oid("1.3.6.1.2.1.25.2.3.1.5.3")-oid("1.3.6.1.2.1.25.2.3.1.6.3"))*oid("1.3.6.1.2.1.25.2.3.1.4.3"))/1024)/1024)/1024)]/[round(((oid("1.3.6.1.2.1.25.2.3.1.5.3")*oid("1.3.6.1.2.1.25.2.3.1.4.3")/1024)/1024)/1024)] GB
I know you would love to just click a couple places and be done well that is not how this is going to go. Typically when you want to monitor a computers hardware SNMP stuff that is not included in the default view you need to add a program that will populate the fields with the data from the hardware you are interested in. With that said double check to see if there is something povided by your hardware vendor.Hello! Can anyone help me with a probe for monitoring S.M.A.R.T. status of HDD? I need this for Windows Server 2008 R2.
SharadeMaybe it's a stupid question, but i'm totally new with the dude So how i can display cpu / memory like in the picture of slech? Disk Space worked fine for me.
'Link-Test.vbs
'This script checks the link status of critical switchports. If no port is down it returns a null. If a switchport is down it returns the interface number.
'
'Usage: cscript link-test.vbs //NoLogo [/d] /i=<x.x.x.x> /p=<a:b:c:d:n>
' //NoLogo specifies the script engine not to output the banner
' /d switches on debug mode
' /i is the IP address of the switch
' /p is a colon delimited list of critical switchport interface numbers
'Set the defaults
Set WshShell = WScript.CreateObject("WScript.Shell")
Dbg=vbFalse
DownPorts=""
SnmpGet="C:\snmpget\snmpget.exe"
'Get the input parameters
ParCount=wscript.arguments.count
For ParNo=0 to (ParCount-1)
ParSwitch=LCase(left(wscript.arguments.item(ParNo),2))
Select Case ParSwitch
Case "/i"
if Dbg Then WScript.Echo ("Processing IP Address :" & wscript.arguments.item(ParNo))
IPAddr=Right(wscript.arguments.item(ParNo),(len(wscript.arguments.item(ParNo))-3))
Case "/p"
if Dbg Then WScript.Echo ("Processing Port Numbers :" & wscript.arguments.item(ParNo))
PortArray=Split(Right(wscript.arguments.item(ParNo),(len(wscript.arguments.item(ParNo))-3)),":")
if Dbg Then WScript.Echo ("Second Port Number:" & PortArray(1))
Case "/d"
Dbg=vbTrue
WScript.Echo ("Debugging output is enabled")
End Select
Next
For Each PortNo in PortArray
if Dbg Then wscript.echo("Port Number = " & PortNo)
PortCommand = chr(34) & SnmpGet & chr(34) & " -q -r:" & IPAddr & " -o:1.3.6.1.2.1.2.2.1.8." & PortNo
if Dbg Then wscript.echo("Command = " & PortCommand)
Set oExec = WshShell.Exec(PortCommand)
PortState = oExec.StdOut.ReadLine
if Dbg Then wscript.echo("Port state = " & PortState)
if not(PortState="1" or PortState="5") then DownPorts = DownPorts & PortNo & ","
Next
wscript.echo(DownPorts)
@echo off
cscript link-test.vbs //NoLogo /i=%1 /p=%2
Hmmm, unfortunately I don't think I am going to be able to help much more.I think this is about dude comparing values; I guess that in the "receive" textbox I should write an regex expression instead of just a simple value...
This didn't work for me when trying to probe a linux-hosted NTP server. Maybe need to send a complete query packet so the server timestamps and returns it?Here try this... [edit] This worked on a Cisco 2800 router and not a 6509. it doesn't seem to work on a windows server. Probably need more of the actual protocol in the send message to get it to work with other devices. I'll work on it some more later.
HTH,
SD
Thank you very much, but this is just an example. (I mean about 10 devices.)Let us know how it goes!
Lebowski
device_property("FirstAddress") <> ""
if(array_element(ping("192.168.1.1"), 0) < 200, "", "RTT > 200ms")
array_element(ping("192.168.1.1"),0)
device_property("FirstAddress") <> ""
if(array_element(ping(device_property("FirstAddress")), 0) < 200, "", "RTT > 200ms")
array_element(ping(device_property("FirstAddress")),0)
So .... I'm not sure that this can be done. I figured out how to create a Probe that returns "up" if a device responds to a ping as follows:In using the Dude, I see that most notifications respond if a state changes from x to y (e.g. up to down or unstable to down).
I want to be notified of success (via email) if a system outside of our network responds to a Ping. We would run this Ping every morning at 6:00am on a set of systems and expect to receive an email that says "everything is OK". If I don't get this email at 6:00am, then I can assume that something is wrong.
The reason we are doing this is because our Dude server and the email server we use to send alerts will not be able to send a text notification if our network is not available. (Or to put it another way, I won't receive a message if our email server can't get to the network to send an email).
I was thinking of a probe that says "if the last time you tried, the system was up and this time the system was up then I will send an email" but have no idea where to start.
Any help or suggestions about where to start would be greatly appreciated.
Create a scheduled task that adds a broken route to the routing table at 5:50am and then another scheduled task that fixes the routing table at 6am. You can run the ping test as a normal probe and it will break and fix every day because the routing table changed and you will get an email when it transitions from down to up (if you configure it that way).I want to be notified of success (via email)
string_substring(
string_substring(
device_property("AddressesCommaList"),
string_find(
device_property("AddressesCommaList"),
","
)+2
),
0,
string_find(
string_substring(
device_property("AddressesCommaList"),
string_find(
device_property("AddressesCommaList"),
","
)+2
),
","
)
)
Sebastian...
And now i modify my probe ping2:
Name: Ping2
Available: if Ping2s <> "False"
Error: if(Ping2s()<>"False",if(Ping2s()<500, "", concatenate("RTT > 500ms", Ping2s(), "ms")), "ping timeout")
Value: array_element(ping(Device2Address()),0)
Unit: ms
...
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.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".
Available: if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"NOTEPAD.EXE")>0, 1, -1)
Many thanks, this worked for our Windows NTP servers too.Here is our ntp probe, tested and working on our ubuntu 12.04 ntpd servers
For ease of copy/paste, here is the 'Send' string:
\x1b\00000000000000000000000000000000000000000000000
Thank you so much for this post. I'd been wrestling with something similar for several hours. Very much appreciated.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.
Hi All,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 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
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.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?
<?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>
This works great but is it possible to monitor if an application is in "Not responding" state?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.
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.Check if a certain program is running
I got this corrected, It took me realizing how the label was created and the sub components that created it.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
Any more info on what you did here as this has been annoying me for a while, too.I got this corrected, It took me realizing how the label was created and the sub components that created it.
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"))
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"
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
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",device_property("Type"),"error")
place this on the device label [oid("1.3.6.1.2.1.2.2.1.8.1")]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"))
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:place this on the device label [oid("1.3.6.1.2.1.2.2.1.8.1")]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"))
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"))
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
Does this work?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:place this on the device label [oid("1.3.6.1.2.1.2.2.1.8.1")]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"))
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"))Accordingly, their writing and in function without "up/down". So this function get correct description by oid port, the state - no.Code: Select alllink 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
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.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"))
Look at execute, you can call other programs/scripts and batch jobs.(Future) request :
How to write a probe / function for a NON SNMP device in Dude,
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 ?Look at execute, you can call other programs/scripts and batch jobs.(Future) request :
How to write a probe / function for a NON SNMP device in Dude,
Can you put a regex that matches door closed in the receive? ~[0-9A-Fa-f]+0F2$ or ~[0-9A-Fa-f]+1F2$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 ?
the Probe is already working for the door sensor.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.
Seriously nice work figuring that all out.~[0-9A-Fa-f]{91}0.*
in the "receive" window of the probe. this works very well and simple.
Call any type of probe from a function would be a great addition.so the Big question would be ;
can you put a TCP probe in a "Function"
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.Seriously nice work figuring that all out.