Community discussions

 
User avatar
gsandul
Member Candidate
Member Candidate
Posts: 154
Joined: Mon Oct 19, 2009 1:42 pm

Re: Probe Thread

Mon Aug 09, 2010 12:40 pm

There is no way to do it with The Dude TCP probe.
You can do it only with external script (you can run the script from dude, query SNMP OID on server to start the script, etc....).
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.
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.
 
gelsonalves
just joined
Posts: 13
Joined: Mon May 11, 2009 5:27 pm

Re: Probe Thread

Mon Aug 09, 2010 2:55 pm

How do I monitor a network link or server network traffic? Input and output?
like mrtg:
You do not have the required permissions to view the files attached to this post.
 
gelsonalves
just joined
Posts: 13
Joined: Mon May 11, 2009 5:27 pm

Re: Probe Thread

Mon Aug 09, 2010 3:02 pm

I managed to make a probe that tests the connection ftp user, but it is also necessary to copy a file to test the write permission. In this case, there could be a function?

The use of external software like I said it is prohibited in the security policy information.
 
martix
just joined
Posts: 1
Joined: Tue Oct 12, 2010 2:06 pm

Re: Probe Thread

Tue Oct 12, 2010 2:08 pm

With Dude 4 beta2 the "Logged User" Script/Function doesn't work anymore. Any ideas ?
 
User avatar
gsandul
Member Candidate
Member Candidate
Posts: 154
Joined: Mon Oct 19, 2009 1:42 pm

Re: Probe Thread

Wed Oct 13, 2010 2:01 pm

