Monitor Windows Service stats from Linux

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Post Reply
Author
Message
imro
Posts: 48
Joined: Thu Jun 15, 2006 11:36 am

Re: Monitor Windows Service stats from Linux

#121 Post by imro » Thu Oct 14, 2010 4:15 pm

For anyone who is interested I have attached fixed win_services.php and win_services.xml that works on my CentOS 4 Cacti 0.8.7g set up.
Attachments
win_services.tar.gz
(1.48 KiB) Downloaded 1085 times

igorx1972
Posts: 4
Joined: Thu Oct 21, 2010 6:55 pm

Re: Monitor Windows Service stats from Linux

#122 Post by igorx1972 » Mon Oct 25, 2010 2:17 am

Hi, guys!
This correct version of "windows service template". Thats, extended state display:
0- stopped, 1 - active, 2-continue-pending, 3 - pause-pending, 4 - paused
State display by color.
Attachments
services.rar
(9.28 KiB) Downloaded 1233 times
Untitled-2.jpg
Graphic
Untitled-2.jpg (36.03 KiB) Viewed 5018 times
Untitled-1.jpg
Check the RRA function for LAST data collection. This prevent error: "the RRD does not contain an RRA matching the chosen CF". See topic: http://forums.cacti.net/viewtopic.php?f=21&t=3686&start=15 post of Gendalf
Untitled-1.jpg (73.42 KiB) Viewed 5018 times

gbaity
Posts: 5
Joined: Wed Aug 04, 2010 2:35 pm

Re: Monitor Windows Service stats from Linux

#123 Post by gbaity » Thu Oct 28, 2010 3:13 pm

I'm imported this template into my windows box, but all my graphs are showing red - no service. Did I miss something?
Attachments
ScreenShot203.gif
ScreenShot203.gif (15.71 KiB) Viewed 5001 times

igorx1972
Posts: 4
Joined: Thu Oct 21, 2010 6:55 pm

Re: Monitor Windows Service stats from Linux

#124 Post by igorx1972 » Thu Oct 28, 2010 7:29 pm

I don't understand, why in Your picture is some numbers exist - no any numbers must be - only words.

gbaity
Posts: 5
Joined: Wed Aug 04, 2010 2:35 pm

Re: Monitor Windows Service stats from Linux

#125 Post by gbaity » Mon Nov 01, 2010 8:58 am

I could really use some help with this:
I'm running 8.7g on Windows
I'm imported your scripts and template, and the graphs above are what I get. Can you assist? I'll try to reimport and see what happens.

Using SNMP version 2

paulgabion
Posts: 2
Joined: Fri Nov 05, 2010 1:50 pm

Re: Monitor Windows Service stats from Linux

#126 Post by paulgabion » Fri Nov 05, 2010 2:00 pm

Hello everyone.

Good day!

I'm a newbie in Cacti and I would like to ask for assistance regarding this addon.

I installed the latest version of the add-on. Unfortunately, when I go to "New Graph", under Data Query of Win Services, I get this:
This data query returned 0 rows, perhaps there was a problem executing this data query. You can run this data query in debug mode to get more information.

How can I fix this?

Thank you.

Best Regards,
Paul

paulgabion
Posts: 2
Joined: Fri Nov 05, 2010 1:50 pm

Re: Monitor Windows Service stats from Linux

#127 Post by paulgabion » Fri Nov 05, 2010 2:13 pm

paulgabion wrote:Hello everyone.

Good day!

I'm a newbie in Cacti and I would like to ask for assistance regarding this addon.

I installed the latest version of the add-on. Unfortunately, when I go to "New Graph", under Data Query of Win Services, I get this:
This data query returned 0 rows, perhaps there was a problem executing this data query. You can run this data query in debug mode to get more information.

How can I fix this?

Thank you.

Best Regards,
Paul
Found the reason why... the data input method should be "Get Script Server Data" instead of "Get SNMP Data" because the xml of win services is placed in script_server.

leechwarez
Posts: 4
Joined: Fri Jan 07, 2011 3:41 am

Re: Monitor Windows Service stats from Linux

#128 Post by leechwarez » Tue Jan 11, 2011 5:40 am

great :D thanks a lot

ruffsense
Posts: 18
Joined: Tue Jan 11, 2011 5:28 am

Re: Monitor Windows Service stats from Linux

#129 Post by ruffsense » Tue Mar 08, 2011 5:37 am

How to add the service to threshold. So it can trigger me when a service is down.

lightenup
Posts: 19
Joined: Mon Dec 06, 2010 10:09 am

Re: Monitor Windows Service stats from Linux

#130 Post by lightenup » Mon Mar 21, 2011 4:02 pm

I download igorx1972 source files and installed things as usual. However, I was getting the same result as gbaity. I spent some time today getting this script working on my Cacti 8.7g+spine deployment. What I found was there in the win_services.php file there seems to be an error.

In the cacti log I saw it making the following request:

03/21/2011 03:20:09 PM - SPINE: Poller[0] Host[646] TH[1] DS[16045] SS[0] SERVER: /var/www/cacti/scripts/win_services.php win_services 10.0.0.53 2:161:500:public:::::: get servstate .9.69.118.101.110.116.32.76.111.103 , output: 0

