Community discussions

  • 1
  • 3
  • 4
  • 5
  • 6
  • 7
 
vlazari
just joined
Posts: 1
Joined: Sat Apr 21, 2012 7:03 pm

Re: Probe Thread

Sat Apr 21, 2012 7:36 pm

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.
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Thu Apr 26, 2012 1:00 am

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.
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.

In linux you can just add an open source tool to populate HDD Smart data since it is somewhat of a standard http://sourceforge.net/apps/trac/smartmontools/wiki In Windows you should try to get one from your hardware vendor or from the drive manufacturer. Either way once you get the area to be populated then you can write probes against it. Here is a guy testing out the linux SNMP information http://en.doc.centreon.com/HowToUseSNMPAgentExtension

Using SNMpwalk on win2k8 server I could not find any smart entries... Once you have the oid being populated the rest is fairly straight forward.

Here is a template
Create a new function
HDDSmart_test
if(string_size(oid("hddsmartoid", 10 ,5)), oid("hddsmartoid", 10, 5)+1 ,"False")
The above function returns the OID of hddsmart +1 NOTE: if hddsmartoid = 0 when the disk is fine you have to add 1.

Then make a probe of type function that uses the HDDsmart function in the available and error lines (and graph line if needed)
Available: HDDSmart_test()<>"False"
Error: if(HDDSmart_test()<>"False",if(HDDSmart_test()=1,"","Check HDD Smart Status"),"Could not read HDDSmart SNMP info")

Notice I didn't subtract 1 from the Error line I just used the probe as if it was 1 when true so that I didn't have to try to test for 0 which is always false. The dude "if" statement always return false on SNMP values of "0" even though this is a valid return from a probe and this "feature" makes building accurate probes complicated.

HTH,
Lebowski
 
slech
Long time Member
Long time Member
Posts: 533
Joined: Thu Feb 14, 2008 4:03 pm
Location: Moldova, Chisinau

Re: Probe Thread

Mon Apr 30, 2012 9:52 am

Maybe 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.
Sharade
Re-read my post please, I added some info in it.
sorry for my english
 
User avatar
karina
Member
Member
Posts: 446
Joined: Sat Feb 06, 2010 2:18 am
Location: Spain

Re: Probe Thread

Mon May 28, 2012 1:32 pm

Hi All,

Can anybody tell me how to show the CPU temperature of RB1200 on the DUDE MAP

Normis showed me how to get the OID but I dont know how to make it into a Probe etc

I currently have the standard CPU usage and Disk usage showing on the Icon.

Is there a manual that would cover this question?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24048
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Probe Thread

Mon May 28, 2012 1:40 pm

To simply display the temperature on the icon, add this OID to the device label in "Appearance". To monitor the temperature and trigger notifications based on the result, you need to make a probe.

In the label: [oid(".1.3.6.1.4.1.14988.1.1.3.10.0")]

Manual is here: http://wiki.mikrotik.com/wiki/The_Dude
No answer to your question? How to write posts
 
User avatar
karina
Member
Member
Posts: 446
Joined: Sat Feb 06, 2010 2:18 am
Location: Spain

Re: Probe Thread

Mon May 28, 2012 2:13 pm

Thanks Normis,

Done that and the label shows Invalid OID

This is what shows in the Label Box

[Device.Name]
[device_performance()][Device.ServicesDown]
[oid(".1.3.6.1.4.1.14988.1.1.3.10.0")]
 
User avatar
karina
Member
Member
Posts: 446
Joined: Sat Feb 06, 2010 2:18 am
Location: Spain

Re: Probe Thread

Mon May 28, 2012 2:16 pm

results of print OID command in the device i want to monitor

active-fan: .1.3.6.1.4.1.14988.1.1.3.9.0
voltage: .1.3.6.1.4.1.14988.1.1.3.8.0
temperature: .1.3.6.1.4.1.14988.1.1.3.10.0
processor-temperature: .1.3.6.1.4.1.14988.1.1.3.11.0

Device RB1200 ROS Ver 5.16

dude version 4 beta3 running on windows server 2003
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24048
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Probe Thread

Mon May 28, 2012 2:38 pm

try without the dot
this will be x10, so you will need to divide by 10 in the label. this will work

[oid("1.3.6.1.4.1.14988.1.1.3.10.0")/10]
No answer to your question? How to write posts
 
User avatar
karina
Member
Member
Posts: 446
Joined: Sat Feb 06, 2010 2:18 am
Location: Spain

Re: Probe Thread

Mon May 28, 2012 3:04 pm

great thanks Normis.

Just one more thing. it displays 70 as 700 is there a way to change that

Sorry to keep bothering.


Sorry didnt read your post properly all working fine
ç

Many thanks
Last edited by karina on Mon May 28, 2012 3:06 pm, edited 1 time in total.
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 24048
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Probe Thread

Mon May 28, 2012 3:05 pm

I already wrote, you need to divide by ten, like this:


[oid("1.3.6.1.4.1.14988.1.1.3.10.0")/10]
No answer to your question? How to write posts
 
User avatar
karina
Member
Member
Posts: 446
Joined: Sat Feb 06, 2010 2:18 am
Location: Spain

Re: Probe Thread

Mon May 28, 2012 3:07 pm

sorry

Many thanks
 
User avatar
geoffsmith31
Member Candidate
Member Candidate
Posts: 147
Joined: Fri Nov 05, 2010 6:08 am
Location: Toowoomba, Australia

Critical switchports

Mon Jun 18, 2012 9:21 am

Most networks have redundant links to provide continued connectivity in case of equipment or cable failures. Failover is generally automatic using STP or LACP protocols and it is difficult to tell if a link has failed without actively looking for it. I have written this probe so that it will provide an alert if a "critical" switchport is inactive for some reason. I am running The Dude 4 Beta 2 on Win 2K3 server. There are no doubt, improvements that can be made to this system. But for the moment it is doing what I require.

I have accepted a value of up(1) or dormant(5) as normal states for the switchports and any other state as abnormal.

There are a few different components to this probe. They are:

1. The SNMPGet executable. http://www.snmpsoft.com/freetools/snmpget.html This is a commandline SNMP tool free for non-commercial use

2. The link-test.vbs script which I have written. It makes use of SNMPGet to retrieve the appropriate OID values:
'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)

3. The Link-Test.Bat batch script which is the conduit between The Dude and the VB script
@echo off
cscript link-test.vbs //NoLogo /i=%1 /p=%2
4. The Dude Probe itself:
critical-ports.PNG
[Edit]
for those like me with old eyes:
Available: if(string_size(device_property("CustomField2"))>0,1,0)
Error: if(string_size(array_element(execute("link-test.bat",concatenate(device_property("FirstAddress")," ", device_property("CustomField2")),"c:\\snmpget"),1))<3,"",concatenate("Ports ",array_element(execute("link-test.bat",concatenate(device_property("FirstAddress")," ", device_property("CustomField2")),"c:\\snmpget"),1) ," have failed"))

5. The Dude Device configuration panel. Switchports that are critical are to be listed in Custom Field 2 as a colon separated list.
Device-cfg.PNG
Unfortunately the probe returns two unprintable characters under normal circumstances and if a port (or ports) go down these characters are also appended to the result. I am not sure what they are or why they are there. I have spent enough time on this already and have decided to ignore them and make allowances that they are there hence the test for string_size<3.

I hope this is of use to others and if someone can improve on it, then go for it.
You do not have the required permissions to view the files attached to this post.
 
xezen
Long time Member
Long time Member
Posts: 628
Joined: Fri May 30, 2008 10:23 am
Location: South Africa

Re: Probe Thread

Tue Jun 19, 2012 10:31 am

i upgraded to 4.17 and all of them give me a probe error any one know how i can fix this?
You do not have the required permissions to view the files attached to this post.
If i dont No Ask someone That Does!
 
Sharade
just joined
Posts: 9
Joined: Thu Apr 19, 2012 12:16 pm

Re: Probe Thread

Thu Jun 28, 2012 9:00 am

Image
http://s14.directupload.net/file/d/2935 ... je_png.htm

If you want it like this, insert this in device :) Dunno if this helps ;)

[Device.Name]
[Device.FirstAddress]
[Device.ServicesDown]
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 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

[round(100-win_diskc_free_percent())]% free

