Cyberdevil
Verified User
- Joined
- Sep 16, 2007
- Messages
- 40
Working on CentOS 5
Thanks!
Thanks!
!/usr/bin/perl
$hostname = "domain";
$uptime = `uptime`;
$uptime =~ /up (.*?),/;
$uptime = $1;
$start =`/usr/sbin/rndc stats`;
$log ="/var/named/named.stats";
@stat = `tail -n 15 $log`;
$last_success = $stat[0];
$last_success =~ tr/^[0-9]\ file://cd;
$last_failure = $stat[5];
$last_failure =~ tr/^[0-9]\ file://cd;
$latest_success = $stat[8];
$latest_success =~ tr/^[0-9]\ file://cd;
$latest_failure = $stat[13];
$latest_failure =~ tr/^[0-9]\ file://cd;
$success = $latest_success - $last_success;
unless ($success eq "0"){ $success ++; }
$failure = $latest_failure - $last_failure;
unless ($failure eq "0"){ $failure ++; }
print "$success\n$failure\n$uptime\n$hostname\n";
exit;
arget[ns1]: `/var/www/html/mrtg/core/stats.pl`
MaxBytes[ns1]: 32000
AbsMax[ns1]: 64000
Options[ns1]: gauge, nopercent, integer, nobanner
Title[ns1]: Named statistics on ns1.
PageTop[ns1]: <h3>DNS Statistics</h3>
YLegend[ns1]: # Q's/5 min
ShortLegend[ns1]: q/5 min
Colours[ns1]: YELLOW#F9C000,RED#F90000,DARK GREEN#006600,VIOLET#FF00FF
Legend1[ns1]: Queries Received
Legend2[ns1]: Failed Queries
LegendI[ns1]: queries:
LegendO[ns1]: failures:
Target[spam]: `perl /var/www/html/mrtg/core/spam.pl -t </var/log/maillog`
Title[spam]: Spam Statistics
PageTop[spam]: <H3>Spam Statistics</h3>
Options[_]: growright,noinfo,nopercent,pngdate,perminute,derive
LegendI[spam]: Total Mail:
LegendO[spam]: Total Spam:
Ylegend[spam]: Mail
ShortLegend[spam]: E-mails
Legend1[spam]: All e-mail received
Legend2[spam]: All e-mails that were tagged as spam
Hi loopforever , I think you must change the MRTG source path in the script toHi Guys,
With the addition of a new server I found myself in the position of installing MRTG again. Chris (ProWebUK) wrote up a nice guide for installing MRTG manually - but I found the config to be lacking in some of the features I needed to monitor.
So, I grabbed the mrtg.cfg from an old CPanel rpm and modified it slightly to work on a DA machine. The script I wrote will automatically download and install the latest version of MRTG and apply a very nice config for your viewing pleasure. Please note...I take ABSOLUTELY no credit for the mrtg.cfg included - I simply made a small modification and wrote an installer for the whole process.
The installer will check to see if you have anything installed in /var/www/html/mrtg - if you have mrtg installed in another directory, you should remove it first. If you are already running MRTG, you need to make sure you delete it and its crontab entry before continuing with the installer.
Guide:
Code:wget [url]http://serveio.com/da/install.mrtg.sh[/url] chmod +x install.mrtg.sh ./install.mrtg.sh
When the process is done MRTG will be installed in:
/var/www/html/mrtg
and can be viewed at:
http://your.hostname.com/mrtg
You can see the output of my install at:
http://loop.serveio.com/mrtg
Enjoy!
Confirmed Supported OSs:
RedHat 9
Fedora Core 3
Fedora Core 2
Debian 3.0
CentOS 3.4
CentOS 4.0
If this installer works properly for you, please let me know what OS you used so I can update this list!
Uninstall Instructions
For those of you that want to uninstall MRTG (assuming you used this installer), please follow these steps:
- Open /etc/crontab and remove the line that reads:
*/5 * * * * root /usr/local/mrtg-2/bin/mrtg /var/www/html/mrtg/core/mrtg.cfg- rm -rf /usr/local/mrtg-2/
- rm -rf /var/www/html/mrtg/
Update complete!
Adding MRTG to /etc/crontab...
Executing MRTG for the first time (you may see some warnings)...
./install.mrtg.sh: line 64: /usr/local/mrtg-2/bin/mrtg: No such file or directory
If you see warnings above, it is generally safe to ignore.
Cleaning up installation...
Installation of MRTG complete!
Index of /mrtg
[ICO] Name Last modified Size Description
[DIR] Parent Directory
tail -f /var/log/httpd/error_log
[Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.html denied
[Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.htm denied
[Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.shtml denied
[Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.php denied
[Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.php5 denied
[Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.php4 denied
[Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.php3 denied
[Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.phtml denied
ls -all
drwx------ 2 root root 4096 Jan 25 21:38 core
Hello,
I have some trobles with MRTG,
I try to install mrtg but dosent work.
wget http://serveio.com/da/install.mrtg.sh
chmode +x install.mrtg.sh
./install.mrtg.sh
21:38:25 (37.00 MB/s) - `mrtgcfg.tar.gz' saved [2056/2056]
HTML:Update complete! Adding MRTG to /etc/crontab... Executing MRTG for the first time (you may see some warnings)... ./install.mrtg.sh: line 64: /usr/local/mrtg-2/bin/mrtg: No such file or directory If you see warnings above, it is generally safe to ignore. Cleaning up installation... Installation of MRTG complete!
But i try to access the mrtg : http://my-server-ip/mrtg and it is empty :
HTML:Index of /mrtg [ICO] Name Last modified Size Description [DIR] Parent Directory
I try to see the error on apache,HTML:tail -f /var/log/httpd/error_log [Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.html denied [Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.htm denied [Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.shtml denied [Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.php denied [Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.php5 denied [Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.php4 denied [Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.php3 denied [Fri Jan 25 21:43:16 2008] [error] [client 86.125.81.199] (13)Permission denied: access to /mrtg/core/index.phtml denied
in /var/www/html/mrtg the /core folder are mod 700
HTML:ls -all drwx------ 2 root root 4096 Jan 25 21:38 core
Have any sugestion?
Eduard.
Hello,
Thanx for sugestion, i try and the problem is the same.
Any sugestion?
Eduard.
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for perl... /usr/bin/perl
checking for groff... /usr/bin/groff
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for inttypes.h... (cached) yes
checking for unsigned long long... yes
checking for long long... yes
checking for strtoll... yes
checking for printf long long format specifier... %lld
checking for pow in -lm... yes
checking for gdImageGif in -lgd... no
checking for gdImagePng in -lgd... no
checking for gdImagePng_jpg in -lgd... no
checking for gdImagePng_jpg_ft in -lgd... no
checking for gdImageGd in -lgd... no
checking gd.h usability... no
checking gd.h presence... no
checking for gd.h... no
** Ooops, one of many bad things happened:
a) You don't have the GD library installed.
Get it from http://www.boutell.com, compile it and
use either --with-gd-lib=DIR and --with-gd-inc=DIR to specify
its location. You might also have to use --with-z-inc,
--with-z-lib and --with-png-inc, --with-png-lib for gd
versions 1.6 and higher. Check config.log for more
information on the problem.
b) You have the GD library installed, but not the gd.h
header file. Download the source (see above) and use
--with-gd-inc=DIR to specify where the file can be found.
c) You have the library and the header file installed, but
you also have a shared GD library in the same directory.
Remove the shared library files and/or links (e.g.
libgd.so.2.0.0, libgd.so and libgd.so.2). This is especially
likely if you're using a recent (post 1.8.4) version of GD
and didn't configure it with --disable-shared.
d) You have gd library installed and also it's headers, but you are
missing libpng (and headers) or freetype (and headers)
(mrtg does not use freetype, but if your copy of gd is precompiled
against it, you have to install it ...
Consider following the instructions in doc/mrtg-unix-guide.txt
make: *** No targets specified and no makefile found. Stop.
make: *** No rule to make target `install'. Stop.
MRTG has been installed...
Updating MRTG config and template...
--10:37:13-- http://tools.supernamechange.com/mrtgcfg.tar.gz
=> `mrtgcfg.tar.gz'
Resolving tools.supernamechange.com... 72.55.156.182
Connecting to tools.supernamechange.com|72.55.156.182|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2,056 (2.0K) [application/x-gzip]
100%[=====================================================================================================================================>] 2,056 --.--K/s
10:37:13 (15.59 KB/s) - `mrtgcfg.tar.gz' saved [2056/2056]
Adding MRTG to /etc/crontab...
env: /usr/local/mrtg-2/bin/mrtg: No such file or directory
env: /usr/local/mrtg-2/bin/mrtg: No such file or directory
env: /usr/local/mrtg-2/bin/mrtg: No such file or directory
env: /usr/local/mrtg-2/bin/mrtg: No such file or directory
Cleaning up installation...
MRTG install done