use lib "/usr/local/nagios/perl/lib";
?
Same result - it works. But I don't sure, this loads opsview's DBI. How can I check it?
15.07.09, 17:31, "Ton Voon" <[email protected]>:
Add a "use '/usr/local/nagios/perl/lib';" at the beginning. This will pick up the DBI version that we distribute.On 15 Jul 2009, at 14:15, Spoofov Spoof wrote:I just has wrote an simple perl-script:
#!/usr/bin/perl -w
use DBI;
my $dbh = DBI->connect_cached("dbi:mysql:opsview", "opsview", "changeme", "")
or die "Couldn't connect to database: " . DBI->errstr;
my $sth = $dbh->prepare('SELECT * FROM roles WHERE id = 10')
or die "Couldn't prepare statement: " . $dbh->errstr;
$sth->execute()
or die "Couldn't execute statement: " . $sth->errstr;
@data = "" />
print $data[1], $data[2];
$sth->finish;
$dbh->disconnect;
Then stat it:
# ./mysqltest.pl
AdminAdministrator access
As you can see, it works. I don't have idea, why opsview's web-server script fails.
_______________________________________________
Opsview-users mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-usersTon Voon
Product Architect
Opsera Limited | Unit 69 Suttons Business Park
Reading | Berkshire | RG6 1AZ | UK
Phone: +44 (0) 845 057 7887
Mobile: +44 (0) 7931 365796
Skype: tonvoon Email: [email protected]
www.opsera.comThis e-mail is confidential, intended only for the named recipient(s) above and may contain information that is privileged and confidential. If you receive this message in error, or are not the named recipient(s), please notify the sender at the phone number above, do not copy this message, do not disclose its contents to anyone, and delete this e-mail message from your computer. Although Opsera routinely screens for viruses, addressees should scan this e-mail and any attachments for viruses. Opsera makes no representation or warranty as to the absence of viruses in this e-mail or any attachments. Opsera Limited is registered in the UK under Company Number 5396532. Our registered office is Gorse View, Horsell Rise, Woking, Surrey, GU21 4RB.
_______________________________________________ Opsview-users mailing list [email protected] http://lists.opsview.org/lists/listinfo/opsview-users
