From e3a8510ae300907a9b8e73d318bf00ec24fa36bd Mon Sep 17 00:00:00 2001 From: delaco Date: Wed, 19 Jul 2006 14:59:29 +0000 Subject: [PATCH] Hinzugefuegt: * Interface fuer den Benutzer dial. Geandert: * Standardland fuer OpenSSL-Zertifikate ist statt GB jetzt DE. * makegraphs gefixt. git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@214 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8 --- config/httpd/httpd.conf | 310 ++++++++++++++++++------------------ config/ssl/openssl.cnf | 16 +- html/cgi-bin/dial/dial.cgi | 70 ++++++++ html/cgi-bin/dial/index.cgi | 244 ++++++++++++++++++++++++++++ html/html/dial.cgi | 4 + make.sh | 2 +- src/ROOTFILES.i386 | 3 +- src/scripts/makegraphs | 29 ++-- 8 files changed, 501 insertions(+), 177 deletions(-) create mode 100644 html/cgi-bin/dial/dial.cgi create mode 100644 html/cgi-bin/dial/index.cgi create mode 100644 html/html/dial.cgi diff --git a/config/httpd/httpd.conf b/config/httpd/httpd.conf index 5c2c6aea6f..9422040eb5 100644 --- a/config/httpd/httpd.conf +++ b/config/httpd/httpd.conf @@ -1,151 +1,159 @@ -## -## httpd.conf -- Apache HTTP server configuration file -## -ServerType standalone -ServerRoot /etc/httpd - -LockFile /var/lock/httpd.lock -PidFile /var/run/httpd.pid -ScoreBoardFile /var/run/httpd.scoreboard -Timeout 900 -KeepAlive On -MaxKeepAliveRequests 100 -KeepAliveTimeout 15 -MinSpareServers 1 -MaxSpareServers 2 -StartServers 2 -MaxClients 10 -MaxRequestsPerChild 100 -Port 81 -Listen 81 -Listen 444 -User nobody -Group nobody -ServerAdmin root@localhost -ServerTokens Prod -DocumentRoot /home/httpd/html -# Limit track/trace requests -RewriteEngine on -RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS) -RewriteRule .* - [F] - - - Options None - AllowOverride None - - - Options ExecCGI - AllowOverride None - Order allow,deny - Allow from all - - - AuthName "IPFire - Restricted" - AuthType Basic - AuthUserFile /var/ipfire/auth/users - Require user admin - -ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ - - AllowOverride None - Options None - AuthName "IPFire - Restricted" - AuthType Basic - AuthUserFile /var/ipfire/auth/users - Require user admin - - Satisfy Any - Allow from All - - - Satisfy Any - Allow from All - - - Satisfy Any - Allow from All - - - Require user admin dial - - - - DirectoryIndex index.html index.htm index.shtml index.cgi - -AccessFileName .htaccess - - Order allow,deny - Deny from all - - - TypesConfig /etc/mime.types - -DefaultType text/plain - -HostnameLookups Off -ErrorLog /var/log/httpd/error_log -LogLevel warn -LogFormat "%h %l %u %t \"%r\" %>s %b" common -CustomLog /var/log/httpd/access_log common -ServerSignature Off -AddHandler cgi-script .cgi - - BrowserMatch "Mozilla/2" nokeepalive - BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 - BrowserMatch "RealPlayer 4\.0" force-response-1.0 - BrowserMatch "Java/1\.0" force-response-1.0 - BrowserMatch "JDK/1\.0" force-response-1.0 - - -### -### SSL Configuration -### -AddType application/x-x509-ca-cert .crt -AddType application/x-pkcs7-crl .crl - -SSLPassPhraseDialog builtin -SSLSessionCache dbm:/var/log/httpd/ssl_scache -SSLSessionCacheTimeout 900 -SSLMutex file:/var/log/httpd/ssl_mutex -SSLRandomSeed startup builtin -SSLRandomSeed connect builtin -SSLLog /var/log/httpd/ssl_engine_log -SSLLogLevel info - - - RewriteEngine on - RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS) - RewriteRule .* - [F] - DocumentRoot /home/httpd/html - ServerAdmin root@localhost - ErrorLog /var/log/httpd/error_log - TransferLog /var/log/httpd/access_log - SSLEngine on - SSLProtocol all -SSLv2 - SSLCipherSuite ALL:!ADH:!EXPORT56:!eNULL:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW:+EXP - SSLCertificateFile /etc/httpd/server.crt - SSLCertificateKeyFile /etc/httpd/server.key - - SSLOptions +StdEnvVars - - - SSLOptions +StdEnvVars - - SetEnv HOME /home/nobody - SetEnvIf User-Agent ".*MSIE.*" \ - nokeepalive ssl-unclean-shutdown \ - downgrade-1.0 force-response-1.0 - CustomLog /var/log/httpd/ssl_request_log \ - "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" - - - - Options None - AllowOverride None - AuthName "IPFire - Restricted" - AuthType Basic - AuthUserFile /var/ipfire/auth/users - require user admin - - -include /etc/httpd/conf/hostname.conf +## +## httpd.conf -- Apache HTTP server configuration file +## +ServerType standalone +ServerRoot /etc/httpd + +LockFile /var/lock/httpd.lock +PidFile /var/run/httpd.pid +ScoreBoardFile /var/run/httpd.scoreboard +Timeout 900 +KeepAlive On +MaxKeepAliveRequests 100 +KeepAliveTimeout 15 +MinSpareServers 1 +MaxSpareServers 2 +StartServers 2 +MaxClients 10 +MaxRequestsPerChild 100 +Port 81 +Listen 81 +Listen 444 +User nobody +Group nobody +ServerAdmin root@localhost +ServerTokens Prod +DocumentRoot /home/httpd/html +# Limit track/trace requests +RewriteEngine on +RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS) +RewriteRule .* - [F] + + + Options None + AllowOverride None + + + Options ExecCGI + AllowOverride None + Order allow,deny + Allow from all + + + AuthName "IPFire - Restricted" + AuthType Basic + AuthUserFile /var/ipfire/auth/users + Require user admin + +ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/ + + AllowOverride None + Options None + AuthName "IPFire - Restricted" + AuthType Basic + AuthUserFile /var/ipfire/auth/users + Require user admin + + Satisfy Any + Allow from All + + + Satisfy Any + Allow from All + + + Satisfy Any + Allow from All + + + Require user admin + + + + AllowOverride None + Options None + AuthName "IPFire - Restricted" + AuthType Basic + AuthUserFile /var/ipfire/auth/users + Require user dial admin + + + DirectoryIndex index.html index.htm index.shtml index.cgi + +AccessFileName .htaccess + + Order allow,deny + Deny from all + + + TypesConfig /etc/mime.types + +DefaultType text/plain + +HostnameLookups Off +ErrorLog /var/log/httpd/error_log +LogLevel warn +LogFormat "%h %l %u %t \"%r\" %>s %b" common +CustomLog /var/log/httpd/access_log common +ServerSignature Off +AddHandler cgi-script .cgi + + BrowserMatch "Mozilla/2" nokeepalive + BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 + BrowserMatch "RealPlayer 4\.0" force-response-1.0 + BrowserMatch "Java/1\.0" force-response-1.0 + BrowserMatch "JDK/1\.0" force-response-1.0 + + +### +### SSL Configuration +### +AddType application/x-x509-ca-cert .crt +AddType application/x-pkcs7-crl .crl + +SSLPassPhraseDialog builtin +SSLSessionCache dbm:/var/log/httpd/ssl_scache +SSLSessionCacheTimeout 900 +SSLMutex file:/var/log/httpd/ssl_mutex +SSLRandomSeed startup builtin +SSLRandomSeed connect builtin +SSLLog /var/log/httpd/ssl_engine_log +SSLLogLevel info + + + RewriteEngine on + RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS) + RewriteRule .* - [F] + DocumentRoot /home/httpd/html + ServerAdmin root@localhost + ErrorLog /var/log/httpd/error_log + TransferLog /var/log/httpd/access_log + SSLEngine on + SSLProtocol all -SSLv2 + SSLCipherSuite ALL:!ADH:!EXPORT56:!eNULL:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW:+EXP + SSLCertificateFile /etc/httpd/server.crt + SSLCertificateKeyFile /etc/httpd/server.key + + SSLOptions +StdEnvVars + + + SSLOptions +StdEnvVars + + SetEnv HOME /home/nobody + SetEnvIf User-Agent ".*MSIE.*" \ + nokeepalive ssl-unclean-shutdown \ + downgrade-1.0 force-response-1.0 + CustomLog /var/log/httpd/ssl_request_log \ + "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" + + + + Options None + AllowOverride None + AuthName "IPFire - Restricted" + AuthType Basic + AuthUserFile /var/ipfire/auth/users + require user admin + + +include /etc/httpd/conf/hostname.conf diff --git a/config/ssl/openssl.cnf b/config/ssl/openssl.cnf index e1689e2615..f0906e5470 100644 --- a/config/ssl/openssl.cnf +++ b/config/ssl/openssl.cnf @@ -10,7 +10,7 @@ default_ca = IPFire [ IPFire ] dir = /var/ipfire certs = $dir/certs -crl_dir = $dir/crls +crl_dir = $dir/crls database = $dir/certs/index.txt new_certs_dir = $dir/certs certificate = $dir/ca/cacert.pem @@ -44,9 +44,9 @@ string_mask = nombstr [ req_distinguished_name ] countryName = Country Name (2 letter code) -countryName_default = GB -countryName_min = 2 -countryName_max = 2 +countryName_default = DE +countryName_min = 2 +countryName_max = 2 stateOrProvinceName = State or Province Name (full name) stateOrProvinceName_default = @@ -55,21 +55,21 @@ localityName = Locality Name (eg, city) #localityName_default = 0.organizationName = Organization Name (eg, company) -0.organizationName_default = My Company Ltd +0.organizationName_default = IPFire organizationalUnitName = Organizational Unit Name (eg, section) #organizationalUnitName_default = commonName = Common Name (eg, your name or your server\'s hostname) -commonName_max = 64 +commonName_max = 64 emailAddress = Email Address emailAddress_max = 40 [ req_attributes ] challengePassword = A challenge password -challengePassword_min = 4 -challengePassword_max = 20 +challengePassword_min = 4 +challengePassword_max = 20 unstructuredName = An optional company name [ usr_cert ] diff --git a/html/cgi-bin/dial/dial.cgi b/html/cgi-bin/dial/dial.cgi new file mode 100644 index 0000000000..77e4260230 --- /dev/null +++ b/html/cgi-bin/dial/dial.cgi @@ -0,0 +1,70 @@ +#!/usr/bin/perl +# +# SmoothWall CGIs +# +# This code is distributed under the terms of the GPL +# +# (c) The SmoothWall Team +# +# $Id: dial.cgi,v 1.4.2.3 2005/02/22 22:21:55 gespinasse Exp $ +# + +use strict; + +# enable only the following on debugging purpose +#use warnings; +#use CGI::Carp 'fatalsToBrowser'; + +require '/var/ipfire/general-functions.pl'; +require "${General::swroot}/lang.pl"; +require "${General::swroot}/header.pl"; + +my %cgiparams=(); + +$cgiparams{'ACTION'} = ''; +&Header::getcgihash(\%cgiparams); + +if ($cgiparams{'ACTION'} eq $Lang::tr{'dial profile'}) +{ + my $profile = $cgiparams{'PROFILE'}; + my %tempcgiparams = (); + $tempcgiparams{'PROFILE'} = ''; + &General::readhash("${General::swroot}/ppp/settings-$cgiparams{'PROFILE'}", + \%tempcgiparams); + + # make a link from the selected profile to the "default" one. + unlink("${General::swroot}/ppp/settings"); + link("${General::swroot}/ppp/settings-$cgiparams{'PROFILE'}", + "${General::swroot}/ppp/settings"); + system ("/bin/touch", "${General::swroot}/ppp/updatesettings"); + + # read in the new params "early" so we can write secrets. + %cgiparams = (); + &General::readhash("${General::swroot}/ppp/settings", \%cgiparams); + $cgiparams{'PROFILE'} = $profile; + $cgiparams{'BACKUPPROFILE'} = $profile; + &General::writehash("${General::swroot}/ppp/settings-$cgiparams{'PROFILE'}", + \%cgiparams); + + # write secrets file. + open(FILE, ">/${General::swroot}/ppp/secrets") or die "Unable to write secrets file."; + flock(FILE, 2); + my $username = $cgiparams{'USERNAME'}; + my $password = $cgiparams{'PASSWORD'}; + print FILE "'$username' * '$password'\n"; + chmod 0600, "${General::swroot}/ppp/secrets"; + close FILE; + + &General::log("$Lang::tr{'profile made current'} $tempcgiparams{'PROFILENAME'}"); + $cgiparams{'ACTION'} = "$Lang::tr{'dial'}"; +} + +if ($cgiparams{'ACTION'} eq $Lang::tr{'dial'}) { + system('/etc/rc.d/rc.red','start') == 0 + or &General::log("Dial failed: $?"); } +elsif ($cgiparams{'ACTION'} eq $Lang::tr{'hangup'}) { + system('/etc/rc.d/rc.red','stop') == 0 + or &General::log("Hangup failed: $?"); } +sleep 1; + +print "Status: 302 Moved\nLocation: /cgi-bin/dial/index.cgi\n\n"; diff --git a/html/cgi-bin/dial/index.cgi b/html/cgi-bin/dial/index.cgi new file mode 100644 index 0000000000..5ee1652761 --- /dev/null +++ b/html/cgi-bin/dial/index.cgi @@ -0,0 +1,244 @@ +#!/usr/bin/perl +# +# SmoothWall CGIs +# +# This code is distributed under the terms of the GPL +# +# (c) The SmoothWall Team +# + +use strict; + +# enable only the following on debugging purpose +#use warnings; +#use CGI::Carp 'fatalsToBrowser'; + +require '/var/ipfire/general-functions.pl'; +require "${General::swroot}/lang.pl"; +require "${General::swroot}/header.pl"; + +my %cgiparams=(); +my %pppsettings=(); +my %modemsettings=(); +my %netsettings=(); +my %ddnssettings=(); +my $warnmessage = ''; +my $refresh = ''; +my $ipaddr=''; + +&Header::showhttpheaders(); + +$cgiparams{'ACTION'} = ''; +&Header::getcgihash(\%cgiparams); +$pppsettings{'VALID'} = ''; +$pppsettings{'PROFILENAME'} = 'None'; +&General::readhash("${General::swroot}/ppp/settings", \%pppsettings); +&General::readhash("${General::swroot}/modem/settings", \%modemsettings); +&General::readhash("${General::swroot}/ethernet/settings", \%netsettings); +&General::readhash("${General::swroot}/ddns/settings", \%ddnssettings); +my $death = 0; +my $rebirth = 0; + +if ($cgiparams{'ACTION'} eq $Lang::tr{'shutdown'}) { + $death = 1; + &General::log($Lang::tr{'shutting down ipfire'}); + system '/usr/local/bin/ipfirereboot down'; +} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'reboot'}) { + $rebirth = 1; + &General::log($Lang::tr{'rebooting ipfire'}); + system '/usr/local/bin/ipfirereboot boot'; +} + +my $connstate = &Header::connectionstatus(); +if ($connstate =~ /$Lang::tr{'dod waiting'}/ || -e "${General::swroot}/main/refreshindex") { + $refresh = ""; +} elsif ($connstate =~ /$Lang::tr{'connecting'}/) { + $refresh = ""; +} + +my $c; +my $maxprofiles = 5; +my @profilenames = (); + +for ($c = 1; $c <= $maxprofiles; $c++) +{ + my %temppppsettings = (); + $temppppsettings{'PROFILENAME'} = ''; + &General::readhash("${General::swroot}/ppp/settings-$c", \%temppppsettings); + $profilenames[$c] = $temppppsettings{'PROFILENAME'}; +} +my %selected; +for ($c = 1; $c <= $maxprofiles; $c++) { + $selected{'PROFILE'}{$c} = ''; +} +$selected{'PROFILE'}{$pppsettings{'PROFILE'}} = "selected='selected'"; +my $dialButtonDisabled = "disabled='disabled'"; + + +&Header::openpagewithoutmenu($Lang::tr{'main page'}, 1, $refresh); +&Header::openbigbox('', 'center'); +&Header::openbox('100%', 'center', &Header::cleanhtml(`/bin/uname -n`,"y")); + +if ( ( $pppsettings{'VALID'} eq 'yes' && $modemsettings{'VALID'} eq 'yes' ) || ( $netsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ )) { + if (open(IPADDR,"${General::swroot}/ddns/ipcache")) { + $ipaddr = ; + close IPADDR; + chomp ($ipaddr); + } + if (open(IPADDR,"${General::swroot}/red/local-ipaddress")) { + my $ipaddr = ; + close IPADDR; + chomp ($ipaddr); + } +} elsif ($modemsettings{'VALID'} eq 'no') { + print "$Lang::tr{'modem settings have errors'}\n \n"; +} else { + print "$Lang::tr{'profile has errors'}\n \n"; +} + +if ( $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ ) { + $ipaddr = $netsettings{'RED_ADDRESS'}; +} + +print < + +
+ +
+ + + + +
$Lang::tr{'network'} + IP + $Lang::tr{'status'} +
$Lang::tr{'internet'}:
+
$ipaddr + $connstate +
+
$Lang::tr{'profile'}: + +
+
+ + +
+ +
+
+ +
+
+END + } else { + print "$Lang::tr{'profile has errors'}\n \n"; + } + + if ( $netsettings{'GREEN_DEV'} ) { print <
$Lang::tr{'lan'}: + $netsettings{'GREEN_ADDRESS'} + +END + if ( `cat /var/ipfire/proxy/advanced/settings | grep ^ENABLE=on` ) { + print "Proxy an"; + if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT=on` ) { print " (transparent)"; } + } else { print "Proxy aus"; } + } + if ( $netsettings{'BLUE_DEV'} ) { print <$Lang::tr{'wireless'}:
+
$netsettings{'BLUE_ADDRESS'} + +END + if ( `cat /var/ipfire/proxy/advanced/settings | grep ^ENABLE_BLUE=on` ) { + print "Proxy an"; + if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT_BLUE=on` ) { print " (transparent)"; } + } else { print "Proxy aus"; } + } + if ( $netsettings{'ORANGE_DEV'} ) { print <$Lang::tr{'dmz'}:
+
$netsettings{'ORANGE_ADDRESS'} + Online +END + } + if ( `cat /var/ipfire/vpn/settings | grep ^ENABLED=on` || + `cat /var/ipfire/vpn/settings | grep ^ENABLED_BLUE=on` ) { + my $ipsecip = `cat /var/ipfire/vpn/settings | grep ^VPN_IP= | cut -c 8-`; + print <$Lang::tr{'vpn'}:
+
$ipsecip + Online +END + } + if ( `cat /var/ipfire/ovpn/settings | grep ^ENABLED=on` || + `cat /var/ipfire/ovpn/settings | grep ^ENABLED_BLUE=on` || + `cat /var/ipfire/ovpn/settings | grep ^ENABLED_ORANGE=on`) { + my $ovpnip = `cat /var/ipfire/ovpn/settings | grep ^DOVPN_SUBNET= | cut -c 14- | sed -e 's\/\\/255.255.255.0\/\/'`; + print <OpenVPN:
+
$ovpnip + Online +END + } + if ( $netsettings{'DNS1'} ) { print <DNS-Server: $netsettings{'DNS1'} +END + } + if ( $netsettings{'DNS2'} ) { print <$netsettings{'DNS2'} +END + } +print < +END + +&Header::closebox(); + +&Header::openbox('100%', 'left', $Lang::tr{'shutdown2'}); + +if ($death == 0 && $rebirth == 0) { + print < + + + + + +
+ +END +; +} else { + my $message=''; + my $title=''; + if ($death) { + $title = $Lang::tr{'shutting down'}; + $message = $Lang::tr{'ipfire has now shutdown'}; + } else { + $title = $Lang::tr{'rebooting'}; + $message = $Lang::tr{'ipfire has now rebooted'}; + } + print <
$message
+END +; +} + +&Header::closebox(); + +&Header::closebigbox(); + +&Header::closepage(); diff --git a/html/html/dial.cgi b/html/html/dial.cgi new file mode 100644 index 0000000000..7c7b7db3ce --- /dev/null +++ b/html/html/dial.cgi @@ -0,0 +1,4 @@ +#!/usr/bin/perl + +print "Status: 302 Moved\n"; +print "Location: /cgi-bin/dial/index.cgi\n\n"; diff --git a/make.sh b/make.sh index 1073e0e321..66e821ff28 100644 --- a/make.sh +++ b/make.sh @@ -25,7 +25,7 @@ NAME="IPFire" # Software name SNAME="ipfire" # Short name - VERSION="1.4" # Version number + VERSION="2.0" # Version number SLOGAN="We secure your network" # Software slogan CONFIG_ROOT=/var/ipfire # Configuration rootdir NICE=10 diff --git a/src/ROOTFILES.i386 b/src/ROOTFILES.i386 index e5ccd172e4..813595968e 100644 --- a/src/ROOTFILES.i386 +++ b/src/ROOTFILES.i386 @@ -21025,6 +21025,7 @@ home/httpd/cgi-bin/country.cgi home/httpd/cgi-bin/credits.cgi home/httpd/cgi-bin/ddns.cgi home/httpd/cgi-bin/dhcp.cgi +home/httpd/cgi-bin/dial home/httpd/cgi-bin/dial.cgi home/httpd/cgi-bin/dmzholes.cgi home/httpd/cgi-bin/graphs.cgi @@ -27209,7 +27210,7 @@ usr/bin/wget usr/etc/wgetrc ## ## xmbmon205 -/usr/bin/mbmon +usr/bin/mbmon ## ## ## mc diff --git a/src/scripts/makegraphs b/src/scripts/makegraphs index bcac55346d..9c680a8996 100644 --- a/src/scripts/makegraphs +++ b/src/scripts/makegraphs @@ -34,8 +34,6 @@ my (%settings, @ipacsum, $iface, $ERROR); my %mbmon_settings = (); &General::readhash("${General::swroot}/mbmon/settings", \%mbmon_settings); - - # Added for conversion of utf-8 characters use Encode 'from_to'; my %tr=(); @@ -68,9 +66,8 @@ my @args = (); my $count = 0; my $ERROR; my $dbg = 0; -my $path_rrd = "/var/log/rrd"; -my $path_graphs = "/home/httpd/html/graphs"; my $path_smartctl = "/usr/sbin/smartctl"; +my $path_hddtemp = "/usr/sbin/hddtemp"; my %colors = (); $colors{"1"} = "#0000FF"; @@ -715,10 +712,10 @@ sub updatelqgraph { sub updatehdddata { - if ( ! -e "$path_rrd/hddtemp.rrd") + if ( ! -e "$rrdlog/hddtemp.rrd") { # database did not exist -> create - RRDs::create ("$path_rrd/hddtemp.rrd", "--step=300", + RRDs::create ("$rrdlog/hddtemp.rrd", "--step=300", "DS:temperature:GAUGE:600:0:100", "RRA:AVERAGE:0.5:1:576", "RRA:AVERAGE:0.5:6:672", @@ -781,7 +778,7 @@ sub updatehdddata # print "hdd $hdd_output \n"; # print "temp $temp \n"; - RRDs::update ("$path_rrd/hddtemp.rrd", "-t", "temperature", "N:$temp"); + RRDs::update ("$rrdlog/hddtemp.rrd", "-t", "temperature", "N:$temp"); $ERROR = RRDs::error; print "Error in RRD::update for hdd: $ERROR\n" if $ERROR; @@ -809,11 +806,11 @@ sub updatehddgraph { sub updatembmondata { - if ( ! -e "$path_rrd/mbmon.rrd" ) + if ( ! -e "$rrdlog/mbmon.rrd" ) { # database did not exist -> create - @args = ("$path_rrd/mbmon.rrd"); + @args = ("$rrdlog/mbmon.rrd"); push(@args, "--step=300"); foreach $key ( sort(keys %mbmon_values) ) @@ -848,7 +845,7 @@ sub updatembmondata print("update template = '$template'\n") if ( $dbg ); print("update value = '$value'\n") if ( $dbg ); - RRDs::update("$path_rrd/mbmon.rrd", "-t", $template, $value); + RRDs::update("$rrdlog/mbmon.rrd", "-t", $template, $value); $ERROR = RRDs::error; print("Error in RRD::update for mbmon: $ERROR\n") if $ERROR; } @@ -858,7 +855,7 @@ sub updatetempgraph my $type = "temp"; my $period = $_[0]; - @args = ("$path_graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z", + @args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z", "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale", "--color", "SHADEA#EAE9EE", "--color", "SHADEB#EAE9EE", @@ -875,7 +872,7 @@ sub updatetempgraph $mbmon_settings{'LABEL-'.$key} = $key; } - push(@args, "DEF:$key=$path_rrd/mbmon.rrd:$key:AVERAGE"); + push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE"); push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon temp in'} °C"); push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.1lf °C"); push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.1lf °C"); @@ -898,7 +895,7 @@ sub updatefangraph my $type = "fan"; my $period = $_[0]; - @args = ("$path_graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z", + @args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z", "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale", "--color", "SHADEA#EAE9EE", "--color", "SHADEB#EAE9EE", @@ -915,7 +912,7 @@ sub updatefangraph $mbmon_settings{'LABEL-'.$key} = $key; } - push(@args, "DEF:$key=$path_rrd/mbmon.rrd:$key:AVERAGE"); + push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE"); push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} $tr{'mbmon fan in'} rpm"); push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.0lf rpm"); push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.0lf rpm"); @@ -938,7 +935,7 @@ sub updatevoltgraph my $type = "volt"; my $period = $_[0]; - @args = ("$path_graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z", + @args = ("$graphs/mbmon-$type-$period.png", "--start", "-1$period", "-aPNG", "-i", "-z", "--alt-y-grid", "-w 600", "-h 100", "--alt-autoscale", "--color", "SHADEA#EAE9EE", "--color", "SHADEB#EAE9EE", @@ -956,7 +953,7 @@ sub updatevoltgraph $mbmon_settings{'LABEL-'.$key} = $key; } - push(@args, "DEF:$key=$path_rrd/mbmon.rrd:$key:AVERAGE"); + push(@args, "DEF:$key=$rrdlog/mbmon.rrd:$key:AVERAGE"); push(@args, "LINE2:$key$colors{$count}:$mbmon_settings{'LABEL-'.$key} V"); push(@args, "GPRINT:$key:MAX:$tr{'maximal'}\\:%5.2lf V"); push(@args, "GPRINT:$key:AVERAGE:$tr{'average'}\\:%5.2lf V"); -- 2.39.2