[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")]

[round(average(oid_column("iso.org.dod.internet.mgmt.mib-2.host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad")))]% CPU

up-time: [oid("1.3.6.1.2.1.1.3.0")]
 
merlinios
just joined
Posts: 21
Joined: Sat Oct 07, 2006 9:37 pm

Re: Probe Thread

Thu Jul 12, 2012 2:20 pm

Hello

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

Thanks
 
User avatar
aacable
Member
Member
Posts: 422
Joined: Wed Sep 17, 2008 11:58 am
Location: ISLAMIC Republic of PAKISTAN
Contact:

Few OID's for various devices

Tue Jul 24, 2012 7:11 am

Some OID's I use in my office to monitor various devices.
e.g: http://forum.mikrotik.com/viewtopic.php ... 71#p322771

EATON UPS 9155 : Temperature/Volts/Load
UPS Temp: [oid("1.3.6.1.4.1.534.1.6.1.0")]
KESC Volts IN : [oid("1.3.6.1.2.1.33.1.3.3.1.3.1")]
LOAD on UP [oid("1.3.6.1.2.1.33.1.4.4.1.5.1")] %

EATON Powerware Environment Monitoring Probe [EMP]
NOC Room Temperature : [oid("1.3.6.1.4.1.534.1.6.5.0")]

Cisco 3750 Switch Temperature
Temperature : [oid("1.3.6.1.4.1.9.9.13.1.3.1.3.1006")]

Cisco ASA 5510 Cpu Usage:
CPU Load 1min: [oid("1.3.6.1.4.1.9.9.109.1.1.1.1.5.1")] %

Number of connected users on Cisco AP
Active WiFi Users: [oid("1.3.6.1.4.1.9.9.273.1.1.2.1.1.1")]

HP 2420n Toner Cartridge
TONER Remaining [oid("1.3.6.1.2.1.43.11.1.1.9.1.1")/0.6000*100] % Remaining

IBM Lotus Domino Server
Mail Waiting: [oid("1.3.6.1.4.1.334.72.1.1.4.6.0")]
Server Availability Index: [oid("1.3.6.1.4.1.334.72.1.1.6.3.19.0")]
Lotus DB Connected Users: [oid("1.3.6.1.4.1.334.72.1.1.6.3.6.0")]
_____________
Regard's

Syed Jahanzaib
Web: http://aacable.wordpress.com
Email: aacable [at] hotmail.com
 
masterphoton
just joined
Posts: 8
Joined: Mon Nov 22, 2010 2:20 pm

HTTP Probe

Thu Aug 02, 2012 8:54 am

Hello,

I have the following problem: I need to receive traps and make probes in Dude (v 4.3) that reacts to those traps.
Here's my setup: Icinga server (for receiving traps); a webpage (a simple php script) which processes Icinga's traps page, eliminates all the unnecessary output and returns 1 for fault and 0 for OK for a specific device.
I want to make a probe in dude that reads this webpage and turns green/red depending on the state written in the webpage.
Here's what I did until now:

Probe name: webtrap
Type: TCP
Port: 80
Connect only: unchecked
First receive, then send: unchecked
Send: GET http://x.x.x.x/webpage/index.html HTTP/1.1 \r\n\r\n
Receive: 0

This doesn't work...I don't know why. No matter what the webpage returns, the probe is always "ok".


Thanks.
 
Morphology
just joined
Posts: 21
Joined: Mon Jan 26, 2009 7:51 pm

Re: Probe Thread

Thu Aug 02, 2012 10:54 am

Your probe looks correct (apart from the extra space after the 1.1). I am using very similar probes to check our web sites are working by looking for the string returned by the web server. I am using Dude 3.6 rather than 4.3 - I don't know whether the 4.3 behaviour is different.

Some other things to try:

Try the GET string without spaces, and a training slash on the address:

GET http://x.x.x.x/webpage/index.html/ HTTP/1.1\r\n\r\n (no space after the HTTP/1.1)

Try HTTP/1.0 (less exact protocol)

Try GET http://x.x.x.x/webpage/ HTTP/1.0\r\n\r\n (let the web server decide to serve you index.html)

What I always do is telnet to the web server port 80, and send it the 'GET' string in the Telnet session and look at what the web server is _actually_ returning - especially important it it isn't returning a web page. You may find it has decided to send some other output before your 0.

I just use Windows telnet. In a CMD (DOS) window at the C:\> prompt.

Telnet x.x.x.x 80 [hit RETURN]

The web server won't give a reply so type your 'GET' string quickly before it times out (or copy & paste is easier).

The web server should reply.

Get the Dude to check for the exact string it returns (and make sure it is returning what you expect!).


Morph.
 
masterphoton
just joined
Posts: 8
Joined: Mon Nov 22, 2010 2:20 pm

Re: Probe Thread

Thu Aug 02, 2012 11:35 am

Thanks a lot.
I've telneted the webserver, it returns either 0 or 1, nothing else.
The probe, on the other hand, doesn't seem to evaluate the result correctly. No matter if I write 1, 0, aaa, xxx in the "receive" textbox it returns "ok".

I'll try all the other things you sugested and will keep you posted.

Thanks again.
 
masterphoton
just joined
Posts: 8
Joined: Mon Nov 22, 2010 2:20 pm

Re: Probe Thread

Thu Aug 02, 2012 11:44 am

Morph, still not working, sorry.

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...
 
Morphology
just joined
Posts: 21
Joined: Mon Jan 26, 2009 7:51 pm

Re: Probe Thread

Thu Aug 02, 2012 1:18 pm

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...
Hmmm, unfortunately I don't think I am going to be able to help much more.

My HTTP probes don't contain regular expressions in the Receive box, just text such as: HTTP/1.1 200 OK

Have you tried a probe to a normal web server?

Have you tried OK="return any value" ProbeDown=nothing (don't return any value).

Morph
 
masterphoton
just joined
Posts: 8
Joined: Mon Nov 22, 2010 2:20 pm

Re: Probe Thread

Thu Aug 02, 2012 1:23 pm

Well, I've tried everything... I don't think I need an regexp in that box, since it's just a single value.

Yuck...

I'll keep trying until it works and let everyone know when and how it's done.

Thanks!
 
masterphoton
just joined
Posts: 8
Joined: Mon Nov 22, 2010 2:20 pm

Re: Probe Thread

Wed Aug 08, 2012 12:21 pm

OK, done! :)
It seems to me that Dude accepts as a response for the http / TCP probe only status codes. So my workaround is to read Icinga's webpage, strip it to only necessary bits of informations and then generate a http status for Dude's probe to receive.

The ideea works like this:

Icinga webpage displaying traps -> Middleware, hosted on a webserver (Middlewareserver) processes informations about traps and generates proper HTTP code (200 OK - for not receiving any traps, 403 Forbidden - for traps indicating an error) -> Dude probes Middlewareserver and acts accordingly.

Thanks everybody for support. I really hope that Dude will finally get a trap receiver on its own in the so-much-waited next version.
 
tonyg
just joined
Posts: 2
Joined: Mon Aug 20, 2012 6:18 am

Re: Probe Thread

Mon Aug 20, 2012 6:42 am

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
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?

tony
 
User avatar
dazm
just joined
Posts: 21
Joined: Mon Oct 03, 2011 5:09 am
Location: Russia

Re: Probe Thread

Mon Aug 20, 2012 3:58 pm

Hello.

Can anyone suggest how to make the probe, which would trigger when on same map more than 10 Devices have status: Down ??
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Tue Aug 21, 2012 5:44 pm

Find an OID that has a static numerical value like ttl 1.3.6.1.2.1.4.2.0, build a function that adds each value from each device together from unique IP addresses, as long as it is greater than null one of the devices must be up. Build a probe out of that and stick the probe on one device the function will test all 10. In an OID request you can specify the ip address...

Function: sumttl
Code: oid("1.3.6.1.2.1.4.2.0",5,5,"192.168.1.1")+oid("1.3.6.1.2.1.4.2.0"",5,5,"192.168.1.2")+oid("1.3.6.1.2.1.4.2.0"",5,5,"192.168.1.3")+oid("1.3.6.1.2.1.4.2.0"",5,5,"192.168.1.4")+oid("1.3.6.1.2.1.4.2.0"",5,5,"192.168.1.5")+oid("1.3.6.1.2.1.4.2.0"",5,5,"192.168.1.6")+oid("1.3.6.1.2.1.4.2.0"",5,5,"192.168.1.7")+oid("1.3.6.1.2.1.4.2.0"",5,5,"192.168.1.8")+oid("1.3.6.1.2.1.4.2.0"",5,5,"192.168.1.9")+oid("1.3.6.1.2.1.4.2.0"",5,5,"192.168.1.10")

Probe
name: ten_dev_down
type: function
avail: 1
error: if(sumttl()>=1,"","Severe network trouble")
value: sumttl()
unit: sumttl

Notes: If you graph the value you will see when individual devices are not available(but not which one). Availability set to 1 will cause this probe to be installed on every device if you use auto discover, make sure to remove it from being able to be auto-installed.

OID returns value of given snmp OID. Only first parameter mandatory. First parameter - oid string, second - cache time - default 5 seconds (5.0), third - negative cache time - default 5 minutes (300.0), forth - ip address (overrides context device), fifth - snmp profile (overrides context device)

Let us know how it goes!
Lebowski
 
User avatar
aacable
Member
Member
Posts: 422
Joined: Wed Sep 17, 2008 11:58 am
Location: ISLAMIC Republic of PAKISTAN
Contact:

Re: Probe Thread

Wed Aug 22, 2012 7:21 am

lebowski, You are the DUDE, MAN 8)
_____________
Regard's

Syed Jahanzaib
Web: http://aacable.wordpress.com
Email: aacable [at] hotmail.com
 
User avatar
dazm
just joined
Posts: 21
Joined: Mon Oct 03, 2011 5:09 am
Location: Russia

Re: Probe Thread

Fri Aug 24, 2012 8:12 am

Let us know how it goes!
Lebowski
Thank you very much, but this is just an example. (I mean about 10 devices.)
What I should do if the devices more then 200 on a different map ?
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Fri Aug 24, 2012 4:16 pm

Well there is dependencies... I don't use them but on the top right corner, select dependencies instead of links.

I don't think I have seen any network monitor have a feature such as you imagine. You will almost never have all the devices on a single map fail unless an uplink for a site is the only connection. Gsandul has a post that shows how to track a link.

You could still pick 5 or 10 critical devices and use a single probe to let you know when something is seriously wrong.
 
tonyg
just joined
Posts: 2
Joined: Mon Aug 20, 2012 6:18 am

Re: Probe Thread

Mon Sep 03, 2012 9:25 am

I want to monitor the receive bitrate on the eth1 ports of a hundred or so broadcast satellite receivers, and I've created a probe that seems to work for some of the receivers:

<function>
Name: Eth1rx
code:
string_substring((rate(oid("1.3.6.1.2.1.2.2.1.10.3"))*8), 0, 9)

<probe>
Name: Eth1rx
Type: Function
Avail: if(Eth1rx()>0, 1, -1)
Err: if(Eth1rx()>700000, "", "WAN outage")

and so forth.

The problem I'm having is that the eth1 inOctets in these boxes can turn up on either of two oid's, i.e. ifInOctets.3 or ifInOctets.2. I need a way to establish which of these actually holds the eth1 count, probably by referring to the ifDescr oid I expect. I'm not all that familiar with function / probe scripting (yet) and I could use a little help. Anyone?

Tony
 
blazeminds
just joined
Posts: 1
Joined: Thu Jun 28, 2012 2:07 pm

Re: Probe Thread

Fri Sep 14, 2012 1:42 pm

yes it is possible to use parameters in created function like it is in builtin ones
 
pjulian
Member Candidate
Member Candidate
Posts: 267
Joined: Mon May 31, 2004 12:16 pm
Location: Sydney, Australia

Re: Probe Thread

Sun Oct 07, 2012 3:57 pm

Hi guys, haven't been around for a while but hit a snag with something I thought would be simple !
I need to monitor a couple of services on a debian linux box, any suggestions ?
Obviousy process ID will change on reboot or restart of process so I can't really use SNMP unless I try and search for the string name of the process which is painful, I would appreciate any suggestions.

Thanks
Paul
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Mon Oct 08, 2012 4:42 pm

Hey Paul good to see you. So no I don't have a good answer for you and probably already posted this before but here is what I did as a proof of concept to find notepad in windows maybe something similar would work? Yep it does download the entire array of the running programs... Maybe change it to have a 270 second cache time so if the dude does find it, the array will not be downloaded again for another 4.5 minutes??

Function;
Name:find_notepad
Description:Find the array index to notepad++.exe or return false
Code:if(array_size(oid_column("1.3.6.1.2.1.25.4.2.1.2",270,10)), array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2",270,10),"notepad++.exe"),"False")

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")

HTH,
Lebowski
 
rahmanwarsi123
just joined
Posts: 1
Joined: Sun Nov 11, 2012 7:41 pm
Location: pakistan
Contact:

Re: Probe Thread

Sun Nov 11, 2012 7:45 pm

This is my default label
Thanks for the addin guys


Device [Device.Name] ([Device.Type])
IP: [Device.AddressesCommaList]
Services ([Device.ServicesCount]):
Up: [Device.ServicesUp]
Unstable: [Device.ServicesUnstable]
Down: [Device.ServicesDown]
Acked: [Device.ServicesAcked]
Unknown: [Device.ServicesUnknown]
Dell Tag [oid("iso.3.6.1.4.1.674.10892.1.300.10.1.11.1")]
[oid("1.3.6.1.2.1.1.1.0")]
[snmp_name][snmp_description][snmp_uptime][snmp_contact][snmp_location]
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")]
Notes:
[Device.NotesColumn]
 
User avatar
mves
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Tue Jan 11, 2011 8:15 pm
Location: Serbia

Re: Probe Thread

Thu Nov 15, 2012 3:45 pm

Hi guys. I need help with a dude probe. I need to make a probe that will check interface speeds on interfaces. For example if interface speed changes from 100 mbit/s or 1 gbit/s to 10 mbit/s. So if that criteria is met, probe is down. Note that some of the interfaces are not in function.

Thanks in advance.
 
User avatar
dazm
just joined
Posts: 21
Joined: Mon Oct 03, 2011 5:09 am
Location: Russia

Re: Probe Thread

Mon Dec 24, 2012 12:11 pm

Hi all.
I would like to know, Can I create a probe that will use the second or third ip address specified on the same device ?
I need to create a probe, which would have used one of the ip address listed in the device

for example on my device I need the following probes :

first ip address - Gateway - ping1_probe
second ip address - server - ping2_probe
third ip address - workstation number 1 - ping3_probe & tnsping1_probe
fourth ip address - Workstation number 2 - ping4_probe & tnsping2_probe
You do not have the required permissions to view the files attached to this post.
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Mon Jan 07, 2013 5:18 pm

@dazm You can specify the ip address used in a custom probe by manually populating the address. This probe complains when RTT is greater than 200ms.

Here is a ping probe I made for testing. This works.
device_property("FirstAddress") <> ""
if(array_element(ping("192.168.1.1"), 0) < 200, "", "RTT > 200ms")
array_element(ping("192.168.1.1"),0)

Here is an example that automatically uses the first address, I could not get it to work with "SecondAddress".
device_property("FirstAddress") <> ""
if(array_element(ping(device_property("FirstAddress")), 0) < 200, "", "RTT > 200ms")
array_element(ping(device_property("FirstAddress")),0)
Here is a screen shot of the first probe for reference.
Ping3 .png
Note: The Dude has interesting ping results!

HTH,
Lebowski
You do not have the required permissions to view the files attached to this post.
 
User avatar
dazm
just joined
Posts: 21
Joined: Mon Oct 03, 2011 5:09 am
Location: Russia

Re: Probe Thread

Fri Jan 11, 2013 1:19 pm

@lebowski, so if i use specific ip address in custom probe, how i can use that prob for another device with different ip address ?
Can I use the first, second,... n-th ip-address in the probe as input parameters ?
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Mon Jan 14, 2013 8:56 pm

@dazm

You will need to build a custom probe or function for each manually crafted ip address and you will need to do some testing to see if second or third address is actually usable by it's variable name.
 
User avatar
dazm
just joined
Posts: 21
Joined: Mon Oct 03, 2011 5:09 am
Location: Russia

Re: Probe Thread

Tue Jan 29, 2013 9:28 am

Hello dude guru:)
I find a topic.
With this function now I can track availability of second IP-address on same device.

My probe : ping2
Available : DeviceSeccondAddress() <> ""
Error: if(array_element(ping(DeviceSeccondAddress()), 0) < 200, "", "RTT > 200ms")
Valuse: array_element(ping(DeviceSeccondAddress()),0)
Unit: ms
 
Sharade
just joined
Posts: 9
Joined: Thu Apr 19, 2012 12:16 pm

Re: Probe Thread

Fri Feb 15, 2013 2:53 pm

So, i have another hang over on display the storage place from a NAS (QNAP). We configured a RAID 6 and i want to display the Storage from the logical drive u see in the picture. I want add it as a probe and display it on the NAS Icon.


Any Ideas? :shock:
You do not have the required permissions to view the files attached to this post.
 
fgluck
just joined
Posts: 4
Joined: Thu Feb 14, 2013 10:19 pm

An "Everything is OK" probe

Sat Feb 16, 2013 5:26 am

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.
 
fgluck
just joined
Posts: 4
Joined: Thu Feb 14, 2013 10:19 pm

Re: An "Everything is OK" probe

Tue Feb 19, 2013 12:08 am

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.
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:

if(array_element(ping(device_property("FirstAddress")),1="-1","","Network Alive")

The notification is giving me a bit of trouble. In the ADVANCED tab of notification, I see that the notification can only be tripped (and some action taken) if there is a transition from one state to another (e.g. down -> up). If the state of the probe is the same each time the probe is run (e.g. ping test is successful each time) then I will never get any notifications at all.

What if the first part of the function force resets the probe to a known state (e.g. down), I could follow it with the second part of the function that does the test. If the state changes... voila.

Is there such a way to force a probe into a known state?

Hmmmmm.
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: An "Everything is OK" probe

Tue Feb 19, 2013 7:12 pm

I want to be notified of success (via email)
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).

In windows your schedule task would be two batch jobs with one to break it and then another one to fix it. You can add as many route adds in one shot as you like. Note: The destination network has to be on a connected interface. (In this case there is nothing on 192.168.1.254)

The following line will break cnet.
route add 64.30.224.103 255.255.255.0 192.168.1.254
The following line will fix cnet.
route delete 64.30.224.103

Here is the windows route table... notice the forced bad route to a Gateway that doesn't exist.
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.100 10
64.30.224.103 255.255.255.255 192.168.1.254 192.168.1.100 11

You can lower the metric if it doesn't break the route by adding METRIC 1 on the end of the add command.

lebwoski
[edited for readability]
 
Morphology
just joined
Posts: 21
Joined: Mon Jan 26, 2009 7:51 pm

Re: Probe Thread

Wed Feb 27, 2013 4:55 pm

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".

This probe returns the memory consumption in Mb. I am using Dude 3.6

PROBE DEFINITION
==============

Name:
SQLServer.exe memory usage

Type:
Function

Agent:
default

Available:
if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"sqlservr.exe")>0, 1, -1)

