Can't open perl script ...

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Valentin
Posts: 8
Joined: Mon Jan 06, 2003 11:04 am

Can't open perl script ...

Post by Valentin »

Hi,

I've installed cacti on my linux server. But there are some problems with getting the data for the graphs.
When I run the cmd.php the perl scripts could'nt get opened:

[root@t35 root]# php /www/system/monitoring/cmd.php
Can't open perl script "/scripts/users.pl": Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/ping.pl": Datei oder Verzeichnis nicht gefunden
sh: line 1: /usr/bin/smbstatus: Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/memfree.pl": Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/memfree.pl": Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/memfree.pl": Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/proc.pl": Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/memfree.pl": Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/webhits.pl": Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/memfree.pl": Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/tcp.pl": Datei oder Verzeichnis nicht gefunden
Can't open perl script "/scripts/loadavg_multi.pl": Datei oder Verzeichnis nicht gefunden
Content-type: text/html
X-Powered-By: PHP/4.3.0


"Datei oder Verzeichnis nicht gefunden" (sorry, german errors ;)) = File not found

The perl scripts are in the cacti-directory:

[root@t35 root]# cd /www/system/monitoring/scripts/
[root@t35 scripts]# dir
3com_cable_modem.pl loadavg_multi.pl memfree.pl ping.pl snmp.pl tcp_custom.pl tcp.pl weatherbug.pl
diskfree.pl loadavg.pl ping-new.pl proc.pl sql.php tcp_custom_snmp.pl users.pl webhits.pl

I've no idea where this / bevor scripts comes from.

Please help me :)

thx

Valentin
Valentin
Posts: 8
Joined: Mon Jan 06, 2003 11:04 am

Post by Valentin »

problem fixed ... with the full path in the mysql query everything works fine :)
Guest

Post by Guest »

Valentin:

Can you please provide more information about the mysql query path? I am getting the same error and would appreciate a fix.
Valentin
Posts: 8
Joined: Mon Jan 06, 2003 11:04 am

Post by Valentin »

There is the dump of the src sql table:

Code: Select all

#
# Table structure for table `src`
#

CREATE TABLE src (
  ID smallint(5) NOT NULL auto_increment,
  Name varchar(200) NOT NULL default '',
  FormatStrIn mediumblob,
  FormatStrOut mediumblob,
  Type varchar(20) default NULL,
  PRIMARY KEY  (ID),
  UNIQUE KEY ID (ID)
) TYPE=MyISAM;

#
# Dumping data for table `src`
#

INSERT INTO src VALUES (6, 'Get Logged In Users', 'perl <path_cacti>/scripts/users.pl <username>', '<users>', NULL);
INSERT INTO src VALUES (7, 'Get TCP Connections', 'perl <path_cacti>/scripts/tcp.pl <mode>', '<connections>', NULL);
INSERT INTO src VALUES (9, 'Get Load Average', 'perl <path_cacti>/scripts/loadavg_multi.pl', '<1min> <5min> <10min>', '');
INSERT INTO src VALUES (5, 'Get System Processes', 'perl <path_cacti>/scripts/proc.pl', '<proc>', NULL);
INSERT INTO src VALUES (1, 'Ping Host', 'perl <path_cacti>/scripts/ping.pl <ip>', '<out_ms>', NULL);
INSERT INTO src VALUES (11, 'Get SNMP Network Data', 'INTERNAL: [<ip>/<community>] Interface: [<ifnum>]', '<octets>', 'snmp_net');
INSERT INTO src VALUES (31, 'Get Free Disk Space', 'perl <path_cacti>/scripts/diskfree.pl <partition>', '<megabytes>:<percent>', '');
INSERT INTO src VALUES (19, 'Get Custom TCP Connections', 'perl <path_cacti>/scripts/tcp_custom.pl <grepstr>', '<connections>', '');
INSERT INTO src VALUES (27, 'Get TCP Connections (SNMP)', 'perl <path_cacti>/scripts/tcp_custom_snmp.pl <ip> <community> <mode>', '<connections>', NULL);
INSERT INTO src VALUES (22, 'Get Number of Open Samba Files', '/usr/bin/smbstatus | grep -c "_"', '<openfiles>', NULL);
INSERT INTO src VALUES (23, 'Get Web Hits', 'perl <path_cacti>/scripts/webhits.pl <log_path>', '<webhits>', '');
INSERT INTO src VALUES (24, 'Get Memory Usage', 'perl <path_cacti>/scripts/memfree.pl <grepstr>', '<mem>', NULL);
INSERT INTO src VALUES (8, 'Get SQL Connections', '<path_php_binary> -q <path_cacti>/scripts/sql.php', '<sql_connections>', NULL);
INSERT INTO src VALUES (13, 'Get SNMP Data', 'INTERNAL: [<ip>/<community>] OID: [<oid>]', '<octets>', 'snmp');
INSERT INTO src VALUES (32, 'Get Load Average (Remote SSH)', 'ssh <username>@<hostname> perl load.pl', '<1min> <5min> <10min>', '');
# --------------------------------------------------------
You only have to put your path where the <path_cacti> is (e.g /var/www/html/cacti or something) and drop the old 'src' table from the mysql database and import this one.

That's all :)
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

This problem may be caused by incorrect cacti settings. Open cacti settings page and look ath the bottom. There are two text boxes which are used to compose <path_cacti>: "cacti Web Root" (should be /monitoring in your case) and "Web Server Document Root" (should be /www/system in your case).

- bulek
Valentin
Posts: 8
Joined: Mon Jan 06, 2003 11:04 am

Post by Valentin »

bulek ... I've had the right settings, but it had not worked ;)

caused by php 4.3.0 ? :roll:
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests