Cactid 0.86c & d changing backslashes to forward slashes

Post support questions that relate to the Windows 2003/2000/XP operating systems.

Moderators: Developers, Moderators

User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

There is a function that hoses a database setting called "path_webroot". Try changing to the following in poller.php:

Code: Select all

	db_execute("REPLACE INTO settings (name,value) VALUES ('path_webroot','" . addslashes(($config["cacti_server_os"] == "win32") ? strtolower(str_replace("\\","/",substr(dirname(__FILE__), 0, 1))) . str_replace("\\","/",substr(dirname(__FILE__), 1)) : dirname(__FILE__)) . "')");"
Just look for "path_webroot" in that file, the rest will make sense. You will have to run poller once for it to take affect.

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?
Brashquido
Cacti User
Posts: 99
Joined: Sat Feb 28, 2004 10:16 pm
Location: Melbourne, Australia
Contact:

Post by Brashquido »

The extra " on the end there tripped me up for a second :-P . Still getting the same error though even with the modifications you suggested above :-? .
Dominic Ryan
www.iis-aid.com
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Check the value of "path_webroot" in the settings table, then change your hardcoded path's back to it's prior state and then rerun. Post your output.

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?
Brashquido
Cacti User
Posts: 99
Joined: Sat Feb 28, 2004 10:16 pm
Location: Melbourne, Australia
Contact:

Post by Brashquido »

path_webroot was set to D:/cacti in the settings table. I set the hardcoded paths in my data input method back to <path_cacti> but I'm still getting the same error.
D:\cactid>cactid
CACTID: Using cactid config file [cactid.conf]
CACTID: Windows Environment, root permissions not required for ICMP Ping
CACTID: Version 0.8.6d starting
No log handling enabled - turning on stderr logging
Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
CACTID: Host[2] PING: Result UDP: Host is Alive
Can't open perl script "D:cacti/scripts/w32_perfmon.pl": No such file or directory
CACTID: Host[2] ERROR: Empty result [127.0.0.1]: 'perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/cpu-usage.csv "\\ADA-1048\Processor(_Total)\Processor Time"'
CACTID: Host[2] WARNING: Result from SCRIPT not valid. Partial Result: U...
CACTID: Host[2] SCRIPT: perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/cpu-usage.csv "\\ADA-1048\Processor(_Total)\Processor Time", output: U
Can't open perl script "D:cacti/scripts/w32_perfmon.pl": No such file or directory
CACTID: Host[2] ERROR: Empty result [127.0.0.1]: 'perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/disk-usage.csv "\\ADA-1048\LogicalDisk(_Total)\Free Megabytes"'
CACTID: Host[2] WARNING: Result from SCRIPT not valid. Partial Result: U...
CACTID: Host[2] SCRIPT: perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/disk-usage.csv "\\ADA-1048\LogicalDisk(_Total)\Free Megabytes", output: U
Can't open perl script "D:cacti/scripts/w32_perfmon.pl": No such file or directory
CACTID: Host[2] ERROR: Empty result [127.0.0.1]: 'perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/ram-usage.csv "\\ADA-1048\Memory\Pages/sec"'
CACTID: Host[2] WARNING: Result from SCRIPT not valid. Partial Result: U...
CACTID: Host[2] SCRIPT: perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/ram-usage.csv "\\ADA-1048\Memory\Pages/sec", output: U
Can't open perl script "D:cacti/scripts/w32_perfmon.pl": No such file or directory
CACTID: Host[2] ERROR: Empty result [127.0.0.1]: 'perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/thresholds.csv "RAM"'
CACTID: Host[2] WARNING: Result from SCRIPT not valid. Partial Result: U...
CACTID: Host[2] SCRIPT: perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/thresholds.csv "RAM", output: U
CACTID: Execution Time: 2.9990 s, Threads: 1, Hosts: 1
I also tried setting path_webroot to D:\cacti but still the same thing. It seems to be working fine in cmd.php mode, just cactid is not loving this first slash :-?
Last edited by Brashquido on Mon Jan 31, 2005 12:46 am, edited 1 time in total.
Dominic Ryan
www.iis-aid.com
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Clear your poller cache.

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?
Brashquido
Cacti User
Posts: 99
Joined: Sat Feb 28, 2004 10:16 pm
Location: Melbourne, Australia
Contact:

Post by Brashquido »

I cleared it, but still no difference. THis is the full debug output (sorry);
D:\cactid>cactid
CACTID: Using cactid config file [cactid.conf]
CACTID: DEBUG: The path_php_server variable is d:/cacti/script_server.php
CACTID: DEBUG: The path_cactilog variable is D:/cacti/log/cacti.log
CACTID: DEBUG: The log_destination variable is 1
CACTID: DEBUG: The path_php variable is c:/php4/php/php.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 2
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 0
CACTID: DEBUG: The threads variable is 1
CACTID: CACTID: Version 0.8.6d starting
CACTID: MYSQL: Connecting to MySQL database 'cactitest' on '127.0.0.1'...
No log handling enabled - turning on stderr logging
Cannot find module (NOTIFICATION-LOG-MIB): At line 1 in (none)
Cannot find module (NET-SNMP-AGENT-MIB): At line 1 in (none)
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: In Poller, About to Start Polling of Host
CACTID: MYSQL: Connecting to MySQL database 'cactitest' on '127.0.0.1'...
CACTID: DEBUG: Valid Thread to be Created
CACTID: DEBUG: The Value of Active Threads is 1
CACTID: DEBUG: The UDP Ping return_code was -1, errno was 104, total_time was 0.0000
CACTID: Host[2] PING: Result UDP: Host is Alive
CACTID: DEBUG: SQLCMD: update host set status='3',status_event_count='0', status_fail_date='2005-01-27 10:10:00',status_rec_date='2005-01-27 10:12:00',status_last_error='Host did not respond to SNMP, UDP: Host is Alive',min_time='0.000000',max_time='72.999950',cur_time='0.000000',avg_time='0.668362',total_polls='7582',failed_polls='22',availability='99.7098' where id='2'

CACTID: Host[2] DEBUG: The POPEN returned the following File Descriptor 9
Can't open perl script "D:cacti/scripts/w32_perfmon.pl": No such file or directory
CACTID: Host[2] ERROR: Empty result [127.0.0.1]: 'perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/cpu-usage.csv "\\ADA-1048\Processor(_Total)\Processor Time"'
CACTID: Host[2] WARNING: Result from SCRIPT not valid. Partial Result: U...
CACTID: Host[2] SCRIPT: perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/cpu-usage.csv "\\ADA-1048\Processor(_Total)\Processor Time", output: U
CACTID: DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (17,'CPU','2005-01-31 16:59:15','U')
CACTID: Host[2] DEBUG: The POPEN returned the following File Descriptor 9
Can't open perl script "D:cacti/scripts/w32_perfmon.pl": No such file or directory
CACTID: Host[2] ERROR: Empty result [127.0.0.1]: 'perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/disk-usage.csv "\\ADA-1048\LogicalDisk(_Total)\Free Megabytes"'
CACTID: Host[2] WARNING: Result from SCRIPT not valid. Partial Result: U...
CACTID: Host[2] SCRIPT: perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/disk-usage.csv "\\ADA-1048\LogicalDisk(_Total)\Free Megabytes", output: U
CACTID: DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (23,'Disk','2005-01-31 16:59:15','U')
CACTID: Host[2] DEBUG: The POPEN returned the following File Descriptor 9
Can't open perl script "D:cacti/scripts/w32_perfmon.pl": No such file or directory
CACTID: Host[2] ERROR: Empty result [127.0.0.1]: 'perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/ram-usage.csv "\\ADA-1048\Memory\Pages/sec"'
CACTID: Host[2] WARNING: Result from SCRIPT not valid. Partial Result: U...
CACTID: Host[2] SCRIPT: perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/ram-usage.csv "\\ADA-1048\Memory\Pages/sec", output: U
CACTID: DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (25,'RAM','2005-01-31 16:59:15','U')
CACTID: Host[2] DEBUG: The POPEN returned the following File Descriptor 9
Can't open perl script "D:cacti/scripts/w32_perfmon.pl": No such file or directory
CACTID: Host[2] ERROR: Empty result [127.0.0.1]: 'perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/thresholds.csv "RAM"'
CACTID: Host[2] WARNING: Result from SCRIPT not valid. Partial Result: U...
CACTID: Host[2] SCRIPT: perl D:\cacti/scripts/w32_perfmon.pl c:/perflogs/thresholds.csv "RAM", output: U
CACTID: DEBUG: SQLCMD: insert into poller_output (local_data_id,rrd_name,time,output) values (26,'Threshold-Ram','2005-01-31 16:59:15','U')
CACTID: Host[2] 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.9080 s, Threads: 1, Hosts: 1

