[smokeping-users] Can't find lib.pm in @INC

G.W. Haywood ged at jubileegroup.co.uk
Tue Nov 25 21:26:52 CET 2008


Hi Eric,

On Tue, 25 Nov 2008, Eric Chatham wrote:

> Sorry about that.  I didn't realize I was just replying to you only. :)

I thought not. :)  I think people will be able to follow the thread.

> > I don't follow this.  There must be more to a config file than that.
> > What is it called?  Where is it?
>
> I was referring to the ./etc/config file in the Smokeping package.

Please always give the full path to things.  That way I'll know you
know whereabouts it is in your filesystem. :)

> This is what I have setup for it.  [Just a note, but I have tried
> changing the cgiurl =
> htpp://hppav.proxima.local/cgi-bin/smokeping.cgi with no improvement
> if at all any].

Try to work a bit more like a detective when you're finding why things
don't do what you expect in a computer.  Look for some explanation -
it's almost always there with a Linux box as it will log all kinds of
things, you just have to know where to look.


> *** General ***
> [snip]

> cgiurl   = http://hppav.proxima.local/smokeping/smokeping.cgi

I use the form

cgiurl = http://hostname/cgi-bin/smokeping.cgi

and browse to that location for the Smokeping top-level page.  It
doesn't necessarily mean that waht you have there is wrong, but I'd
need to look at the directory tree and Apache config to know.  The
main thing is that Apache has to be able to (1) find and (2) execute
smokeping.cgi, which we'll come back to.

> smokemail = /opt/smokeping/etc/smokemail tmail = /opt/smokeping/etc/tmail # specify this to get syslog logging syslogfacility = local0 # each probe is now run in its own process # disable this to revert to the old behaviour # concurrentprobes = no

This should not all be on one line - cut'n'paste error?

> *** Alerts ***
> [snip]

We don't need to worry about this for the moment.

> *** Database ***
> [snip]

Fine.

> *** Presentation ***
> [snip]

We don't need to worry about this for the moment.

> *** Probes ***
> [snip]

We don't need to worry about this for the moment.

It surprises me is that you seem to have a rather old configuration -
more recent Smokepings have a very short 'config' file and it includes
several other files from a directory called 'config.d' (which is
usually in the same place as 'config').  I'm guessing that you
installed Smokeping by using a package manager, and not by grabbing
the tarball from the Smokeping site.  That's OK, but it can get a bit
confusing because packages tend to be a bit out of date, and very
often the packager shuffles things all around to suit his filesystem
layout preferences.  We'll muddle through somehow. :)

> > Now we need to see what's in the Apache error log for that request.

> At 14:00, with Mozilla, I tried accessing
> http://hppav.proxima.local/cgi-bin/smokeping.cgi and I received the
> Error 500 Internal Server Error (all in text not HTML).

The error codes (like error 500 'Internal server error') are crucial
to figuring outwhat's going on.  If you're going to use a Webserver
for very much at all (and if you're going to use Smokeping, you are)
then you should learn what at least some of them by heart.  The first
ones to start with are 200, 304, 403, 404 and 500.  You should also
learn the structure of the error codes, for example 2xx means things
are OK, 5xx means things are not good.  Google for "HTTP error codes"
and spend some quality time with them.

In this acse we see a 500 which tells us we need to look in the server
error log, because in there you'll find something similar to what you
would see if you were running the script at the command line, assuming
the script might be capable of running properly at the command line,
which it most likely isn't.

> When I tried to access
> http://hppav.proxima.local/cgi-bin/smokeping.cgi at 14:02 (with IE)
> at 14:02, I get page cannot be displayed.

Same error, but the browser chose a different way to describe it.

> Here are my access/error logs:
> [snip]
> [Tue Nov 25 14:00:38 2008] [error] [client 192.168.1.101] (13)Permission denied: exec of '/var/www/cgi-bin/smokeping.cgi' failed
> [Tue Nov 25 14:00:38 2008] [error] [client 192.168.1.101] Premature end of script headers: smokeping.cgi

That tells us something we need to know.  It says that the OS refused
permission for Apache to execute smokeping.cgi, which means that (1)
you didn't see what you were hoping for in the browser and (2) there's
that message in the error log. :)

> [Tue Nov 25 14:02:26 2008] [error] [client 192.168.1.110] (13)Permission denied: exec of '/var/www/cgi-bin/smokeping.cgi' failed
> [Tue Nov 25 14:02:26 2008] [error] [client 192.168.1.110] Premature end of script headers: smokeping.cgi

Exactly the same with IE.  No surprise there, it's an internal server
error (an error internal to the Apache Web server setup) it's nothing
to do with the browser and all browsers will have to tell you something
along the lines of "sorry, it says it can't do it".

> [root at hppav cgi-bin]# tail /var/log/httpd/smokeping-access.log
> [snip]
> 192.168.1.101 - - [25/Nov/2008:14:00:38 -0500] "GET /cgi-bin/smokeping.cgi HTTP/1.1" 500 626
> 192.168.1.110 - - [25/Nov/2008:14:02:26 -0500] "GET /cgi-bin/smokeping.cgi HTTP/1.1" 500 626

The same two requests, but you don't get much information about the
error in the access log - just the code.

> I don't understand this step (from http://oss.oetiker.ch/smokeping/doc/smokeping_install.en.html):
>
> "htdocs/cropper/*
> To make the interactive graph-zoomer work, you have to place the content of the cropper directory somewhere on your webserver and adapt the links in basepage.html (see below)."
>
> It says "see below" but nothing is listed.

I think it's an unfortunate consequence of using a utility called
'perldoc' to produce documentation.  We don't need to look at that now
but very briefly you can put the documentation for a Perl script inside
the script itself, and sort-of 'comment it out' so the Perl interpreter
will ignore it.  So you can type 'perl scriptname' and the thing runs,
but when you say 'perldoc scriptname' you get something like a manual.
But sometimes you need to be a bit clairvoyant, and look in the script
with a pager (like 'less') or an editor (in read-only mode!) because
the part to 'see below' might be the actual code and 'perldoc' might
not show it to you.  That was another guess, we can come back to it.


> "If you are using a version of Perl older than 5.8.1, you should consider..."
>
> The link is broken, and I don't know if I need this based upon what
> I've been corresponding with.

Don't worry about that, your Perl seems to be 5.8.8 which is fine.
(Did we ever find out where all that stuff about 5.005_03 came from?:)

> Well I wont get much into this. The important thing is, to have a
> webserver which allows you to run CGI scripts. If you are using
> Apache I strongly recommend using the suexec system...

Tobi says he won't get into it because there's plenty of documentation
about Apache and it's far too big a job for him to support people with
Apache-type problems (which is what you have here).  You need to become
familiar with running a Webserver.  It will take time.

> I added a Virtual Host to the httpd.conf, the user/group that it
> uses is "apache."  All the defaults were listed.  Do you want to see
> that file?  I'm not sure how to use suexec.  Maybe that's what I
> need to do to make this work.

You might just be right.  But let's see what happens when you give
permission for Apache to execute the .cgi script.

Please show the output of

ls -l /var/www/cgi-bin/smokeping.cgi

and tell me what users run the httpd processes on your system.
There will probably be more than one user and several processes
under normal circumstances.

> Thank you again for your enduring patience with me....:)

Hehe, many people have helped me in the past.  I'm just paying my dues.

Sorry, got to run now.

--

73,
Ged.



More information about the smokeping-users mailing list