Monitor Windows Service stats from Linux

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

Moderators: Moderators, Developers

Post Reply
Author
Message
thebelfig
Posts: 6
Joined: Tue Dec 16, 2008 11:12 am
Location: Yakima, WA

#106 Post by thebelfig » Fri Jan 30, 2009 4:52 pm

My graphs are showing the service state as -1. I haven't found any errors in debug.

tipiaks
Posts: 17
Joined: Tue Feb 24, 2009 5:16 am

#107 Post by tipiaks » Tue Feb 24, 2009 11:25 am

Hello,

I have the same problem, anyone find a solution ?

N3NCY wrote:Any thoughts on this error?

[[email protected] /usr/local/www/data/cacti/scripts]# php win_services.php 172.28.0.21 public 2

Notice: Undefined offset: 1 in /usr/local/www/data/cacti/scripts/win_services.php on line 24

Notice: Undefined offset: 2 in /usr/local/www/data/cacti/scripts/win_services.php on line 25

Notice: Undefined offset: 3 in /usr/local/www/data/cacti/scripts/win_services.php on line 43

What is a simple / valid command line test to see if win_services.php is working?

Thanks for help !

tipiaks
Posts: 17
Joined: Tue Feb 24, 2009 5:16 am

#108 Post by tipiaks » Wed Feb 25, 2009 2:49 am

Anyone have ideas ?

sap
Posts: 1
Joined: Thu Feb 26, 2009 5:23 am

#109 Post by sap » Thu Feb 26, 2009 5:27 am

try this

php win_services.php 123.123.123.123 2:161:500:MLCBB: index


php win_services.php <IP address> <version>:<port>:<Timeout>:<String>: <space> <index/servstate>

tipiaks
Posts: 17
Joined: Tue Feb 24, 2009 5:16 am

#110 Post by tipiaks » Thu Feb 26, 2009 8:38 am

Hello,


Command return nothings...

no error but no result..

Mr_Flibble
Posts: 3
Joined: Wed Dec 05, 2007 7:07 am

#111 Post by Mr_Flibble » Tue May 19, 2009 9:50 am

I don't suppose anyone has found anything out about this ?

the not getting any errors but not getting any data when running the script from the command line

Although if I do a -a option from php I get the error

Warning: call_user_func_array(): First argumented is expected to be a valid callback, 'win_services' was given in /usr/share/cacti/site/scripts/win_services.php
on line 17.

(my biggest problem is I suck at php though)

kzero
Posts: 4
Joined: Wed Sep 02, 2009 11:25 pm

#112 Post by kzero » Wed Sep 02, 2009 11:31 pm

thank i already got it.


:D

User avatar
JorisFRST
Cacti User
Posts: 219
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

#113 Post by JorisFRST » Tue Sep 29, 2009 6:13 am

I get the following on 0.8.7e

[[email protected] ~]# php /var/www/cacti/scripts/win_services.php win_services hostname.domainname 2:161:500:public:::::: get servstate .84.67.83.82.86
PHP Notice: Undefined offset: 1 in /var/www/cacti/scripts/win_services.php on line 24
PHP Notice: Undefined offset: 2 in /var/www/cacti/scripts/win_services.php on line 25
PHP Notice: Undefined offset: 3 in /var/www/cacti/scripts/win_services.php on line 43
ERROR: Invalid Parameters

bsigmund
Posts: 5
Joined: Thu Feb 07, 2008 4:27 pm
Location: St. Louis, MO

Same undefined offset problem

#114 Post by bsigmund » Thu Oct 08, 2009 10:42 am

Same problem here with 0.8.7e. It did work ok on 0.8.7d.

User avatar
JorisFRST
Cacti User
Posts: 219
Joined: Mon Oct 02, 2006 1:22 pm
Location: Belgium
Contact:

#115 Post by JorisFRST » Fri Oct 09, 2009 8:08 am

I'm an idiot :

Download this :
http://forums.cacti.net/post-115955.html#115955

Then do this :
http://forums.cacti.net/post-116206.html#116206

I must have done something wrong first time I was looking at it, as I read the whole topic....

Confirmed to be working on 0.8.7e (cmd.php)

bdearlove
Posts: 19
Joined: Thu Jun 09, 2005 8:51 am

#116 Post by bdearlove » Tue Nov 10, 2009 7:20 am

Could someone post their scripts that are working. I have done the above steps with no success. Still receive -1. Thanks.

abigcat
Posts: 2
Joined: Mon May 10, 2010 4:43 pm

#117 Post by abigcat » Mon May 10, 2010 4:54 pm

If you see output is "-1", probably it is already working. In my test box, the output from manual run in command line is "-1" also and it works in the cacti php poller. If you enable debug in "poller logging level", you can see output results in cacti log. They are actually "1" instead of "-1" though.

In my case the graphs still won't draw after scripts are working. There are two problems with the default templates:

1, in the data template "win services", the "Maximum Value" is "0", which by no means the poller can possibly write an "1" into RRD files. Need to correct it to "1".

2. the RRAs in Management -> Data Sources, don't have "LAST" highlighted in the "Consolidation Functions". It reports an error "ERROR: the RRD does not contain an RRA matching the chosen CF ". If you click any graphs generated by graph template "win services" and turn on graph debug mode, you'll see that error message. Need to highlight "LAST" in all 5 RRAs and save.

After the above two changes, everything work fine.
bdearlove wrote:Could someone post their scripts that are working. I have done the above steps with no success. Still receive -1. Thanks.

abigcat
Posts: 2
Joined: Mon May 10, 2010 4:43 pm

#118 Post by abigcat » Thu May 13, 2010 5:20 pm

correction: the "Maximum Value" = "0" is fine, no need to change.
abigcat wrote:If you see output is "-1", probably it is already working. In my test box, the output from manual run in command line is "-1" also and it works in the cacti php poller. If you enable debug in "poller logging level", you can see output results in cacti log. They are actually "1" instead of "-1" though.

In my case the graphs still won't draw after scripts are working. There are two problems with the default templates:

1, in the data template "win services", the "Maximum Value" is "0", which by no means the poller can possibly write an "1" into RRD files. Need to correct it to "1".

2. the RRAs in Management -> Data Sources, don't have "LAST" highlighted in the "Consolidation Functions". It reports an error "ERROR: the RRD does not contain an RRA matching the chosen CF ". If you click any graphs generated by graph template "win services" and turn on graph debug mode, you'll see that error message. Need to highlight "LAST" in all 5 RRAs and save.

After the above two changes, everything work fine.
bdearlove wrote:Could someone post their scripts that are working. I have done the above steps with no success. Still receive -1. Thanks.

dfucitalo
Posts: 8
Joined: Wed Mar 11, 2009 3:04 pm

#119 Post by dfucitalo » Fri Jun 11, 2010 2:07 pm

Hi People .. I have one machine with Windows XP Portuguese Brazilian.

Some services do not show the real name, I thin it's because the accentuation like "á" "~"

Can someano help me?


+ Running data query [11].
+ Found type = '6 '[script query].
+ Found data query XML file at '/usr/share/cacti/resource/script_server/win_services.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/scripts/win_services.php 10.10.10.10 2:161:500:public:::::: index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/win_services.php 10.10.10.10 2:161:500:public:::::: query index'
+ Found item [ServiceIndex='Temas'] index: .84.101.109.97.115
+ Found item [ServiceIndex='Servidor'] index: .83.101.114.118.105.100.111.114
+ Found item [ServiceIndex='Telefonia'] index: .84.101.108.101.102.111.110.105.97
+ Found item [ServiceIndex='Cliente DNS'] index: 1.67.108.105.101.110.116.101.32.68.78.83
+ Found item [ServiceIndex='Cliente DHCP'] index: 2.67.108.105.101.110.116.101.32.68.72.67.80
+ Found item [ServiceIndex='Logon de rede'] index: 3.76.111.103.111.110.32.100.101.32.114.101.100.101
+ Found item [ServiceIndex='Plug and Play'] index: 3.80.108.117.103.32.97.110.100.32.80.108.97.121
+ Found item [ServiceIndex='53:65:72:76:69:C3:A7:6F:20:53:4E:4D:50'] index: 3.83.101.114.118.105.195.167.111.32.83.78.77.80
+ Found item [ServiceIndex='Cliente da Web'] index: 4.67.108.105.101.110.116.101.32.100.97.32.87.101.98
+ Found item [ServiceIndex='Log de eventos'] index: 4.76.111.103.32.100.101.32.101.118.101.110.116.111.115
+ Found item [ServiceIndex='Ajuda e suporte'] index: 5.65.106.117.100.97.32.101.32.115.117.112.111.114.116.101
+ Found item [ServiceIndex='Registro remoto'] index: 5.82.101.103.105.115.116.114.111.32.114.101.109.111.116.111
+ Found item [ServiceIndex='53:65:72:76:69:C3:A7:6F:73:20:49:50:53:45:43'] index: 5.83.101.114.118.105.195.167.111.115.32.73.80.83.69.67
+ Found item [ServiceIndex='43:6F:6E:65:78:C3:B5:65:73:20:64:65:20:72:65:64:65'] index: 7.67.111.110.101.120.195.181.101.115.32.100.101.32.114.101.100.101
+ Found item [ServiceIndex='4C:6F:67:6F:6E:20:73:65:63:75:6E:64:C3:A1:72:69:6F'] index: 7.76.111.103.111.110.32.115.101.99.117.110.100.195.161.114.105.111
+ Found item [ServiceIndex='C3:81:75:64:69:6F:20:64:6F:20:57:69:6E:64:6F:77:73'] index: 7.195.129.117.100.105.111.32.100.111.32.87.105.110.100.111.119.115
+ Found item [ServiceIndex='48:6F:72:C3:A1:72:69:6F:20:64:6F:20:57:69:6E:64:6F:77:73'] index: 9.72.111.114.195.161.114.105.111.32.100.111.32.87.105.110.100.111.119.115
+ Found item [ServiceIndex='Agendador de tarefas'] index: 0.65.103.101.110.100.97.100.111.114.32.100.101.32.116.97.114.101.102.97.115
+ Found item [ServiceIndex='VMware Tools Service'] index: 0.86.77.119.97.114.101.32.84.111.111.108.115.32.83.101.114.118.105.99.101
+ Found item [ServiceIndex='45:73:74:61:C3:A7:C3:A3:6F:20:64:65:20:74:72:61:62:61:6C:68:6F'] index: 1.69.115.116.97.195.167.195.163.111.32.100.101.32.116.114.97.98.97.108.104.111
+ Found item [ServiceIndex='53:65:72:76:69:C3:A7:6F:73:20:64:65:20:74:65:72:6D:69:6E:61:6C'] index: 1.83.101.114.118.105.195.167.111.115.32.100.101.32.116.101.114.109.105.110.97.108
+ Found item [ServiceIndex='53:70:6F:6F:6C:65:72:20:64:65:20:69:6D:70:72:65:73:73:C3:A3:6F'] index: 1.83.112.111.111.108.101.114.32.100.101.32.105.109.112.114.101.115.115.195.163.111
+ Found item [ServiceIndex='Armazenamento protegido'] index: 3.65.114.109.97.122.101.110.97.109.101.110.116.111.32.112.114.111.116.101.103.105.100.111
+ Found item [ServiceIndex='Auxiliar NetBIOS TCP/IP'] index: 3.65.117.120.105.108.105.97.114.32.78.101.116.66.73.79.83.32.84.67.80.47.73.80
+ Found item [ServiceIndex='Sistema de eventos COM+'] index: 3.83.105.115.116.101.109.97.32.100.101.32.101.118.101.110.116.111.115.32.67.79.77.43
+ Found item [ServiceIndex='53:65:72:76:69:C3:A7:6F:73:20:64:65:20:63:72:69:70:74:6F:67:72:61:66:69:61'] index: 5.83.101.114.118.105.195.167.111.115.32.100.101.32.

gsaray101
Cacti User
Posts: 233
Joined: Thu May 17, 2007 9:18 am
Contact:

window service

#120 Post by gsaray101 » Fri Aug 13, 2010 10:04 am

this is not working for me, this is the ouput from verbose query. can somebody help?

Code: Select all


Data Query Debug Information 
 
+ Running data query [42].
+ Found type = '6 '[script query].
+ Found data query XML file at 'D:/cacti/resource/script_server/win_services.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'c:\php\php.exe -q D:\cacti\scripts\win_services.php 192.168.101.56 DJServerInventory 2 6 index'
+ Executing script query 'c:\php\php.exe -q D:\cacti\scripts\win_services.php 192.168.101.56 DJServerInventory 2 6 query index'
+ Found data query XML file at 'D:/cacti/resource/script_server/win_services.xml'
+ Found data query XML file at 'D:/cacti/resource/script_server/win_services.xml'
+ Found data query XML file at 'D:/cacti/resource/script_server/win_services.xml' 
 

Post Reply