Script Server/No RRD files created

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
Zactaurus
Posts: 4
Joined: Sat Jun 11, 2005 5:50 pm
Location: Belgium

Script Server/No RRD files created

Post by Zactaurus »

New install on WinXP/cacti0.8.6d/PHP5/Mysql4.1

I will try Script server on memory usage on Cisco router.

The 'Data Query' on the host works fine. I can select the memory type to graph (processor or iomem).

The problem is with the poller. It doesn't try to retrieve value. RRD files aren't created but the graph is present.

'Poller logging level' is set to 'debug'
I have follow the Cacti manual. When I start the script manualy, it works fine.

I'm doing perhaps a mistake with 'DATA INPUT METHOD'? Is it true to use
'Get Script Server Data (indexed)'?
In which case must we use 'Script - Script Server (PHP)' type ?

Thanks in advance for your help.
Attachments
csTestMemory.xml
XML file
(1.3 KiB) Downloaded 133 times
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

It would help if you posted one cycle of the debug output and the verbose output of that script.
Zactaurus
Posts: 4
Joined: Sat Jun 11, 2005 5:50 pm
Location: Belgium

Post by Zactaurus »

Data Query Debug Information

+ Running data query [14].
+ Found type = '6 '[script query].
+ Found data query XML file at 'C:\WWW\cacti/resource/script_server/csTestMemory.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'c:\php\php-win.exe -q C:\WWW\cacti\scripts\ss_csTestMemory.php 192.168.0.250 xxxxx 2 161 500 index'
+ Executing script query 'c:\php\php-win.exe -q C:\WWW\cacti\scripts\ss_csTestMemory.php 192.168.0.250 xxxxx 2 161 500 query name'
+ Found item [ciscoMemoryPoolName='Processor'] index: 1
+ Found item [ciscoMemoryPoolName='I/O'] index: 2
+ Found data query XML file at 'C:\WWW\cacti/resource/script_server/csTestMemory.xml'
+ Found data query XML file at 'C:\WWW\cacti/resource/script_server/csTestMemory.xml'
+ Found data query XML file at 'C:\WWW\cacti/resource/script_server/csTestMemory.xml'



cactid output:

CACTID: Using cactid config file [cactid.conf]
CACTID: DEBUG: The path_php_server variable is c:\WWW\cacti/script_server.php
CACTID: DEBUG: The path_cactilog variable is C:\WWW\cacti/log/cacti.log
CACTID: DEBUG: The log_destination variable is 1
CACTID: DEBUG: The path_php variable is c:/php/php-win.exe
CACTID: DEBUG: The availability_method variable is 3
CACTID: DEBUG: The ping_recovery_count variable is 3
CACTID: DEBUG: The ping_failure_count variable is 2
CACTID: Windows Environment, root permissions not required for ICMP Ping
CACTID: DEBUG: The ping_method variable is 1
CACTID: DEBUG: The ping_retries variable is 1
CACTID: DEBUG: The ping_timeout variable is 400
CACTID: DEBUG: The log_perror variable is 1
CACTID: DEBUG: The log_pwarn variable is 1
CACTID: DEBUG: The log_pstats variable is 1
CACTID: DEBUG: The threads variable is 1
CACTID: CACTID: Version 0.8.6d starting
CACTID: MYSQL: Connecting to MySQL database 'cacti' on '127.0.0.1'...
CACTID: DEBUG: PHP Script Server Routine Started
CACTID: DEBUG: PHP Script Server About to FORK Child Process
CACTID: DEBUG: PHP Script Server Child FORK Success
CACTID: DEBUG: Confirmed PHP Script Server Running
CACTID: DEBUG: Initial Value of Active Threads is 0
CACTID: DEBUG: Valid Thread to be Created
CACTID: DEBUG: In Poller, About to Start Polling of Host
CACTID: MYSQL: Connecting to MySQL database 'cacti' on '127.0.0.1'...
CACTID: DEBUG: The Value of Active Threads is 1
CACTID: Host[6] PING: Result ICMP: Host is Alive
CACTID: DEBUG: SQLCMD: update host set status='3',status_event_count='0', status_fail_date='0000-00-00 00:00:00',status_rec_date='00
00-00-00 00:00:00',status_last_error='',min_time='3.999950',max_time='48.000100',cur_time='5.000110',avg_time='7.667849',total_polls
='196',failed_polls='0',availability='100.0000' where id='6'