Error:
if(array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"sqlservr.exe")>0, "", "sqlserver.exe not running")

Value:
array_element(oid_column("1.3.6.1.2.1.25.5.1.1.2"),array_find(oid_column("1.3.6.1.2.1.25.4.2.1.2"),"sqlservr.exe"))/1024

Unit:
Mb

Rate:
none

Returns a graphable figure.

Enjoy


Morph.
 
User avatar
dazm
just joined
Posts: 21
Joined: Mon Oct 03, 2011 5:09 am
Location: Russia

Re: Probe Thread

Tue May 14, 2013 11:30 am

Hi all.
I've some problems with my probe.

First I want to tell you how it all works.

I create a function Name it: Device2Address

On my dude map I've device with two ip-addresses

1st : 10.10.10.1
2nd : 10.10.10.2

That function Device2Address() return me 2nd ip-address and works correctly.

Now I make a Probe :
Probe name : ping2
Type: Function
Available: array_element(ping(Device2Address()), 0) <> -1 // You all know, that basic function ping() returns array of four elements - rtt, packet size, ttl and error description. rtt, packet size and ttl is -1 if error occurs.
Error: if(array_element(ping(Device2Address()), 0) < 500, "", "RTT > 500ms") // I need to know if the delay is more than 500ms
Value: array_element(ping(Device2Address()),0)
Unit: ms

But when device on 2nd ip-address is not available, basic funtion ping() return me : "-1, -1, -1, timeout"
Nevertheless probe show me that all - OK, and I dont understand why ?

Although the condition is not fulfilled // Available: array_element(ping(Device2Address()), 0) <> -1
Probe tells me that everything is OK.

Can anyone suggest where I could make a mistake?
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Tue May 14, 2013 8:02 pm

I suspect that -1 is causing the issue. In a probe -1 is "true" and if you follow others early example of probes you will find that "available" is true many times when it should not be...

You first need to determine what the dude is doing to your return value from ping in all cases then determine if that logic holds true for the available line. For example a batch job that returns -1 as a result might be "NULL" in the Operating system but in the dude it could be "TRUE".

While I was testing I could not make an "available" logic test work with certain things like doing a string compare. The following code would always be true...
Create the a function called functionx then I could have 'if((oid"1.3.6..."), (oid"1.3.6..."), "notfound")' in the function then in the available line I could put 'if functionx <> "notfound"'. As long as the logic works it should not be "available" if it is notfound but it was always true, then I changed "notfound" to 0 and the logic started working like so
"functionx" 'if((oid"1.3.6..."), (oid"1.3.6..."), 0 )'
"available" if functionx <> 0

So test the crap out of your logic when you put it on the available line. Also when the logic on an available line is broken the probe could show as "up" even though it is not.

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

