Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Jun 26, 2019 11:20 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 159 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10, 11  Next
Author Message
 Post subject:
PostPosted: Mon Jan 07, 2008 3:21 am 
Offline

Joined: Tue Nov 28, 2006 10:44 am
Posts: 18
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:

[[email protected] 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


Top
 Profile  
 
 Post subject: win_service.php problem
PostPosted: Mon Jan 07, 2008 6:34 am 
Offline
User avatar

Joined: Sat Jan 05, 2008 9:32 am
Posts: 1
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. :o


Top
 Profile  
 
 Post subject: Still unable to get the XML to read results
PostPosted: Wed Jan 23, 2008 10:04 am 
Offline

Joined: Wed May 31, 2006 10:11 pm
Posts: 14
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
Plugins
    Network 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)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 15, 2008 6:57 am 
Offline

Joined: Thu Feb 14, 2008 10:11 am
Posts: 3
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);
         }


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 01, 2008 12:13 pm 
Offline

Joined: Thu Jul 27, 2006 7:58 pm
Posts: 5
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.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 18, 2008 8:33 am 
Offline
Cacti User

Joined: Fri Feb 02, 2007 8:36 am
Posts: 78
Location: Eindhoven/The Netherlands
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
Code:
if ( 1==1) {
:)

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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 13, 2008 2:21 pm 
Offline

Joined: Fri Apr 11, 2008 9:19 am
Posts: 16
I had to change my SNMP to version 1, and they it worked.

FYI


Top
 Profile  
 
 Post subject: Service State 0 for running services
PostPosted: Wed Jun 04, 2008 9:41 am 
Offline

Joined: Wed Jun 04, 2008 9:34 am
Posts: 2
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


Top
 Profile  
 
 Post subject: Service State 0 for running services
PostPosted: Wed Jun 04, 2008 10:00 am 
Offline

Joined: Wed Jun 04, 2008 9:34 am
Posts: 2
Service Graphs started working.

Maybe I just need a little patience.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 12, 2008 11:00 am 
Offline

Joined: Sun Jul 13, 2008 10:28 am
Posts: 9
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)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 07, 2008 3:16 pm 
Offline
Developer

Joined: Thu Apr 07, 2005 3:29 pm
Posts: 2765
Location: B/CS Texas
A future version of thold will support this... but not yet.

_________________
Report a bug
Download Releases
1.X Compatible Plugins


Top
 Profile  
 
 Post subject: Windows Service Monitoring need assistance
PostPosted: Tue Oct 21, 2008 4:21 pm 
Offline

Joined: Tue Sep 30, 2008 9:28 pm
Posts: 5
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);
         }


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 27, 2008 7:00 pm 
Offline
Cacti User
User avatar

Joined: Thu Sep 22, 2005 7:50 pm
Posts: 242
Location: Landenberg, PA
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?

_________________
Thank you,

Ernie
http://www.NMSWorld.com
Dual Zeon Dual Core 2.6Ghz / 8GB RAM / 4x15k RPM SATA RAID5
Cacti Version - 0.8.7b
Poller Type - cactid 0.8.7 with Boost v1.7
Server Info - FreeBSD 7.0-RELEASE
Web Server - Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.8g DAV/2 PHP/5.2.5 mod_perl/2.0.3 Perl/v5.8.8
PHP - 5.2.6
MySQL - 5.0.51b Mod: poller_output ENGINE = MEMORY
RRDTool - 1.3.0
SNMP - 5.4.1
Plugins - Host Info (hostinfo - v0.2), Update Checker (update - v0.3), Network Tools (tools - v0.2), FlowView (flowview - v0.3), Read-only Devices Tab (devices - v0.4), Network Discovery (discovery - v0.8.3), Syslog Monitoring (syslog - v0.5.2), Thresholds (thold - v0.3.9), Device Monitoring (monitor - v0.8.2), PHP Network Weathermap (weathermap - v0.941), SuperLinks (superlinks - v0.72), Report Creator (reports - v0.1b)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 19, 2008 5:01 am 
Offline
Cacti User

Joined: Tue Dec 05, 2006 5:10 am
Posts: 67
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.


Attachments:
winservices.PNG
winservices.PNG [ 15.66 KiB | Viewed 10732 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 04, 2008 1:42 am 
Offline

Joined: Thu Dec 04, 2008 1:40 am
Posts: 1
thanks much


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 159 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10, 11  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 18 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