[Nut-upsuser] My previous post (lengthy, lots of tarace output)

Gene Heskett gene.heskett at gmail.com
Sat Jan 2 18:26:01 UTC 2010


On Saturday 02 January 2010, Charles Lepple wrote:
>On Fri, Jan 1, 2010 at 10:28 PM, Gene Heskett <gene.heskett at gmail.com> 
wrote:
>> Now, how do I get it to display the status, in a terminal screen, gui
>> from a menu, or in firefox, the statistics it is outputting?  I ask
>> because on the nut web pages, both links under this section of the docs:
>> -------------------------
>> Web-based monitoring
>>
>>    * Comes stock with CGI-based web interface tools for UPS monitoring
>> and management, including graphical status displays.
>>
>>    * Custom status web pages may be generated with the CGI programs,
>> since they use templates to create the pages. This allows you to have
>> status pages which fit the look and feel of the rest of your site.
>> ----------------------
>> Are 404's.
>
>Which links are you referring to?
>
>I'm looking here, and I don't see any links:
>
>http://new.networkupstools.org/user-manual.html#_web_based_monitoring

I bookmarked that page, but the bookmark didn't save the sublink, so I cannot 
find it again.  I am amazed at the amount of nut docs out there, often for 
much older and no longer applicable versions.  All I can do is open the .conf 
file, set an option, & see if it survives a restart of either nut, or httpd 
as the case may be. 75% or more of the time it errors and dies cuz that 
option, there and commented out in the scripts,  is no longer supported by 
one or the other.

>> If I feed upsstats.cgi (or either of the other 2 .cgi scripts) all
>> firefox wants to do is download them rather than displaying them.  Then
>> if I feed the file upsstats.html to FF, it displays the file with color
>> backgrounds on a per column basis, but no data.
>
>As Jesper mentioned, the CGI scripts are designed to be executed by
>the web server.

And this install, for some reason, does not have a 'cgi.conf' file in 
/etc/httpd/*

It does have a scgi.conf and a speedycgi.conf, both of which I have enabled, 
and got a bunch of errors for the options in them so those options had to be 
commented back out else httpd dies.

>This page has a bunch of default locations for components of Apache,
>which was the default web server in Fedora the last time I checked:
>
>http://wiki.apache.org/httpd/DistrosDefaultLayout#Fedora_Core.2C_CentOS.2C_
>RHEL:

Very very old, not generally applicable as its for nut-1.4.1.

>Assuming this is correct, you would want to put upsstats.cgi in
>/var/www/cgi-bin (with the execute bits turned on), and search for
>that path in /etc/httpd to see if it was just commented out of the
>configuration file.

I am in the middle of that right now, and I believe I have done everything 
that link recommends except those which cause errors when httpd is restarted, 
set the exec (chmod +x) bits on everything.  But firefox either can't find 
it, or wants to download an "amiga compressed archive" when I open 
upsstats.cgi.

Humm, re searching the path, where pwd=/etc/httpd:

[root at coyote httpd]# grep -R cgi-bin *
conf/httpd.conf:ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
conf/httpd.conf:# "/var/www/cgi-bin" should be changed to whatever your 
ScriptAliased
conf/httpd.conf:<Directory "/var/www/cgi-bin">
conf/httpd.conf:#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
conf.d/squid.conf:ScriptAlias /Squid/cgi-bin/cachemgr.cgi 
/usr/lib/squid/cachemgr.cgi
conf.d/squid.conf:<Location /Squid/cgi-bin/cachemgr.cgi>
conf.d/awstats.conf:ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-
bin/"
conf.d/ssl.conf:<Directory "/var/www/cgi-bin">
logs/access_log:127.0.0.1 - - [02/Jan/2010:12:30:53 -0500] "GET /gene/cgi-bin 
HTTP/1.1" 404 285 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.6) 
Gecko/20091201 Firefox/3.5.6"
logs/error_log:[Sat Jan 02 12:30:53 2010] [error] [client 127.0.0.1] File 
does not exist: /var/www/html/gene/cgi-bin

That last error I made by trying to access it from the FF url box, so its to 
be ignored.  I also was not aware that the -R opt to grep made it follow 
simlinks, interesting as that also hangs and must be ctl+c'd to get my prompt 
back..

Now, if I change my grep search to 'speedy', I get this:
[root at coyote httpd]# grep -R speedy *
conf.d/speedycgi.conf:LoadModule speedycgi_module modules/mod_speedycgi.so
conf.d/speedycgi.conf:# This will allow execution of mod_speedycgi to make 
your webbased
conf.d/speedycgi.conf:Alias /speedy /var/www/speedy
conf.d/speedycgi.conf:<Directory /var/www/speedy>
conf.d/speedycgi.conf:    SetHandler speedycgi-script
conf.d/speedycgi.conf:    # If non-zero, limits the number of speedy backends 
running for

Anyway, the contents of the designated cgi-bin directory are:
[root at coyote cgi-bin]# ls -l
total 104
-rwxr-xr-x 1 root nut 25620 2009-12-30 21:51 upsimage.cgi
-rwxr-xr-x 1 root nut 30082 2009-12-30 21:51 upsset.cgi
-rwxr-xr-x 1 root nut 30455 2009-12-30 21:51 upsstats.cgi
-rwxr-xr-x 1 root nut  3883 2010-01-02 04:43 upsstats.html
-rwxr-xr-x 1 root nut  5592 2009-06-02 11:54 upsstats-single.html

And the contents of that designated /var/www/speedy:
[root at coyote speedy]# ls -l
total 104
-rwxr-xr-x 1 root nut 25620 2009-12-30 21:51 upsimage.cgi
-rwxr-xr-x 1 root nut 30082 2009-12-30 21:51 upsset.cgi
-rwxr-xr-x 1 root nut 30455 2009-12-30 21:51 upsstats.cgi
-rwxr-xr-x 1 root nut  3883 2010-01-02 04:43 upsstats.html
-rwxr-xr-x 1 root nut  5592 2009-06-02 11:54 upsstats-single.html


However, and this is odd since the mod_speedy was installed from an rpm, but 
this locate command cannot find a 'speedycgi-script' on this system.
So was mod_scgi for that matter. 

Locating mod_cgi:

[root at coyote httpd]# locate mod_cgi
/usr/lib/httpd/modules/mod_cgi.so
/usr/lib/httpd/modules/mod_cgid.so
/usr/lib64/httpd/modules/mod_cgi.so
/usr/lib64/httpd/modules/mod_cgid.so
/usr/libexec/webmin/apache/mod_cgi.pl
/var/www/manual/mod/mod_cgi.html
/var/www/manual/mod/mod_cgid.html

And
[root at coyote httpd]# grep -R mod_cgi *
conf/httpd.conf:LoadModule cgi_module modules/mod_cgi.so

And that _looks_ like it should find it on one of those two directories. And 
my excedrin headache count is at least 5 digits...

Thanks Charles.

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)

Fanty: "You know that girl?"

Mal: "I really don't..."
				--"Serenity"



More information about the Nut-upsuser mailing list