Notice that the OID has a period at the start of the string. I decided to emulate this on the command line:

/var/log/cacti$ /usr/bin/php -q /var/www/cacti/scripts/win_services.php 10.0.0.53 2:161:500:public:::::: get servstate .9.69.118.101.110.116.32.76.111.103
.1.3.6.1.4.1.77.1.2.3.1.2..9.69.118.101.110.116.32.76.111.103: Unknown Object Identifier (Sub-id not found: enterprises -> .9.69.118.101.110.116.32.76.111.103)
0

The result was 0, fail! The script was barking about the OID not existing?! Odd... the script appended my OID to the base OID incorrectly. What I ended up with was:

.1.3.6.1.4.1.77.1.2.3.1.2..9.69.118.101.110.116.32.76.111.103

What I need is:

.1.3.6.1.4.1.77.1.2.3.1.2.9.69.118.101.110.116.32.76.111.103

In the /var/www/cacti/scripts/win_services.php file go down to line 85 and change this:

$x = trim(cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . '.' . $index, $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_p
riv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, read_config_option("snmp_retries"), SNMP_POLLER));

to this:

$x = trim(cacti_snmp_get($hostname, $snmp_community, $oids[$arg] . '' . $index, $snmp_version, $snmp_auth_username, $snmp_auth_password, $snmp_auth_protocol, $snmp_p
riv_passphrase, $snmp_priv_protocol, $snmp_context, $snmp_port, $snmp_timeout, read_config_option("snmp_retries"), SNMP_POLLER));

What I did was change '.' to just ''
Everything now seems to work!

Keep up the good work!

User avatar
fourhouses
Posts: 3
Joined: Thu Apr 07, 2011 4:39 am

Re: Monitor Windows Service stats from Linux

#131 Post by fourhouses » Thu Apr 07, 2011 9:47 am

I'd like to thank everybody to develop all those features.
Just remark that using script posted by igorx1972, with 0.8.7g under CentOS5 it works fine (you must wait for a couple of minutes to generate graphs).

Cheers!
Cacti Version 0.8.7g; Cacti OS unix; SNMP Version NET-SNMP version: 5.3.2.2;
RRDTool Version RRDTool 1.4.x; Poller Information; Interval 300;
Type spine; Concurrent Processes 1; Max Threads 1; PHP Servers 1; Script Timeout 25; Max OID 10;
PHP Version 5.1.6; PHP OS Linux; PHP uname Linux 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:53:09 EST 2011 i686;
PHP SNMP Installed; max_execution_time 60; memory_limit 128M

ocoralan
Posts: 21
Joined: Mon Apr 25, 2011 7:38 pm

Re:

#132 Post by ocoralan » Mon Apr 25, 2011 9:54 pm

cigamit wrote: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.
It seems that it does not work in Cacti 0.8.7e.

ocoralan
Posts: 21
Joined: Mon Apr 25, 2011 7:38 pm

Re:

#133 Post by ocoralan » Mon Apr 25, 2011 10:04 pm

cigamit wrote:You are going to find that a lot of your old scripts no longer work in v0.8.7, since instead of including config.php, you need to include global.php. Also, certain functions have changed and require more arguments to support SNMP v3.

Attached is a version that should work in v0.8.7.
Oh, excellent, I downloaded the previous service.zip version, so it does not work in v0.8.7e, after downloading this version, it works fine. Thanks for your wonderful stuff.

marco1986
Posts: 1
Joined: Wed Apr 27, 2011 8:56 am

Re: Monitor Windows Service stats from Linux

#134 Post by marco1986 » Wed Apr 27, 2011 9:05 am

Sorry, i'm new in cacti and snmp. How can i monitor linux services or processes? A single service, for example a web service, not a count of all processes.

User avatar
fourhouses
Posts: 3
Joined: Thu Apr 07, 2011 4:39 am

Re: Monitor Windows Service stats from Linux

#135 Post by fourhouses » Fri Apr 29, 2011 2:26 am

Hi,

although Win Service stats is working for me, I need your help:
It seems that RRD are overwritting old data with '0' value, because I loose previous data just in these kind of graphs (not in Latency, CPU, etc).

You can see that looking two attached graphs: they belong to the same server/service, but graph1 is 10 minutes older than graph2, and first one has more data.
I attach my data template screenshot.

Do you know why this behaviour?


Any tip will be appreciated :-)
Thanks in advance.
Attachments
data_template.jpg
data_template.jpg (103.6 KiB) Viewed 4327 times
graph1.jpg
graph1.jpg (22.28 KiB) Viewed 4327 times
graph2.jpg
graph2.jpg (22.96 KiB) Viewed 4327 times
Cacti Version 0.8.7g; Cacti OS unix; SNMP Version NET-SNMP version: 5.3.2.2;
RRDTool Version RRDTool 1.4.x; Poller Information; Interval 300;
Type spine; Concurrent Processes 1; Max Threads 1; PHP Servers 1; Script Timeout 25; Max OID 10;
PHP Version 5.1.6; PHP OS Linux; PHP uname Linux 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:53:09 EST 2011 i686;
PHP SNMP Installed; max_execution_time 60; memory_limit 128M

Post Reply