CACTID: Host[6] RECACHE: Processing 3 items in the auto reindex cache for '192.168.0.250'
CACTID: Host[6] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
CACTID: DEBUG: The Value of Active Threads is 0
CACTID: DEBUG: SQLCMD: replace into settings (name,value) values ('date',NOW())
CACTID: DEBUG: SQLCMD: insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())
CACTID: DEBUG: Thread Cleanup Complete
CACTID: DEBUG: PHP Script Server Shutdown Started
CACTID: DEBUG: PHP Script Server Pipes Closed

CACTID: DEBUG: Allocated Variable Memory Freed
CACTID: DEBUG: MYSQL Free & Close Completed
CACTID: Execution Time: 2.1210 s, Threads: 1, Hosts: 1



Manual Script server output:

C:\WWW\cacti>php c:/www/cacti/script_server.php
PHP Script Server has Started - Parent is cmd
c:/www/cacti/scripts/ss_csTestMemory.php ss_csTestMemory 192.168.0.250 xxxxx 2 161 500 get used 1
5174744
c:/www/cacti/scripts/ss_csTestMemory.php ss_csTestMemory 192.168.0.250 xxxxx 2 161 500 get free 1
9795132
c:/www/cacti/scripts/ss_csTestMemory.php ss_csTestMemory 192.168.0.250 xxxxx 2 161 500 get largeFree 1
9782632
Attachments
A extract of Data Source
A extract of Data Source
DS_ Cisco-TestMemory.png (4.47 KiB) Viewed 1710 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I see one of your problems. Please review the following:
'c:\php\php-win.exe -q C:\WWW\cacti\scripts\ss_csTestMemory.php 192.168.0.250 xxxxx 2 161 500 query name'
It should read as follows:
'c:\php\php-win.exe -q C:\WWW\cacti\scripts\ss_csTestMemory.php ss_csTestMemory 192.168.0.250 xxxxx 2 161 500 query name'
I should never have written the script server to use that syntax, an I might change it, but for right now, that is it. In the future, I will just take the filename remove the ".php" and call that function. Makes it easier.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Zactaurus
Posts: 4
Joined: Sat Jun 11, 2005 5:50 pm
Location: Belgium

Post by Zactaurus »

Data Query work fine. It's display correctly the type of memories.

C:\>c:\php\php.exe C:\WWW\cacti\scripts\ss_csTestMemory.php 192.168.0.250 NetSurvey 2 161 500 index
1
2


If I add the function name in the command, that doesn't work.

c:\php\php.exe C:\WWW\cacti\scripts\ss_csTestMemory.php ss_csTestMemory 192.168.0.250 NetSurvey 2 161 500 index

Data Query doesn't use script_server.php but just php.

The problem is when I want create a graph for memory, graph and data are displayed in 'graph management' and 'data sources' but the poller doesn't poll the device. :(

I have follow the Chapter12 in the PDF Manual and with the 2 examples (ss_host_cpu.php, ss_host_disk.php)
Attachments
Data Query Display
Data Query Display
Data_Query_Display.png (1.82 KiB) Viewed 1669 times
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Please note since this is not in the manual (sorry). The indexes and other associated information associated with the query, must be returned with a print. The "gets", that which return the values to be graphed, need to be returned with a "return" command.

This will fix your problem.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Zactaurus
Posts: 4
Joined: Sat Jun 11, 2005 5:50 pm
Location: Belgium

Post by Zactaurus »

Thanks for your quick feed back.

No excuse accept! You already specifies to use RETURN in place of PRINT for 'gets' part ['Manual Cacti' Chapter 12.3.1.4] :wink:

The problem is that the poller doesn't start the script?!

Actually, I'm parsing Cacti to find how host is insert in the poller list.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests