Free Web Hosting | free host | Free Web Space | BlueHost Review

Sign up for a free web hosting account at 741.com

       
       

 

 

 

__________

Linux base tools (snmp base) 

(created by me)

__________

Windows base tools (snmp base)

(created by me)

__________

MRTG and rrdtool installation (over linux)

__________

 

MRTG and rrdtoold installation

(over windows)

__________

Nagios Network Monitoring

(best of the best tool to monitor 10000... thousands of nodes / services)

__________

Command tools

(Linux base)

__________

Command tools

(Windows base)

__________

Cables configurations

__________

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

rrizwanahmed@gmail.com 

 

this configuration is working fine on my live servers.

INSTALLING MRTG: - (Fedora Core2 / Redhat 8)

 

Download MRTG latest RPM 

 

Use MRTG's cfgmaker command to create a configuration file named mrtg.cfg (or any name you want, be sure its extension should be .cfg ) for the your machine (server) using a Read Only SNMP community string of myserver. Place all data files in the directory /var/www/mrtg. (or any directory where you have your web)

 

[root@mainserver tmp]# cfgmaker --output=/etc/mrtg/mrtg.cfg --global "workdir:/var/www/mrtg" -fref=ip \

--global 'options[_]: growright,bits' myserver@localhost

 


--base: Get Device Info on craz33guy@localhost:
--base: Vendor Id:
--base: Populating confcache
--snpo: confcache craz33guy@localhost: Descr lo --> 1
--snpo: confcache craz33guy@localhost: Descr wlan0 --> 2
...

...

...

--base: Walking ifAdminStatus
--base: Walking ifOperStatus
--base: Writing /etc/mrtg/mrtg.cfg
[root@mainserver tmp]#
 

Note: Using the -ifref=ip cfgmaker command option instructs MRTG to use the interface's IP address as the title for each graph. Unfortunately, this causes errors when Fedora Core 1 polls another Fedora Core 1 server; the errors prevent the graphs from being created correctly. You can avoid this problem by removing the option to get graph titles using the much less recognizable MAC address of the interface.

Troubleshooting Tip: As explained in the SNMP section, there are different versions of SNMP. If your query doesn't work, check to make sure you are using the required version and then check other SNMP configuration parameters on the target device. You can specify MRTG's SNMP query version with the --snmp-options cfgmaker option. Here is an example of cfgmaker using an SNMP version 2 query of a router with an IP address of 192.168.1.3. The --snmp-options option's five colons before the 2 are important.

 

[root@mainserver tmp]# cfgmaker --output=/etc/mrtg/192.168.1.3.cfg -ifref=ip --global "workdir: var/www/mrtg" \ --snmp-options=:::::2 craz33guy@192.168.1.3

 

 

2.      Edit /etc/mrtg/mrtg.cfg, and remove the sections related to interfaces you don't need to monitor. A certain candidate would be the virtual loopback interface Lo: (with the IP address of 127.0.0.1), which doesn't pass any network traffic at all.

 

3.      Run MRTG using /etc/mrtg/mrtg.cfg as your argument three times. You'll get an error the two times as MRTG tries to move old data files, and naturally, the first time it is run, MRTG has no data files to move.

 

[root@mainserver tmp]# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
Rateup WARNING: /usr/bin/rateup could not read the primary log file for localhost_192.168.1.100
Rateup WARNING: /usr/bin/rateup The backup log file for localhost_192.168.1.100 was invalid as well
Rateup WARNING: /usr/bin/rateup Can't remove localhost_192.168.1.100.old updating log file
Rateup WARNING: /usr/bin/rateup Can't rename localhost_192.168.1.100.log to localhost_192.168.1.100.old updating log file
[root@mainserver tmp]# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
Rateup WARNING: /usr/bin/rateup Can't remove localhost_192.168.1.100.old updating log file
[root@mainserver tmp]# env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
[root@mainserver tmp]#

 

 

4.      Use MRTG's indexmaker command to create a Web index page using your new mrtg.cfg file as a guide. The MRTG Web GUI expects to find the index file in the default MRTG Web directory of /var/www/mrtg/, so the format of the command would be.

 

[root@mainserver tmp]# indexmaker --output=/var/www/mrtg/index.html \

/etc/mrtg/mrtg.cfg

 

5.      MRTG is run every five minutes by default, and the file that governs this is /etc/cron.d/mrtg. For MRTG to work correctly, edit this file, replacing all occurrences of /usr/bin/mrtg with env LANG=C /usr/bin/mrtg. The explanation for changing the language character set for MRTG is given in the "Troubleshooting MRTG" section.

This isn't all, you need to view the graphs too. This will be covered later, but first I'll show you how to poll multiple devices.

 

How change MRTG Graph page background colors and Graph colors: -

 

                To change MRTG graph page color and its page background color, you just have to do these small steps.

 

To change MRTG main index.html page color.

$ pico /your/mrtg/index/page/location/index.html

(change “bgcolor” here from 000000 to any color you want)

 

To change MRTG graph color, your have to find MRTG_lib.pm file in your system.

To find MRTG_lib.pm file use this command.

 

$ locate MRTG_lib.pm

(here it shows the location of this file) (if your system didn’t show its location and come again on root prompt then you have to update your system file database, to do this use this command)

$ updatedb

(this command will take little or more time to manage your system database, after this again find MRTG_lib.pm file location)

now open MRTG_lib.pm file in your favorite text editor.

eg.

$ pico /usr/lib/mrtg2/MRTG_lib.pm

In this file you can change MRTG graph color and its page background color.

Find these lines and change color what ever you want.

 

    ("GREEN","#FF6600",

                    "BLUE","#447700",

                    "DARK GREEN","#005599",

                    "MAGENTA","#ff00ff",

                    "AMBER","#ef9f4f");

 

AND

    ("GREEN","#FF6600",

                    "BLUE","#447700",

                    "DARK GREEN","#005599",

                    "MAGENTA","#ff0044");

 

 


 

INSTALLATION OF RRD TOOL

 Download rrdtool tar file from http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.0.45.tar.gz

cd /usr/local/src

wget http://people.ee.ethz.ch/~oetiker/webtools/rrdtool/pub/rrdtool-1.0.45.tar.gz

tar zxvf rrdtool-1.0.45.tar.gz

cd rrdtool-1.0.45

sh configure

make

make install

make site-perl-install

 (its just a test directories some time these are usefull, So just create them)

mkdir /var/lib/rrd

mkdir /var/www/html/rrdtool
 

 
 
Changing CGFMAKER:-
 
Changing cfgmaker to get Target: names we set in our routers and Switches.
 
  rename your cfgmaker file, e.g. 
[root@myserver]# cp /usr/bin/cfgmaker /usr/bin/cfgmakertest
 
Now do a little change in your newly created "cfgmakertest" file.
 
Open your newly created "cfgmakertest" file with your favorite text editor.
 
find below mention this line .
my $default_setenv_directive = "SetEnv[$target_name]: MRTG_INT_IP=\"$if_ip\" MRTG_INT_DESCR=\"$if_snmp_descr\"";
 
Now do a little change in this line.
Just change word a red mark word with  $if_name, $if_snmp_alias     Now your line looks like this.
 
my $default_setenv_directive = "SetEnv[$target_name]: MRTG_INT_IP=\"$if_ip\" MRTG_INT_DESCR=\"$if_name,$if_snmp_alias\"";
 
Now create a cfg file of your Router or Switch for "routers2.cgi" and you will see a change in its Target List.
 
Hip Hip Hurrrrrryyy, Your TARGETS field have interface name and their description which you add in your Router/ Switch
configuration.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

@Copyright 2007 Rizwan, All Rights Reserved