Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Jul 20, 2019 5:08 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 159 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next
Author Message
 Post subject: Monitor Windows Service stats from Linux
PostPosted: Wed Jan 04, 2006 7:49 pm 
Offline

Joined: Mon Jan 02, 2006 9:26 pm
Posts: 28
Location: Sacramento, CA
What I want to do is monitor windows service stats from my Linux cacti. For example I just want to know the current state of the spooler service on my print server. so i can set the threshold to alert me if the spooler srevice stops.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 11:36 pm 
Offline
Cacti User

Joined: Tue Mar 08, 2005 9:51 pm
Posts: 205
I know it's possible to monitor processes running on Compaq/HP servers running Insight Manager. As far as monitoring certain services, I'm not sure if that is possible via SNMP.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 1:06 am 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12160
Location: USA
Look at the OID .1.3.6.1.2.1.25.4.2.1.7. It maintains the list of all processes and if they're running, paused, etc.

_________________

| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 2:37 am 
Offline

Joined: Mon Jan 02, 2006 9:26 pm
Posts: 28
Location: Sacramento, CA
I have already found a script9s) to show all running processes. I am looking for services not processes.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 11:05 am 
Offline
Cacti User

Joined: Tue Mar 08, 2005 9:51 pm
Posts: 205
Thats not going to be possible through SNMP. You'll probably need to run something locally on the server to check the status and then a script on the Cacti machine to grab that data


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 1:37 pm 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12160
Location: USA
Well since the running processes are the services running, thats the closest you're going to be able to get. Otherwise, you're going to need to use WMI to get more detail.

_________________

| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 12:56 am 
Offline
Developer

Joined: Thu Apr 07, 2005 3:29 pm
Posts: 2768
Location: B/CS Texas
BSOD2600 wrote:
Well since the running processes are the services running, thats the closest you're going to be able to get. Otherwise, you're going to need to use WMI to get more detail.


Actually, there is a way to monitor Services from Linux. The OID is .1.3.6.1.4.1.77.1.2.3.1.1 for the index for the services. There is another OID for the service state, which basically returns 0 for stopped, and 4 for running (paused, etc... seem to return 0 instead of what they are suppose to).

I actually have been monitoring Services at work using this for the last 8 months or so, I already have the script and templates setup, I'll post them here once I get back to work tomorrow.

_________________
Report a bug
Download Releases
1.X Compatible Plugins


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 2:27 am 
Offline
Developer

Joined: Thu Apr 07, 2005 3:29 pm
Posts: 2768
Location: B/CS Texas
Actually, here it is now. I had to do a few changes to it, since it was originally used for Cacti v0.8.6c (which is what our production server still runs, way too many modifications to upgrade at this time) but this was exported from v0.8.6i so you shouldn't have any issues with it.

If someone could verify that it works for them also, then I will go ahead and create some instructions for it.


Attachments:
services.zip [4.12 KiB]
Downloaded 13140 times

_________________
Report a bug
Download Releases
1.X Compatible Plugins


Last edited by cigamit on Mon Nov 06, 2006 9:50 am, edited 3 times in total.
Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 3:46 am 
Offline
Cacti Moderator
User avatar

Joined: Sat May 08, 2004 12:44 pm
Posts: 12160
Location: USA
oh yea, completely forgot about the lanmanager OID stuff.

_________________

| Scripts: Monitor processes | RFC1213 MIB | DOCSIS Stats | Dell PowerEdge | Speedfan | APC UPS | DOCSIS CMTS | 3ware | Motorola Canopy |
| Guides: Windows Install | [HOWTO] Debug Windows NTFS permission problems |
| Tools: Windows All-in-one Installer |


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 06, 2006 11:08 am 
Offline

Joined: Mon Jan 02, 2006 9:26 pm
Posts: 28
Location: Sacramento, CA
Thanks,

I will work on it tonight.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 09, 2006 8:54 am 
Offline
User avatar

Joined: Tue Oct 12, 2004 4:49 am
Posts: 22
Location: Switzerland
Hello,

I could not make this work. So I started debugging. The PHP code was OK but something was wrong. I always had 0 state for every services. After digging in the logs drinking a few coffees, I realize that the oid in the DB was too short... the field was cutting of a little bit of the OID. Here is an exemple:
Code:
d:\webserver\cacti2.xxxx.com\scripts\win_services.php win_services 192.168.1.21 public 1 130 get servstate 49.72.101.114.107.105.109.101.114.32.67.97.98.108.101.69.97.115.121.32.46.78.101.116.32.83.99.104.101.100.117.108.101.114.32.67.111.110.116.114.111.108.108.101

instead of:
Code:
d:\webserver\cacti2.xxxx.com\scripts\win_services.php win_services 192.168.1.21 public 1 130 get servstate 49.72.101.114.107.105.109.101.114.32.67.97.98.108.101.69.97.115.121.32.46.78.101.116.32.83.99.104.101.100.117.108.101.114.32.67.111.110.116.114.111.108.108.101.114.32.86.49.46.50


So here is the fix:
In the table poller_item, the field arg1 is a varchar(250). I changed it to TEXT. Then in cacti I cleared the poller cache. Then It was working :)

I dont know if this fix generate some troubles with the rest of cacti but I saw nothing wrong for the moment.

_________________
Tiago Coimbra
Gruyère Energie


Top
 Profile  
 
 Post subject: service monitoring
PostPosted: Wed May 24, 2006 11:30 am 
Offline

Joined: Thu May 18, 2006 4:30 pm
Posts: 37
Cigamit, the service monitoring that script and template you created, is that specific for linux, or can be used for cacti on windows?


Top
 Profile  
 
 Post subject: Re: service monitoring
PostPosted: Wed May 24, 2006 8:35 pm 
Offline
Developer

Joined: Thu Apr 07, 2005 3:29 pm
Posts: 2768
Location: B/CS Texas
lex8009 wrote:
Cigamit, the service monitoring that script and template you created, is that specific for linux, or can be used for cacti on windows?


Its just polling using SNMP, so it does not matter if you base cacti machine is Linux or Windows. The machine you are monitoring has to be windows ofcourse.

_________________
Report a bug
Download Releases
1.X Compatible Plugins


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 30, 2006 5:12 pm 
Offline

Joined: Fri Dec 30, 2005 1:45 pm
Posts: 8
cigamit,

i was having some trouble getting this to work.
at first i changed the arg1 field to text as mentioned before.

then i noticed that the index of the services was one character to short.
in the 'view poller cache' screen i saw that the action for the datasource was
"Action: 2, Script: /var/www/html/scripts/win_services.php win_services charlie public 1 14 get servstate 1.77.83.83.81.76.83.69.82.86.69.82"

where it should be .... "11.77.83.83.81.76.83.69.82.86.69.82"

so after some looking around i found that this statement which was there twice was causing the problem.
-------
if (substr($return_arr[$i]['oid'],0,4) == "SNMP")
print substr($return_arr[$i]['oid'],36) . "\n";
else
print substr($return_arr[$i]['oid'],26) . "\n";
-----
i changed the values 36 and 26 to 35 and 25 in both occurences, recreated some graphs and they are working now.

i do not have the knowledge to see what happens exactly. i am running this on cactiez beta 3.

Thanks for you great work on the plugins and CactiEZ.


Last edited by mories on Fri Jun 16, 2006 12:55 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 3:40 am 
Offline
Cacti User

Joined: Thu Feb 16, 2006 9:20 am
Posts: 98
What a beautiful template!

Everything worked perfectly on my ubuntu machine

THANKS

Qwertz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 159 posts ]  Go to page 1, 2, 3, 4, 5 ... 11  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group