With Dude 4 beta2 the "Logged User" Script/Function doesn't work anymore. Any ideas ?
The code for Logged_User in 3.6 was:
array_element(execute("cscript.exe",concatenate("//NoLogo C:\dudescr\loggeduser.vbs ",User_Pass()),"C:\WINDOWS\system32\"),1)
In 4.0 Beta2 it should be:
array_element(execute("cscript.exe",concatenate("//NoLogo C:\\dudescr\\loggeduser.vbs ",User_Pass()),"C:\\WINDOWS\\system32\\"),1)
As you can see you should use \\ instead of \
 
User avatar
EMOziko
Member Candidate
Member Candidate
Posts: 129
Joined: Mon Aug 23, 2010 9:42 pm
Location: Georgia

Re: Probe Thread

Thu Oct 14, 2010 3:52 pm

When we will see next version of the Dude?
We want new versions of The Dude!!!!!!!
 
gr8boy
just joined
Posts: 6
Joined: Thu Nov 04, 2010 2:39 pm

Re: Probe Thread

Wed Nov 10, 2010 5:25 pm

Cisco ASA 5510 - Performance

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

Windows Disk Space: Free/Total

Image

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 cant get Disk Space to work on my Dell server? I just copied the code and put it in device appearance, label... but it says Disk Space C:\=0/0 GB
Do I have to do any more configuration for this to work? SNMP is configured and OK.
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Wed Nov 10, 2010 5:57 pm

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
 
gr8boy
just joined
Posts: 6
Joined: Thu Nov 04, 2010 2:39 pm

Re: Probe Thread

Thu Nov 11, 2010 1:34 pm

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
Yes it worked! THANX!
 
drvcrash
just joined
Posts: 8
Joined: Sun Mar 05, 2006 10:34 pm

Re: HP/XEROX workcentre toner and paper levels

Fri Feb 04, 2011 1:48 am

stupid question, how do you import those xml files in?
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:
<?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>
Now make the probes:
<?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! :)
 
drvcrash
just joined
Posts: 8
Joined: Sun Mar 05, 2006 10:34 pm

Re: Probe Thread

Sat Feb 05, 2011 6:35 am

never mind i figured it out, just not before i wiped out my whole map
 
User avatar
EMOziko
Member Candidate
Member Candidate
Posts: 129
Joined: Mon Aug 23, 2010 9:42 pm
Location: Georgia

Re: Probe Thread

Wed Feb 09, 2011 8:44 am

When we will see next version of the Dude?
???
We want new versions of The Dude!!!!!!!
 
Aikidokajeff
newbie
Posts: 39
Joined: Thu Feb 19, 2009 12:15 pm

Re: Probe Thread

Mon Feb 21, 2011 3:53 pm

I've partially created a probe for displaying how many associated devices are on a Cisco Wireless access point.
It works but when the numbers gets to 0 it errors.

I've had a long weekend setting these devices (14) over a large area so I might be missing something very obvious.

I need it to return the number so I can graph it and not go orange/red whtn number of associations reaches 0.

any help?

Thanks.

Current setup:
Name: Num_Associations
Type: Function
Available: oid("1.3.6.1.4.1.9.9.273.1.1.2.1.1.1")=>0
Error: if (oid("1.3.6.1.4.1.9.9.273.1.1.2.1.1.1")<> "", "", "No Connections")
Value: oid("1.3.6.1.4.1.9.9.273.1.1.2.1.1.1")
Unit: *BLANK*
Rate: None
 
Aikidokajeff
newbie
Posts: 39
Joined: Thu Feb 19, 2009 12:15 pm

Re: Probe Thread

Tue Feb 22, 2011 11:23 am

Again, solved it myself:

Name: Num_Associations
Type: Function
Available: oid("1.3.6.1.4.1.9.9.273.1.1.2.1.1.1")=>0
Error: if (oid("1.3.6.1.4.1.9.9.273.1.1.2.1.1.1")< "100", "", "No Connections")
Value: oid("1.3.6.1.4.1.9.9.273.1.1.2.1.1.1")
Unit: *BLANK*
Rate: None

So only if there are over 100 associations will there be an error.
 
User avatar
EMOziko
Member Candidate
Member Candidate
Posts: 129
Joined: Mon Aug 23, 2010 9:42 pm
Location: Georgia

Re: Probe Thread

Sun Mar 13, 2011 7:27 pm

I exported configuration from dude 3.6 and imported it to dude 4 beta 3.
Seems like everything works but there is one problem. On the map, my mikrotiks cpu and disk services is down and mikrotiks are yellow, but on snmp tab of settings there is correct information.

How can i fix this?


See screenshots:
screenshot6.png
You do not have the required permissions to view the files attached to this post.
We want new versions of The Dude!!!!!!!
 
User avatar
gmichel
just joined
Posts: 2
Joined: Mon Apr 11, 2011 4:09 pm
Location: Brasil

Re: Probe Thread

Tue Apr 12, 2011 3:19 pm

I'm trying to create a function that monitors file system manages the graphics and me them. "/","/ var"

Could someone help me posting here an example of how these functions do not know anything about mib, I'm kinda lost.

Thanks
 
steen
Member
Member
Posts: 469
Joined: Sat Oct 23, 2010 2:15 am
Location: Sweden
Contact:

Re: Probe Thread

Sun Aug 28, 2011 2:38 pm

Hello Folks!

I try to make "ERRPT" on AIX environments trigger alarms.

I have been struggling to get "execute" to work, so far it did not work.

Situation is as follows, IBM VIOS and AIX servers need to be monitored on hardware level.
SNMP works great for other purposes, but not for this.

Inside all AIX system is the error reporter, to see hardware errors command errpt on AIX and ioscli errlog on VIOS need to be executed.

I did the following)
Function:
Name: errlog
Code: array_element(execute("C:\errpt.cmd"),1)

Probe:
Type: Function
Agent: default
Available: if(errlog()<1, "up", "down")
Error: if(errlog()>0, "", "down")
Value: 1

The script errpt.cmd:
@echo off
rem checking errorlog at VIOS
c:
cd "c:\Program Files (x86)\PuTTY\"
plink -load ivm -ssh "ioscli errlog | wc -l | sed 's/ //g'" >>%dir%
cd \
rem end errlorlog script

The script counts the number of lines in errorlog, if it is more than 0 lines we got a hardware problem and alarm should go off. (disk, ram, firmware, motherboard, fan, fibre channel etc.)

Running the script from command line in windows 2008 server works:
c:\>errpt.cmd
0

c:\>

And with errors:
c:\>errpt.cmd
3

c:\>

The 3 errors was generated by unplugging one SAN fibre cable.

Adding the probe to service of one VIOS server it immediate becomes red flagged, no matter what I do, if there is errors or not.

How do I make this work, I did try do redirect the output to a file, but the dude never executes the script.

How do I continue ?
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Mon Aug 29, 2011 5:47 pm

@steen Do you want the first element?
Code: array_element(execute("C:\errpt.cmd"),0)
 
steen
Member
Member
Posts: 469
Joined: Sat Oct 23, 2010 2:15 am
Location: Sweden
Contact:

Re: Probe Thread

Mon Aug 29, 2011 8:36 pm

@steen Do you want the first element?
Code: array_element(execute("C:\errpt.cmd"),0)
Yes! errpt.cmd delivers only one attribute, a number from 0-65535
I tries to change with ,0 for first element, it did not help.
It seems like the command is not executed, flag becomes red in services. :-/
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Tue Aug 30, 2011 2:53 am

I put [execute("c:\test.bat")] on a device label and saw " -1,, " it seems like execute is broke! test.bat contained @echo 3
 
steen
Member
Member
Posts: 469
Joined: Sat Oct 23, 2010 2:15 am
Location: Sweden
Contact:

Re: Probe Thread

Tue Aug 30, 2011 9:39 pm

I put [execute("c:\test.bat")] on a device label and saw " -1,, " it seems like execute is broke! test.bat contained @echo 3
Broke, bad. I am using Dude 3.6. How do I workaround it ?
I did also put my errpt.cmd on a label, same result -1,,
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Tue Aug 30, 2011 11:03 pm

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...
 
steen
Member
Member
Posts: 469
Joined: Sat Oct 23, 2010 2:15 am
Location: Sweden
Contact:

Re: Probe Thread

Wed Aug 31, 2011 9:49 pm

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

Re: Probe Thread

Wed Aug 31, 2011 10:49 pm

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)
 
steen
Member
Member
Posts: 469
Joined: Sat Oct 23, 2010 2:15 am
Location: Sweden
Contact:

Re: Probe Thread

Thu Sep 01, 2011 9:42 pm

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)
I want the 1st result. Also I did try with 0 same result, flag is red.
 
Edddie
just joined
Posts: 1
Joined: Tue Sep 06, 2011 10:50 am

Re: Probe Thread

Tue Sep 06, 2011 10:54 am

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...
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.
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 ?
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..
Last edited by Edddie on Tue Oct 11, 2011 1:50 pm, edited 1 time in total.
 
michalf
just joined
Posts: 1
Joined: Wed Oct 05, 2011 1:13 pm

Re: Probe Thread

Wed Oct 05, 2011 1:19 pm

Thnx for this great topic and all the info inside it.

I found problem with monitoring Windows services. Once upon a time, Netlogon service become Paused from Running service status and Dude in unable to discover this "failure".
Does anyone know how to solve/discover paused services ?

This 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")
 
User avatar
gsandul
Member Candidate
Member Candidate
Posts: 154
Joined: Mon Oct 19, 2009 1:42 pm

Re: Probe Thread

Thu Oct 06, 2011 3:00 pm

Hello.
This 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")
This will return service state
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"))
If it equals to 4 - service is in paused state.
 
hush
just joined
Posts: 20
Joined: Sun Jul 03, 2005 5:11 pm
Location: Croatia

Re: Probe Thread

Fri Oct 07, 2011 12:34 pm

ARPing probe for windows using free hardping command line tool (placed in C:\WINDOWS folder on your Dude server) that no (local) device can hide from:

Name: ARPing
Type: Function
Agent: default
Available: if(string_find(array_element(execute("hardping.exe", device_property("FirstAddress"),"C:\WINDOWS"),1),"[")<80,1,-1)
Error: if(string_find(array_element(execute("hardping.exe", device_property("FirstAddress"),"C:\WINDOWS"),1),"[")<80,"","ARP timeout")
Value: device_property("ServicesUpCount")
Unit: ServicesUpCount
Rate: none
 
blindbaby
just joined
Posts: 1
Joined: Mon Oct 10, 2011 12:57 pm

Re: Probe Thread

Mon Oct 10, 2011 12:58 pm

This will return how many wireless stations are registered against an AP generic levitra
Hopefully somebody can use this, I think I borrowed some code from somewhere else, credit given where credit is due.
Last edited by blindbaby on Mon Dec 12, 2011 8:43 am, edited 1 time in total.
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Thu Oct 13, 2011 1:16 am

If you have Cisco stack-able switches here is a function that checks the values returned by the monitoring oid (When a switch in a stack is "normal" it has 4 in the oid). I plan to expand on this next week.

Create a new function name it swinstk...

if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=9, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=36,"Good","9 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=8, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=32,"Good","8 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=7, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=28,"Good","7 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=6, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=24,"Good","6 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=5, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=20,"Good","5 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=4, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=16,"Good","4 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=3, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=12,"Good","3 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=2, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=8 ,"Good","2 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=1, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=4 ,"Good","1 Switch needs attention"),
"Problem reading Any stack"
)))))))))

Then in the probe
available
swinstk()="Good"
error line...
if(swinstk()="Good", "", concatenate("Stack trouble = ", swinstk()))

EDIT: I have found this probe is faulty, as usual with my first run stuff :) the available line doesn't work and this probe will be "up" on any device. Although it does show an error when a switch stack is not working. To fix this I made a new function just for the available line.

Function isstack
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5)),"1","False")
Change the available line in the probe with the same error line from above.
available
isstack()<>"False"
Interestingly enough I tried multiple things in the available line and using not equals false works where equal good does not.

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

Re: Probe Thread

Wed Oct 26, 2011 8:42 pm

Here is the expand stack probe this probe first checks to see if every switch that is provisioned is online then it checks to make sure that every stack port is admin status up and operation status is up. This probe only works Cisco 3750 stack switches.

First create a function called swinstk add the following to it.
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=9, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=36,stk9prts(),"9 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=8, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=32,stk8prts(),"8 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=7, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=28,stk7prts(),"7 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=6, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=24,stk6prts(),"6 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=5, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=20,stk5prts(),"5 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=4, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=16,stk4prts(),"4 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=3, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=12,stk3prts(),"3 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=2, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=8 ,stk2prts(),"2 Stack needs attention"),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=1, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=4 ,1,"1 Switch needs attention"),
"Problem reading Any stack"
)))))))))

Then create 8 more functions named stk9prts to stk2prts.
The 9 port version of the function has 18 checks where the 2 port version has 4 checks. Paste the 9 port text below into the stk9prts function then create a stk8ports function with 2 less if statements. Make sure to put the 1 back on the last if. If all the pairs of OIDs are equal this returns 1 on the last if.

if(oid_raw("1.3.6.1.2.1.2.2.1.7.5180",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5180",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5181",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5181",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5183",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5183",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5184",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5184",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5186",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5186",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5187",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5187",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5189",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5189",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5190",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5190",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5192",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5192",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5193",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5193",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5195",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5195",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5196",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5196",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5198",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5198",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5199",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5199",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5201",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5201",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5203",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5190",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5189",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5189",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5190",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5190",10,5),1
,"Stack port 1 error")
,"Stack port 1 error")
,"Stack port 2 error")
,"Stack port 2 error")
,"Stack port 3 error")
,"Stack port 3 error")
,"Stack port 4 error")
,"Stack port 4 error")
,"Stack port 5 error")
,"Stack port 5 error")
,"Stack port 6 error")
,"Stack port 6 error")
,"Stack port 7 error")
,"Stack port 7 error")
,"Stack port 8 error")
,"Stack port 8 error")
,"Stack port 9 error")
,"Stack port 9 error")

Here is what stk5prts will look like.
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5180",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5180",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5181",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5181",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5183",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5183",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5184",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5184",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5186",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5186",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5187",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5187",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5189",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5189",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5190",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5190",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5192",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5192",10,5),
if(oid_raw("1.3.6.1.2.1.2.2.1.7.5193",10,5)=oid_raw("1.3.6.1.2.1.2.2.1.8.5193",10,5),1
,"Stack port 1 error")
,"Stack port 1 error")
,"Stack port 2 error")
,"Stack port 2 error")
,"Stack port 3 error")
,"Stack port 3 error")
,"Stack port 4 error")
,"Stack port 4 error")
,"Stack port 5 error")
,"Stack port 5 error")

Create a probe of type function name it stackcount or whatever...
on the available line put
swinstk()=1
on the error line put
if(swinstk()=1, "", concatenate("Stack trouble = ", swinstk()))
This probe was not designed to be graphed so when you add it to a stack disable the history. You could modify the result from the stkXprts to be numbers 1 through 9 and modify the probe logic.

If you are paying attention you will see the available line is once again set to use swinstk instead of a separate function and it is just a number. I could not get an available line that contained text to work with an equal sign. For example on the available line when I put swinstk()="good" this probe would install on every device and only show trouble on stacks. It would just be "up" and working fine on a device that didn't even have those OIDs. No amount of messing with the available line would work with text as the true condition. Text works just fine as a false condition and numbers work fine as true conditions. So going forward use text for false or numbers for true condition checking in the available line of a probe.

TLDR; Use numbers and not text if testing for a true condition in the available line of a probe.

[EDIT] Don't build the probe like this suggests, move the stk9prts and stk8prts etc to the fail side because this probe takes up too much processing time.

First create a function called swinstk add the following to it.
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=9, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=36,,stk9prts()),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=8, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=32,,stk8prts()),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=7, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=28,,stk7prts()),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=6, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=24,,stk6prts()),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=5, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=20,,stk5prts()),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=4, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=16,,stk4prts()),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=3, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=12,,stk3prts()),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=2, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=8 ,,stk2prts()),
if(array_size(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=1, if(sum(oid_column("1.3.6.1.4.1.9.9.500.1.2.1.1.6",10,5))=4 ,,"1 Switch needs attention"),
"Problem reading Any stack"
)))))))))

The switch stack will be tested much faster but the individual interfaces will not be tested unless there is a switch failure. this probe is basically defunct since you don't need any of the stack port testing functions i.e. stk9prts, stk8prts, but at least you will know if a switch has failed.

[end edit]
Last edited by lebowski on Wed Aug 15, 2012 1:27 am, edited 1 time in total.
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Wed Nov 02, 2011 7:28 pm

I have a bunch of APC UPS probes I have built but here is the mother of all APC probes! One of the OIDs in an APC ups is a 64bit binary string. 32 of those values are used to indicate various issues. This probe determines if the string is "normal" and if not it finds the first error and returns the result.

Note: The probe line changed, the "False" test in the probe did not work. The graphic I attached still has the old version if you want to compare.

Probe - error line
if(string_size(oid("1.3.6.1.4.1.318.1.1.1.1.1.1.0",10,5)<>0),if(ups_basic_state() = 1, "" ,concatenate( "UPS State Error; ", ups_basic_state())),"Cant read UPS State")

Function
if(string_size(oid("1.3.6.1.4.1.318.1.1.1.1.1.1.0",10,5)<>0),
if(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5)="0001010000000000001000000000000000000000000000000000000000000000",1,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),0,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),1,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),2,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),3,1)=1,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),4,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),5,1)=1,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),6,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),7,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),8,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),9,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),10,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),11,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),12,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),13,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),14,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),15,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),16,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),17,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),18,1)=1,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),19,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),20,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),21,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),22,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),23,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),24,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),25,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),26,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),27,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),28,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),29,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),30,1)=0,
if(string_substring(oid("1.3.6.1.4.1.318.1.1.1.11.1.1.0",10,5),31,1)=0,
"Couldn't determine UPS trouble"
,"Synchronized command is in progress")
,"No Batteries Attached")
,"Graceful Shutdown Issued by Downstream Device")
,"Graceful Shutdown Issued by Upstream Device")
,"Low Battery or On Battery")
,"Self Test In Progress")
,"High Battery Temperature")
,"Battery Charger Failure")
,"Bad Output Voltage")
,"Smart Boost or Smart Trim Fault")
,"Graceful Shutdown Initiated")
,"Battery Communication Lost")
,"Rebooting")
,"On")
,"Sleeping until Utility Power Returns")
,"Sleeping on a Timer")
,"In Bypass due to Fan Failure")
,"In Bypass due to Supply Failure")
,"In Bypass due to Internal Fault")
,"Software Bypass")
,"Manual Bypass")
,"Batteries Discharged")
,"Runtime Calibration")
,"Overload")
,"AVR Trim Active")
,"AVR Boost Active")
,"Serial Communication Established")
,"Replace Battery")
,"On Line")
,"Low Battery")
,"On Battery")
,"Abnormal Condition Present")
)
,"False")
ups_state_test-Probe.png
ups_basic_state-func.png
You do not have the required permissions to view the files attached to this post.
 
Lwra93
just joined
Posts: 2
Joined: Tue Nov 22, 2011 1:10 pm
Location: Netherlands

Re: Probe Thread

Wed Nov 23, 2011 3:01 pm

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.
Thanks! It really worked!
Playin' is the start of a succesfull project. It all starts as a game, you've got to beat every single problem.
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Tue Nov 29, 2011 4:41 pm

Cisco has two types of software for wireless access, lightweight and IOS. In IOS every once in a while a radio interface will stop working and the status will be reset. The admin status will be up but the operational status will be down. In the log file there is a message about interface reset but no up message after that. I just made a probe to determine if the operational status is down on the 2.4ghz radio so that I will know if the radio is unusable.

Function
if(string_size(oid("1.3.6.1.2.1.2.2.1.8.1", 10 ,5)), oid_raw("1.3.6.1.2.1.2.2.1.8.1",10,5),"False")
intd0test - Function000049.png
Probe
if(intd0test()<>"False",if(intd0test()=1,"","Wireless interface down"),"Can't Read Int DO!")
intd0problem - Probe000050.png
You do not have the required permissions to view the files attached to this post.
 
Morphology
just joined
Posts: 21
Joined: Mon Jan 26, 2009 7:51 pm

Re: Probe Thread

Tue Dec 20, 2011 10:36 am

A Function and a Probe to monitor the status of an array of disks in an HP Storageworks server.

The problem is that a single oid will return an array of values (one for each disk), which are simply a text string. So you have to check each returned string for each element of the array looking to see whether that disk is OK, and returning an error if not.

It's a bit crude, in that it is hard-coded to cope with a set number of disks in the array (wouldn't it be nice to be able to code some sort of {FOR....NEXT} loop!!?

My SWS shelves have 12 disks, so this checks array elements 0 to 11 - you may need to adjust accordingly.

FUNCTION
=======

name: disk_array_status
Description: Pull out the disk array status for an SWS shelf
Code:

if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),0),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),1),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),2),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),3),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),4),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),5),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),6),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),7),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),8),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),9),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),10),"ok (2)"),-1,if(string_find(array_element(oid_column("1.3.6.1.4.1.232.3.2.5.1.1.6.2"),11),"ok (2)"),-1,1))))))))))))