Re: Probe Thread

Tue Jun 04, 2013 12:57 am

Hello together,

our version of the probe ping_SecondAddress. It works and shows the availability the most time correct but there is a little bug in it caused in how the functions works.

We got the function for the second and third IP-address from "fbsdmon" and "dazm", thanks for the code. :D

We gave these funtions the name: device_SecondAddress() and device_ThirdAddress().

Here the Probes:

Probe name : ping_SecondAddress
Type: Function
Available: if (array_element(ping (device_SecondAddress()), 0)+1, 1, 0)
Error: if(array_element(ping(device_SecondAddress()), 0) < 200, "", "RTT > 200ms")
Value: array_element(ping (device_SecondAddress()), 0)/1000
Unit: s


Probe name : ping_ThirdAddress
Type: Function
Available: if (array_element(ping (device_ThirdAddress()), 0)+1, 1, 0)
Error: if(array_element(ping(device_ThirdAddress()), 0) < 200, "", "RTT > 200ms")
Value: array_element(ping (device_ThirdAddress()), 0)/1000
Unit: s


The little problem for maybe somebody is for example that:
If there is no 3rd IP-adress in the properties of the device you got from the function device_ThirdAddress() the second IP-address of the device, minus the first digit. If these Ip-address don't exist you get en error, thats what we want. BUT if these IP-address unfortunately exist you don't get an error.

