Monitor Windows Service stats from Linux
Moderators: Developers, Moderators
Hello,
I have the same problem, anyone find a solution ?
Thanks for help !
I have the same problem, anyone find a solution ?
N3NCY wrote:Any thoughts on this error?
[root@FreeBSD /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 !
-
- Posts: 3
- Joined: Wed Dec 05, 2007 7:07 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)
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)
I get the following on 0.8.7e
[root@cacticentos ~]# 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
[root@cacticentos ~]# 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
Same undefined offset problem
Same problem here with 0.8.7e. It did work ok on 0.8.7d.
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)
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)
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.
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.
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.
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.
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.
window service
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'
Who is online
Users browsing this forum: No registered users and 5 guests