D:\cactid>
Dominic Ryan
www.iis-aid.com
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Dominic,

Dump your database and send to my email.

mysqldump --user=root --password cacti > dominic.sql

I've got to turn in. Will checkup in the morning. You should also review your poller cache using the "View Poller Cache" command. The backslash is still there.

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?
Brashquido
Cacti User
Posts: 99
Joined: Sat Feb 28, 2004 10:16 pm
Location: Melbourne, Australia
Contact:

Post by Brashquido »

Thanks, I'll zip it up now. Just noticed my data sources are using <path_rra> rather than <path_cacti>. Going to try swapping them to see if the changes the slash orientation. Thanks so much for all your help thewitness :-)
Dominic Ryan
www.iis-aid.com
Brashquido
Cacti User
Posts: 99
Joined: Sat Feb 28, 2004 10:16 pm
Location: Melbourne, Australia
Contact:

Post by Brashquido »

Bugger, that made no difference. Database is on its way....
Dominic Ryan
www.iis-aid.com
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Dominic,

Please review the attached. Your scripts require modification. Change all back slashes to forward slashes. That will get you through this for now.

I must think of a new solution. Will take a while though.
perl D:\\cacti/scripts/w32_perfmon.pl
Should be
perl D:/cacti/scripts/w32_perfmon.pl
I will be able to take a closer look at your database tonight.

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?
Brashquido
Cacti User
Posts: 99
Joined: Sat Feb 28, 2004 10:16 pm
Location: Melbourne, Australia
Contact:

Post by Brashquido »

No worries TheWitness :)

I'll stick to using cmd.php as the poller for now as it has no troubles with any of the slashes. Windows performance monitor seperates values in the counter name with backslashes, so I have no choice there. If I were to modify my script to convert all backslashes to forward slashes then performance would be effected pretty bad I'd imagine as I planning to monitor upwards of 400 Windows performance counters.

My gut feeling is that it is Cactid that is causing the issues with the slashes as cmd.php has no problems. This is an uneducated guess though as I am really very new to all of this. I'll wait to see what you're able to come up with :)
Dominic Ryan
www.iis-aid.com
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

It is an escaping issue that I need to write an algorythm for. One that is intellegent enough to work around that issue. I might just do it in the poller. I have to think about it anyway.

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?
Brashquido
Cacti User
Posts: 99
Joined: Sat Feb 28, 2004 10:16 pm
Location: Melbourne, Australia
Contact:

Post by Brashquido »

No problems TheWitness :-)
Dominic Ryan
www.iis-aid.com
User avatar
TheWitness
Developer
Posts: 17062
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

All,

Patch ready for testing at the following link. You will have to make. If you don't have the resources to make, send me an e-mail and I will send you a binary built for MySQL 4.1.

Please post in that post the results of your testing. Fixes the backslash to forward slash issue.

TheWitness

http://forums.cacti.net/viewtopic.php?p=26992#26992
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?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest