Community discussions

MikroTik App
 
haggis
just joined
Topic Author
Posts: 19
Joined: Thu May 31, 2007 2:26 am

Creating Probes for Windows Services

Sun Oct 05, 2008 5:39 am

How can i successfully monitor a windows service using a function probe when the OID keeps changing for the service-i understand this happens every reboot, in fact i think it happens even when a processor service is restarted. I think this must be the PID of the process.
i tried to fashion one using the example in the forums that uses looks for 'OUTLOOK.EXE' but it didn't seem to work.

Help please.
 
adamd292
newbie
Posts: 48
Joined: Tue Oct 07, 2008 8:56 am

Re: Creating Probes for Windows Services

Tue Oct 07, 2008 11:01 am

The probes thread has a lot of examples. This is something that I adapted for service monitoring:

This is the probe I created:
Name: Terminal Services checker
Type: Function
Available: if(array_find(oid_column("1.3.6.1.4.1.77.1.2.3.1.1"),"Terminal Services")>0, 1, 0)
Error: if(array_find(oid_column("1.3.6.1.4.1.77.1.2.3.1.1"),"Terminal Services")>0, "", "Terminal Services down")
Value: 1
Unit: <blank>
Rate: none


It will alarm when the service is not there. The services that I monitor are on a Windows 2003 server. I had to configure and start the SNMP service on the target Windows 2003 server, and create a entry for the "public" community with read-only rights.

It also helps with Windows computers if you copy "lmmib2.mib" (usually found in c:\windows\system32) to The Dude's "mibs" folder. Then you can see what 1.3.6.1.4.1.77.1.2.3.1.1 really means :)

There is a small problem with charting this function (does not cause any other problem that I've found). In Dude 3.0RC3, if you Chart or view the History of this function, the graph sometimes shows high values (like 4). Maybe this is a bug in Dude, or maybe there is something wrong with my function?
You do not have the required permissions to view the files attached to this post.
 
haggis
just joined
Topic Author
Posts: 19
Joined: Thu May 31, 2007 2:26 am

Re: Creating Probes for Windows Services

Wed Oct 08, 2008 3:45 am

Thanks, i will give it a try. I would also liketo find out where there is detailed documentation of the commands used in these preobes eg: what does 'array_find' mean and the '>0, 1, 0)' specification at the end of the available line.

Also, the information about copying the lmmib2.mib file into the MIBS folder is new to me. How does this help to ID what the OIDs actually are? Also what happens if i want to copy this file in from multiple servers, since the file is the same name do we put them in separate sub-folders or rename them?

Thanks.
 
adamd292
newbie
Posts: 48
Joined: Tue Oct 07, 2008 8:56 am

Re: Creating Probes for Windows Services

Wed Oct 08, 2008 4:07 am

Just copy the most recent lmmib2.mib.
So if you have Windows 2008 and Windows 2003 and Windows 2000 servers. Copy the file from the Windows 2008 server.

The lmmib2.mib file jusr allows Dude to decode the oid numbers into a description (and if you're lucky, some help).
For example, if you use Tools->SNMP Walk on a Windows Server.
before adding lmmib2.mib to the "mibs" folder:
1.3.6.1.4.1.77.1.4.1.0 MYDOMAIN.COM

after adding lmmib2.mib to the "mibs" folder:
iso.org.dod.internet.private.enterprises.lanmanager.lanmgr-2.domain.domPrimaryDomain.0 MYDOMAIN.COM

So the MIB helps you know that MYDOMAIN.COM is the Primary Domain for the Windows server now :)
 
winkelman
Member Candidate
Member Candidate
Posts: 231
Joined: Wed Aug 16, 2006 5:00 pm
Location: Amsterdam, The Netherlands

Re: Creating Probes for Windows Services

Thu Oct 09, 2008 1:09 pm

It also helps with Windows computers if you copy "lmmib2.mib" (usually found in c:\windows\system32) to The Dude's "mibs" folder.
Thanks for this tip! :D
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Creating Probes for Windows Services

Wed Oct 15, 2008 1:49 am

@haggis

array_find looks for multiple values under one OID. I found much more information in the probe thread... Just search for probe.

First find out if the service is available...
In the available case check the OID contains "Terminal Services" and if it does return "1" or true if not return "0" or false.
Available: if(array_find(oid_column("1.3.6.1.4.1.77.1.2.3.1.1"),"Terminal Services")>0, 1, 0)

Then test to see if the service is up...
In the Error case check the OID contains "Terminal Services" and if True return "nothing" if not complain.
Error: if(array_find(oid_column("1.3.6.1.4.1.77.1.2.3.1.1"),"Terminal Services")>0, "", "Terminal Services down")

The available case is used when you discover services on a device. Once a service is active on a device the error case is used to check if it is working.

Just trying to help...
Thanks, i will give it a try. I would also liketo find out where there is detailed documentation of the commands used in these preobes eg: what does 'array_find' mean and the '>0, 1, 0)' specification at the end of the available line.

Also, the information about copying the lmmib2.mib file into the MIBS folder is new to me. How does this help to ID what the OIDs actually are? Also what happens if i want to copy this file in from multiple servers, since the file is the same name do we put them in separate sub-folders or rename them?

Thanks.