Hallo,
habe in Perl/CGI ein Monitoringtool mitentwickelt und nun stehen wir vor einem Problem, was nicht so auf die schnelle behebar ist.
Es läuft wie folgt ab.
Das Hauptprogramm läuft dauerhaft und startet einzelne Prozessdateien zur Überprüfung.
Die Ergebnisse werden über apache den Anwendern präsentiert.
Ebenso können Anwender mit Administrationsrechten das Hauptprogramm beenden oder starten.
Und genau hier liegt das Problem. Starten und beenden kann er das Hauptprogramm, aber es läuft fehlerhaft.
Der user ist wwwrun der die Prozesse startet. Wenn ich mich über Konsole als wwwrun einloge und den Befehl über konsole eingebe, der über den browser sonst ausgeführt wird, klappt alles einwandfrei.
Hier die folgenden Fehler:
Quotemkdir /.ssh: Permission denied
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
ping ende
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
datei ende
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
login ende
Use of uninitialized value in scalar chomp at /var/lib/wwwrun/monitor.pl line 69.
Use of uninitialized value in scalar chomp at /var/lib/wwwrun/monitor.pl line 70.
Use of uninitialized value in scalar chomp at /var/lib/wwwrun/monitor.pl line 71.
Use of uninitialized value in scalar chomp at /var/lib/wwwrun/monitor.pl line 72.
ping ende
mkdir /.ssh: Permission denied
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl.pm line 107.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
datei ende
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 41, <GEN0> line 1.
Use of uninitialized value in concatenation (.) or string at /usr/local/lib/perl5/site_perl/5.8.5/Net/SSH/Perl/SSH2.pm line 47, <GEN0> line 1.
mkdir /.ssh: Permission denied
login ende
Im ganzen Quelltext kommt aber kein mkdir vor.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$cmd= "ls -l";
#$cmd= "id";
$ssh = Net::SSH::Perl->new($server, protocol=>2);
$ssh->login( $user, $passwort );
try {
#print "Vor cmd\n";
($v_stdout, $v_stderr, $v_exit) = $ssh->cmd($cmd);
#print "Nach cmd\n";
if ($target eq 'quelle' ) {
$writedb = `./writedb2.pl 10 \"login_quelle\" 0 \"$intf_name\" \"login.pl\" \"$mail\"`;
$writedb = `./writedb2.pl 0 4 \"login.pl\" \"$server\"`; # Alles OK
} else {
$writedb = `./writedb2.pl 10 \"login_ziel\" 0 \"$intf_name\" \"login.pl\" \"$mail\"`;
$writedb = `./writedb2.pl 0 4 \"login.pl\" \"$server\"`;
}
} except {
$writedb = `./writedb2.pl 0 3 \"login.pl\" \"$server\"`; # Fehler schreiben
if ("$target" eq "quelle" ) {
$writedb = `./writedb2.pl 10 \"login_quelle\" 1 \"$intf_name\" \"login.pl\" \"$mail\"`;
} else {
$writedb = `./writedb2.pl 10 \"login_ziel\" 1 \"$intf_name\" \"login.pl\" \"$mail\"`;
}
}
finally {
$writedb = `./writedb2.pl 0 2 \"login.pl\" \"$intf_name\"`; # Ende schreiben
}
Hab mir dann mal die Module vorgenommen.
Quotemake test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/0-signature....gpg: Signature made Wed Oct 8 16:29:54 2003 CEST using DSA key ID 06D8C374
gpg: requesting key 06D8C374 from x-hkp://pgp.mit.edu:11371 ...
gpg: can't get key from keyserver: Connection refused
gpg: Can't check signature: public key not found
Not in MANIFEST: blibdirs
==> MISMATCHED content between MANIFEST and distribution files! <==
# Failed test (t/0-signature.t at line 18)
# Looks like you failed 1 tests of 1.
t/0-signature....dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
t/00prim.........ok
t/01tag..........ok
t/02seq..........FAILED tests 17-18
Failed 2/18 tests, 88.89% okay
t/03seqof........ok
t/04opt..........ok
t/05time.........ok
t/06bigint.......ok
t/07io...........ok
t/08set..........ok
t/09contr........ok
t/10choice.......ok
t/11indef........ok
t/12der..........ok
t/13utf8.........ok
t/14any..........ok
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/0-signature.t 1 256 1 1 100.00% 1
t/02seq.t 18 2 11.11% 17-18
Failed 2/16 test scripts, 87.50% okay. 3/420 subtests failed, 99.29% okay.
make: *** [test_dynamic] Error 29
Überinstallieren klappt leider nicht wie man gesehen hat. Der bricht vorher schon ab. Empfehlungen?