Next comes a Probe, which utilises this function:

PROBE
=====

Name: SWS Array Status
Type: Function
Agent: default
Available: disk_array_status()
Error: if(disk_array_status()<>-1,"","Disk Array Status Error")
value: disk_array_status()
Unit:
Rate: none

Apply the probe to the SWS devices on your map, set the alerts, and you're done.

Morph
 
fbsdmon
newbie
Posts: 29
Joined: Thu Dec 29, 2011 11:37 pm

Re: Probe Thread

Thu Jan 12, 2012 5:06 pm

I thought I share my cpu and disk probe changes. They work exactly like the original probes + they inform you if cpu or diks is over threshold. This way, you don't need to pool them twice if you want threshold notifications as well.

cpu
Error: if(and(cpu_usage_available(), cpu_usage()<89), "", if(cpu_usage_available(), concatenate("CPU usage is above 90% with ", cpu_usage(), "%"), "down"))
disk
Error: if(and(hdd_size()>0, round(hdd_usage()<79)), "", if(hdd_size()>0, concatenate("Disk usage is above 80% with ", round(hdd_usage()), "%"), "down"))
 
User avatar
geoffsmith31
Member Candidate
Member Candidate
Posts: 147
Joined: Fri Nov 05, 2010 6:08 am
Location: Toowoomba, Australia

Re: Probe Thread

Fri Jan 27, 2012 11:02 pm

I have a network with many switches that have redundant links. Some use Spanning Tree to control the redundant configuration and some use LACP. I have had situations where a redundant link will fail and I do not discover it for some time (and only by chance). I am trying to write a probe that will go "down" if one of the redundant links on the switch is down - thereby giving me immediate notice of the loss of redundancy.

I have a probe based on the interface, operator state (link state) OID=1.3.6.1.2.1.2.2.1.8.x which does what I want for a particular switchport. However, not all my switches can have the same redundant ports so I will need to create a lot of different probes (one for each different x value) and apply multiple probes to each switch. A more elegant method, I think, would be to have a series of x values in one of the devices custom fields then have the probe iterate through that list to make sure all values of x have their link up.

I don't see any loop control (for, while, repeat, etc) methods in the functions. Does anyone know if there is a way of doing this - maybe a recursive function?
 
lebowski
Forum Guru
Forum Guru
Posts: 1616
Joined: Wed Aug 27, 2008 5:17 pm

Re: Probe Thread

Sat Jan 28, 2012 12:32 am

The only way I have found to go through many iterations is to put an if inside an if. You can put functions inside of functions but that is about the closest you can get to a loop.

I have not tried to have functionA call functionB and have functionB call functionA or functionA call FunctionA since that should put the dude in a tight loop.

Although you could do something like this where functionB tests the next interface and it is something like the UPS 32bit binary test above.
functionA
if(x=1,functionB,false)
FunctionB
if(y=1,functionC,false)

I have roughly the same issue where I want to determine when an etherchannel does not have both the interfaces up and I have not found an elegant way to do that either. I think you are going to have a lot of manually coding to track all those interfaces, Check out gsandul's posts about tracking interface status...

GL
Lebowski
 
fbsdmon
newbie
Posts: 29
Joined: Thu Dec 29, 2011 11:37 pm

Re: Probe Thread

Mon Feb 13, 2012 1:38 am

Asterisk active calls monitoring (probe) & a Asterisk information tooltip (version, uptime, relaod time, current active calls):

The Functions:
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!
The Active Calls probe:
Name: astActiveCalls
Type: Function
Available: string_size(ast_active_calls())
Error: if(string_size(ast_active_calls()), "", "down")
Value: ast_active_calls()
Unit: calls
Off course, you will need res_snmp.so module for Asterisk + some snmp configuration in order to pool this info from Asterisk. Information can be found on Google, but feel free to contact me for help if needed.


Enjoy!
 
