|
|
| Author |
Message |
lupick
Joined: 28 Nov 2006 Posts: 8
|
Posted: Mon Jan 07, 2008 3:21 am Post subject: |
|
|
| lupick wrote: | | 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. |
I've tried with cacti 0.87a ver on RHEL linuxbox.
if I run:
[root@linuxbox scripts]# php ./win_services.php winhost.domain.name public 2 9 index
PHP Fatal error: Call to undefined function read_config_option() in /var/www/html/cacti/lib/snmp.php on line 233
Any Ideas how to solve it?!?
thanks
L. |
Full debug:
PHP Notice: Undefined variable: config in /var/www/html/cacti/lib/snmp.php on line 33
PHP Notice: Use of undefined constant SNMP_POLLER - assumed 'SNMP_POLLER' in /var/www/html/cacti/scripts/win_services_ori.php on line 24
PHP Warning: Missing argument 10 for cacti_snmp_walk(), called in /var/www/html/cacti/scripts/win_services_ori.php on line 24 and defined in /var/www/html/cacti/lib/snmp.php on line 225
PHP Notice: Use of undefined constant SNMP_POLLER - assumed 'SNMP_POLLER' in /var/www/html/cacti/lib/snmp.php on line 225
PHP Fatal error: Call to undefined function read_config_option() in /var/www/html/cacti/lib/snmp.php on line 233
|
|
| Back to top |
|
 |
anemisti
Joined: 05 Jan 2008 Posts: 1
|
Posted: Mon Jan 07, 2008 6:34 am Post subject: win_service.php problem |
|
|
Hi Lupick
I solved by adding the following string to the file win_service.php
include_once(dirname(__FILE__) . "/../include/global.php");
seems to be that work correctly.
A.
|
|
| Back to top |
|
 |
mrloon
Joined: 31 May 2006 Posts: 12
|
Posted: Wed Jan 23, 2008 10:04 am Post subject: Still unable to get the XML to read results |
|
|
I've grabbed the latest zip of the services query, and made the change from 36 to 35 for position (tried at 36 also), as well as the change for adding the global.php file, but still no results:
+ Running data query [26].
+ Found type = '6 '[script query].
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_server/win_services.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\win_services.php localhost 1:161:500:xxx:::MD5::DES: index'
+ Executing script query 'c:\php\php.exe -q C:\Inetpub\wwwroot\cacti\scripts\win_services.php localhost 1:161:500:xxx:::MD5::DES: query index'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_server/win_services.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_server/win_services.xml'
+ Found data query XML file at 'C:/Inetpub/wwwroot/cacti/resource/script_server/win_services.xml'
Is there any other reason for it? When I run the script noted above manually from a command prompt, I do see the index OIDs, as well as the second line providing the names of the services.
What else should I attempt?
| Quote: | Cacti Version - 0.8.7a
Plugin Architecture - 1.4
Poller Type - CMD.php
Server Info - Windows NT 5.2
Web Server - Microsoft-IIS/6.0
PHP - 5.2.4
PHP Extensions - bcmath, calendar, com_dotnet, ctype, session, filter, ftp, hash, iconv, json, odbc, pcre, Reflection, date, libxml, standard, tokenizer, zlib, SimpleXML, dom, SPL, wddx, xml, xmlreader, xmlwriter, ISAPI, gd, mysql, snmp, sockets, RRDTool
MySQL - 5.0.45-community-nt
RRDTool - 1.2.15
PluginsNetwork Discovery (discovery - v0.8.3)
Documents (docs - v0.1)
Host Info (hostinfo - v0.2)
PHP Network Managing (manage - v0.5.1)
Device Monitoring (monitor - v0.8.2)
Global Plugin Settings (settings - v0.3)
Thresholds (thold - v0.3.9)
Network Tools (tools - v0.2)
Update Checker (update - v0.4)
ReportIt (ReportIt - v0.5.1)
Report Creator (reports - v0.3) |
|
|
| Back to top |
|
 |
ato
Joined: 14 Feb 2008 Posts: 3
|
Posted: Fri Feb 15, 2008 6:57 am Post subject: |
|
|
I've got a blank graph in cacti 8.7b under windows 2003 SP2, and I resolv my problem.
winservice.php :
line 51:
| Code: |
for ($i=0; $i < sizeof($return_arr); $i++) {
if (substr($return_arr[$i]['oid'],0,4) == "SNMP")
print substr($return_arr[$i]['oid'],37) . "\n";
else
print substr($return_arr[$i]['oid'],27) . "\n";
}
|
line 61:
| Code: |
for ($i = 0; $i < sizeof($arr_index); $i++) {
if (substr($arr_index[$i]['oid'],0,4) == "SNMP")
$arr_index2[$i] = substr($arr_index[$i]['oid'],37);
else
$arr_index2[$i] = substr($arr_index[$i]['oid'],27);
}
|
|
|
| Back to top |
|
 |
old8xp
Joined: 27 Jul 2006 Posts: 4
|
Posted: Sat Mar 01, 2008 12:13 pm Post subject: |
|
|
I have use the template in RHL 8.0 . But It can't graph a blank . "nan"
when I look the cacti log:
"03/02/2008 01:27:01 AM - CMDPHP: Poller[0] Host[2] DS[8] WARNING: Result from SERVER not valid. Partial Result: U "
it seem the template can't work well in Linux.
how can I solve it?
think U a lot.
| 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. |
|
|
| Back to top |
|
 |
YoMarK Cacti User
Joined: 02 Feb 2007 Posts: 69 Location: Eindhoven/The Netherlands
|
Posted: Fri Apr 18, 2008 8:33 am Post subject: |
|
|
Hi old8xp: I did have the same problem(I think).
"Solved" it by replacing | Code: | | if ((func_num_args() <= "4") && (func_num_args() >= "3")) { | on line 46 by
Don't know why this check is even in, because there are always 5 arguments in my case:
| Quote: | C:\wamp\www>php C:\wamp\www\scripts\win_services.php 10.1.14.147(1) 2:161:1000:publ
ic:::MD5::DES:(2) get(3) servstate(4) .17.65.117.116.111.109.97.116.105.99.32.85.112.100.
97.116.101234234234(5) |
Also, i needed to apply the changes from mories on the first page.
|
|
| Back to top |
|
 |
rlund
Joined: 11 Apr 2008 Posts: 14
|
Posted: Tue May 13, 2008 2:21 pm Post subject: |
|
|
I had to change my SNMP to version 1, and they it worked.
FYI
|
|
| Back to top |
|
 |
bharmon
Joined: 04 Jun 2008 Posts: 2
|
Posted: Wed Jun 04, 2008 9:41 am Post subject: Service State 0 for running services |
|
|
I have read thru this entire post and have solved many of my problems.
So thanks for everyone's input.
The problem I am having now is that when I monitor a service it always shows "service state 0" even though the service is running.
Does anyone have any ideas?
Thanks
|
|
| Back to top |
|
 |
bharmon
Joined: 04 Jun 2008 Posts: 2
|
Posted: Wed Jun 04, 2008 10:00 am Post subject: Service State 0 for running services |
|
|
Service Graphs started working.
Maybe I just need a little patience.
Thanks
|
|
| Back to top |
|
 |
gueutzilla
Joined: 13 Jul 2008 Posts: 9
|
Posted: Fri Sep 12, 2008 11:00 am Post subject: |
|
|
Hi,
Thanks for this template. This work perfectly after make some modifications in win_service.php.
I have a question... Do you know how can we restart a windows service if it reply output : 0 for 2 times???
for exemple, if my service fail, I would like to send a query to force restrating service on the remote host like "net start MyService".
Is it possible???
Thanks ;o)
|
|
| Back to top |
|
 |
cigamit Developer
Joined: 07 Apr 2005 Posts: 978 Location: B/CS Texas
|
Posted: Tue Oct 07, 2008 3:16 pm Post subject: |
|
|
| A future version of thold will support this... but not yet.
|
|
| Back to top |
|
 |
thebull
Joined: 30 Sep 2008 Posts: 5
|
Posted: Tue Oct 21, 2008 4:21 pm Post subject: Windows Service Monitoring need assistance |
|
|
I made the changes and i have the same config mentioned below and same problem. I would love to know do i need to make any changes apart from this.
| ato wrote: | I've got a blank graph in cacti 8.7b under windows 2003 SP2, and I resolv my problem.
winservice.php :
line 51:
| Code: |
for ($i=0; $i < sizeof($return_arr); $i++) {
if (substr($return_arr[$i]['oid'],0,4) == "SNMP")
print substr($return_arr[$i]['oid'],37) . "\n";
else
print substr($return_arr[$i]['oid'],27) . "\n";
}
|
line 61:
| Code: |
for ($i = 0; $i < sizeof($arr_index); $i++) {
if (substr($arr_index[$i]['oid'],0,4) == "SNMP")
$arr_index2[$i] = substr($arr_index[$i]['oid'],37);
else
$arr_index2[$i] = substr($arr_index[$i]['oid'],27);
}
|
|
|
|
| Back to top |
|
 |
N3NCY Cacti User
Joined: 22 Sep 2005 Posts: 242 Location: Landenberg, PA
|
Posted: Mon Oct 27, 2008 7:00 pm Post subject: |
|
|
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?
|
|
| Back to top |
|
 |
cspenpen
Joined: 05 Dec 2006 Posts: 19
|
Posted: Wed Nov 19, 2008 5:01 am Post subject: |
|
|
Hello
I install this version, but the graph still show service state is 0.
I modify win_services.php refer to those discuss, but I still get 0.
How can I do to fix this issue?
thx
| 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. |
| Description: |
|
| Filesize: |
15.66 KB |
| Viewed: |
583 Time(s) |

|
|
|
| Back to top |
|
 |
colaandice
Joined: 04 Dec 2008 Posts: 1
|
Posted: Thu Dec 04, 2008 1:42 am Post subject: |
|
|
| thanks much
|
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|