The same for the function device_SecondAddress(). If there is no second ip in the device you get the first ip minus the first digit. For example first ip is: 172.30.12.1 then you get 72.30.12.1.

This seems to be only a problem if there is no second or third ip-address in the device.

Sebastian
Last edited by itsupportschulen on Sun Nov 03, 2013 9:40 pm, edited 1 time in total.
PLEASE open source the code or let us pay for The Dude!
 
User avatar
dazm
just joined
Posts: 21
Joined: Mon Oct 03, 2011 5:09 am
Location: Russia

Re: Probe Thread

Tue Jun 04, 2013 2:01 pm

Hello All :)
Thx a lot for your advice Lebowski, now it works for me.
For you - itsupportschulen, i post all my reworked funtions There

To resolved all problems with incorrect probes with ping2, ping3 of pinging IP-addresses of device, i create sub-functions

Ping2s()
code:
if(array_element(ping(Device2Address()),0)<>-1,array_element(ping(Device2Address()),0),"False")
same code for Ping3s(), Ping4s(), Ping5s() functions.
p.s. All we know that basic func ping() return massive of 4 elements : {rtt, packet size, ttl and error description}
so when ip-address unavailable it return {-1,-1,-1,timeout}

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

and same for others probes
 
User avatar
itsupportschulen
just joined
Posts: 21
Joined: Fri May 24, 2013 10:57 am
Location: Germany, Herford
Contact:

Re: Probe Thread

Wed Jun 05, 2013 2:12 am

Hello dazm,

sorry but your probe Ping2 seems not to work. We're using the Dude 4.0beta3. I've copy and paste all your stuff but allways get an error. The Error/Problem is switching between "ping timeout" and "not available".

For your function Device2Address() you use the code from fbsdmon? Is that right?

Device2Address()
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
    ),
    ","
  )
)
Please check your Availability Line. It seems if there are some brackets missing. :wink:
...
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
...
Sebastian
PLEASE open source the code or let us pay for The Dude!
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7

Who is online

Users browsing this forum: Bing [Bot] and 7 guests