dnjulie
just joined
Posts: 3
Joined: Mon Jan 24, 2011 6:39 pm

Re: Probe Thread

Fri Mar 16, 2012 7:31 pm

Hye All,

I'm trying to monitor the battery status of an APC UPS .But it's not working. The service is down and talks about a parsed failed
Here is my config:

Type: Function
Available; if( oid("1.3.6.1.4.1.318.1.1.1.2.1.1.0") == 2,1,-1 )
Error:if(oid("1.3.6.1.4.1.318.1.1.1.2.1.1.0")>2,"","Battery Low")
Value:oid("1.3.6.1.4.1.318.1.1.1.2.1.1.0")
Unit:Interger
Rate:none


http://support.ipmonitor.com/mibs/POWER ... teryStatus
 
User avatar
EMOziko
Member Candidate
Member Candidate
Posts: 129
Joined: Mon Aug 23, 2010 9:42 pm
Location: Georgia

Re: Probe Thread

Wed Mar 21, 2012 9:25 pm

Is 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
We want new versions of The Dude!!!!!!!
 
fbsdmon
newbie
Posts: 29
Joined: Thu Dec 29, 2011 11:37 pm

Re: Probe Thread

Thu Mar 22, 2012 1:25 am

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 :)
 
User avatar
EMOziko
Member Candidate
Member Candidate
Posts: 129
Joined: Mon Aug 23, 2010 9:42 pm
Location: Georgia

Re: Probe Thread

Thu Mar 22, 2012 10:42 am

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 :)
Yes I know its possible on windows installation but my is on RouterOS.

thank you and sorry for mistake :(
We want new versions of The Dude!!!!!!!
 
fbsdmon
newbie
Posts: 29
Joined: Thu Dec 29, 2011 11:37 pm

Re: Probe Thread

Thu Mar 22, 2012 4:22 pm

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"
 
User avatar
EMOziko
Member Candidate
Member Candidate
Posts: 129
Joined: Mon Aug 23, 2010 9:42 pm
Location: Georgia

Re: Probe Thread

Sat Mar 24, 2012 3:13 pm

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"
Thank you.
The Dude does not have "execute on server" type of notification, so I cant execute commands on routerOS :(
We want new versions of The Dude!!!!!!!
 
transdata
just joined
Posts: 5
Joined: Fri Jun 19, 2009 7:52 pm

Re: Probe Thread

Wed Apr 11, 2012 4:14 pm

Is 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
Hi An Probe picture is attached, hopefully ;-)
http_get_probe.png
This will do a get of the path. Pls. keep in Mind, the request will be made on the device you attach the probe to.

The line below you would write some text you expect on the page. This text can be only a part of much more other text.

Cheers,
Transdata
You do not have the required permissions to view the files attached to this post.
 
Sharade
just joined
Posts: 9
Joined: Thu Apr 19, 2012 12:16 pm

Re: Probe Thread

Thu Apr 19, 2012 12:20 pm

Windows Disk Space: Free/Total

Image

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
[/quote]


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.
 
leon84
Member Candidate
Member Candidate
Posts: 167
Joined: Wed Dec 02, 2009 12:15 pm

Re: Probe Thread

Thu Apr 19, 2012 4:28 pm

Hi to all,
in which way I can have snmp information about all wlan interfaces?
In particular, I would to change device color in the dude if a wlan interface (not in administrativly down) go down ...
I think that I have to compare oid "iso.org.dod.internet.mgmt.mib-2.interfaces.ifTable.ifEntry.ifOperStatus" but I don't want to create a snmp test for each router... I would a function that automatically check all wlan interface and give me an error if some one is down...

Is it possible?
 
Sharade
just joined
Posts: 9
Joined: Thu Apr 19, 2012 12:16 pm

Re: Probe Thread

Fri Apr 20, 2012 3:05 pm

May some1 can give me the Code from the Function "[device_performance()]"? :)

Who is online

Users browsing this forum: No registered users and 14 guests