Conky Config

    use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create owoverriden window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type undecorated
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 180 0
#maximum_width 200

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color B7EA81
#default_shade_color black
#default_outline_color white
own_window_colour white

# Text alignment, other possible values are commented
alignment top_left
#alignment top_left
#alignment bottom_left
#alignment bottom_left

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 30

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none
draw_graph_borders yes

TEXT
${offset 33}${font INFECTED:size=20}buDHAb0x
${voffset -10}${offset 14}${font Defused::bold:size=10}${kernel}
${voffset 5}${font Defused:size=8}Uptime: ${alignr}${uptime}

CPU0: ${offset 6}${cpu cpu0}% ${offset -6}${alignr}${cpubar cpu1 8,60}
${voffset 3}CPU1: ${offset 9}${cpu cpu1}% ${offset -9}${alignr}${cpubar cpu2 8,60}
${voffset 3}RAM: ${offset 12}$memperc% ${offset -12}${alignr}${membar 8,60}
${voffset 3}SWAP: ${offset 2}$swapperc% ${offset -2}${alignr}${swapbar 8,60}
${offset 66}${font INFECTED:size=20}SDA${font}
${voffset 5}${font Defused:size=8}Root:
${voffset 3}${fs_free /}/${fs_size /}
${voffset 3}${fs_bar 10,180 /}
${voffset 8}Home:
${voffset 3}${fs_free /home}/${fs_size /home}
${voffset 3}${fs_bar 10,180 /home}

${voffset 50}
${offset 43}${font INFECTED:size=20}TOP CPU${font}
${voffset 10}${font JUICE Bold:size=8}${top name 1}${alignr}${top cpu 1}
${top name 2}${alignr}${top cpu 2}
${top name 3}${alignr}${top cpu 3}
${top name 4}${alignr}${top cpu 4}
${top name 5}${alignr}${top cpu 5}
${top name 6}${alignr}${top cpu 6}
${top name 7}${alignr}${top cpu 7}
${top name 8}${alignr}${top cpu 8}
${offset 43}${font INFECTED:size=20}TOP MEM${font}
${voffset 10}${font JUICE Bold:size=8}${top_mem name 1}${alignr}${top_mem mem 1}
${top_mem name 2}${alignr}${top_mem mem 2}
${top_mem name 3}${alignr}${top_mem mem 3}
${top_mem name 4}${alignr}${top_mem mem 4}
${top_mem name 5}${alignr}${top_mem mem 5}
${top_mem name 6}${alignr}${top_mem mem 6}
${top_mem name 7}${alignr}${top_mem mem 7}
${top_mem name 8}${alignr}${top_mem mem 8}
${voffset 30}${offset 37}${font INFECTED:size=20}NETWORK
${voffset -10}${font Defused:size=8}Down:
${downspeedgraph eth0 30,70 B7EA81 B7EA81}${voffset -15}${alignr}${downspeed eth0}

${font Defused:size=8}Up:  
${upspeedgraph eth0 30,70 B7EA81 B7EA81}${voffset -15}${alignr}${upspeed eth0}

${voffset 3}Local Ip: ${alignr}${addr eth0}
${if_running audacious2}${voffset 2}${offset 33}${font INFECTED:size=20}Audacious
${voffset -10}${font JUICE Bold:size=8}${exec audtool2 –current-song | cut -b-32}
${voffset 3}${alignr}${exec audtool2 –current-song-output-length} / ${exec audtool2 –current-song-length}
${endif}
${font JUICE Bold:size=8}${if_mpd_playing}
$mpd_elapsed/$mpd_length
$mpd_artist
$mpd_album
${mpd_title 14}
$mpd_status ${mpd_bar 4,122}
${endif}

Conky Config

    use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048

# Update interval in seconds
update_interval 1

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create owoverriden window instead of using desktop (required in nautilus)
own_window yes
own_window_transparent yes
own_window_type undecorated
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 180 0
#maximum_width 200

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline yes

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 5

# border width
border_width 1

# Default colors and also border colors
default_color B7EA81
#default_shade_color black
#default_outline_color white
own_window_colour white

# Text alignment, other possible values are commented
alignment top_left
#alignment top_left
#alignment bottom_left
#alignment bottom_left

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 30

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer none
draw_graph_borders yes

TEXT
${offset 33}${font INFECTED:size=20}buDHAb0x
${voffset -10}${offset 14}${font Defused::bold:size=10}${kernel}
${voffset 5}${font Defused:size=8}Uptime: ${alignr}${uptime}

CPU0: ${offset 6}${cpu cpu0}% ${offset -6}${alignr}${cpubar cpu1 8,60}
${voffset 3}CPU1: ${offset 9}${cpu cpu1}% ${offset -9}${alignr}${cpubar cpu2 8,60}
${voffset 3}RAM: ${offset 12}$memperc% ${offset -12}${alignr}${membar 8,60}
${voffset 3}SWAP: ${offset 2}$swapperc% ${offset -2}${alignr}${swapbar 8,60}
${offset 66}${font INFECTED:size=20}SDA${font}
${voffset 5}${font Defused:size=8}Root:
${voffset 3}${fs_free /}/${fs_size /}
${voffset 3}${fs_bar 10,180 /}
${voffset 8}Home:
${voffset 3}${fs_free /home}/${fs_size /home}
${voffset 3}${fs_bar 10,180 /home}

${voffset 50}
${offset 43}${font INFECTED:size=20}TOP CPU${font}
${voffset 10}${font JUICE Bold:size=8}${top name 1}${alignr}${top cpu 1}
${top name 2}${alignr}${top cpu 2}
${top name 3}${alignr}${top cpu 3}
${top name 4}${alignr}${top cpu 4}
${top name 5}${alignr}${top cpu 5}
${top name 6}${alignr}${top cpu 6}
${top name 7}${alignr}${top cpu 7}
${top name 8}${alignr}${top cpu 8}
${offset 43}${font INFECTED:size=20}TOP MEM${font}
${voffset 10}${font JUICE Bold:size=8}${top_mem name 1}${alignr}${top_mem mem 1}
${top_mem name 2}${alignr}${top_mem mem 2}
${top_mem name 3}${alignr}${top_mem mem 3}
${top_mem name 4}${alignr}${top_mem mem 4}
${top_mem name 5}${alignr}${top_mem mem 5}
${top_mem name 6}${alignr}${top_mem mem 6}
${top_mem name 7}${alignr}${top_mem mem 7}
${top_mem name 8}${alignr}${top_mem mem 8}
${voffset 30}${offset 37}${font INFECTED:size=20}NETWORK
${voffset -10}${font Defused:size=8}Down:
${downspeedgraph eth0 30,70 B7EA81 B7EA81}${voffset -15}${alignr}${downspeed eth0}

${font Defused:size=8}Up:  
${upspeedgraph eth0 30,70 B7EA81 B7EA81}${voffset -15}${alignr}${upspeed eth0}

${voffset 3}Local Ip: ${alignr}${addr eth0}
${if_running audacious2}${voffset 2}${offset 33}${font INFECTED:size=20}Audacious
${voffset -10}${font JUICE Bold:size=8}${exec audtool2 –current-song | cut -b-32}
${voffset 3}${alignr}${exec audtool2 –current-song-output-length} / ${exec audtool2 –current-song-length}
${endif}
${font JUICE Bold:size=8}${if_mpd_playing}
$mpd_elapsed/$mpd_length
$mpd_artist
$mpd_album
${mpd_title 14}
$mpd_status ${mpd_bar 4,122}
${endif}

*Slackware* Adding Users to Sudoers

Users can execute commands that are usually restricted to the root account using sudo program. The sudo configuration file is /etc/sudoers.

Open /etc/sudoers file with your favorite text editor as root, then remove comment character, #, in front of line “%wheel ALL=(ALL) ALL” and save.

# visudo

or

# nano /etc/sudoers


# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL

Change above line as in below and save file.

# Uncomment to allow people in group wheel to run all commands %wheel ALL=(ALL) ALL

You need to add your user name to group wheel also.

# gpasswd -a user wheel

(Replace user with your user name)

Now you can execute some privileged commands using sudo as user without becoming root with su. For example it is possible to edit system file initUsers can execute commands that are usually restricted to the root account using sudo program. The sudo configuration file is /etc/sudoers.

Open /etc/sudoers file with your favorite text editor as root, then remove comment character, #, in front of line “%wheel ALL=(ALL) ALL” and save.

# visudo

or

# nano /etc/sudoers


# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL

Change above line as in below and save file.

# Uncomment to allow people in group wheel to run all commands %wheel ALL=(ALL) ALL

You need to add your user name to group wheel also.

# gpasswd -a user wheel

(Replace user with your user name)

Now you can execute some privileged commands using sudo as user without becoming root with su. For example it is possible to edit system file inittab as user executing below command.

# sudo nano /etc/inittab

*Slackware* Adding Users to Sudoers

Users can execute commands that are usually restricted to the root account using sudo program. The sudo configuration file is /etc/sudoers.

Open /etc/sudoers file with your favorite text editor as root, then remove comment character, #, in front of line “%wheel ALL=(ALL) ALL” and save.

# visudo

or

# nano /etc/sudoers


# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL

Change above line as in below and save file.

# Uncomment to allow people in group wheel to run all commands %wheel ALL=(ALL) ALL

You need to add your user name to group wheel also.

# gpasswd -a user wheel

(Replace user with your user name)

Now you can execute some privileged commands using sudo as user without becoming root with su. For example it is possible to edit system file initUsers can execute commands that are usually restricted to the root account using sudo program. The sudo configuration file is /etc/sudoers.

Open /etc/sudoers file with your favorite text editor as root, then remove comment character, #, in front of line “%wheel ALL=(ALL) ALL” and save.

# visudo

or

# nano /etc/sudoers


# Uncomment to allow people in group wheel to run all commands
# %wheel ALL=(ALL) ALL

Change above line as in below and save file.

# Uncomment to allow people in group wheel to run all commands %wheel ALL=(ALL) ALL

You need to add your user name to group wheel also.

# gpasswd -a user wheel

(Replace user with your user name)

Now you can execute some privileged commands using sudo as user without becoming root with su. For example it is possible to edit system file inittab as user executing below command.

# sudo nano /etc/inittab

Monitor traffic on Cisco router using Linux (Netflow)

By default Cisco IOS doesn’t provide any traffic monitoring tools like iftop or iptraff available in Linux. While there are lots of proprietary solutions for this purpose including Cisco Netflow Collection, you are free to choose nfdump and nfsen open source software to monitor traffic of one or many Cisco routers and get detailed monitoring data through your Linux command line or as graphs at absolutely no cost.
Below is beginner’s guide that helps to quickly deploy netflow collector and visualizer under Linux and impress everybody by cute and descriptive graphs like these:

Cisco Router Setup

1. Enable flow export on ALL Cisco router’s interfaces that send and receive some traffic, here is an example:

Router1# configure terminal
Router1(config)#interface FastEthernet 0/0
Router1(config-if)#ip route-cache flow input
Router1(config-if)#interface FastEthernet 0/1
Router1(config-if)#ip route-cache flow input

2. Setup netflow export:

Router1# configure terminal
Router1(config)#ip flow-export source FastEthernet0/0
Router1(config)#ip flow-export source FastEthernet0/1
Router1(config)#ip flow-export version 5
Router1(config)#ip flow-export destination 1.1.1.1 23456

Where 1.1.1.1 is IP address of Linux host where you plan to collect and analyze netflow data. 23456 is port number of netflow collector running on Linux.

Linux Setup

1. Download and install nfdump.

cd /usr/src/
wget http://sourceforge.net/projects/nfdump/files/stable/nfdump-1.6.2/nfdump-1.6.2.tar.gz/download
tar -xvzf nfdump-1.6.2.tar.gz
cd nfdump-1.6.2
./configure –prefix=/ –enable-nfprofile
make
make install

2. Download and install nfsen.

It requires web server with php module and RRD so make sure you have the corresponding packages installed. I hope you’re running httpd with php already so below are rrd/perl related packages installation hints only.

Fedora/Centos/Redhat users should type this:

yum install rrdtool rrdtool-devel rrdutils perl-rrdtool

Ubuntu/Debian:

aptitude install rrdtool librrd2-dev librrd-dev librrd4 librrds-perl librrdp-perl

If you run some exotic Linux distribution just install everything that is related to rrd + perl.

At last, nfsen installation:

cd /usr/src/
wget http://sourceforge.net/projects/nfsen/files/stable/nfsen-1.3.5/nfsen-1.3.5.tar.gz/download
tar -xvzf nfsen-1.3.5.tar.gz
cd nfsen-1.3.5
cp etc/nfsen-dist.conf etc/nfsen.conf

In order to continue you should edit file etc/nfsen.conf to specify where to install nfsen, web server’s username, its document root directory etc. That file is commented so there shouldn’t be serious problems with it.

One of the major sections of nfsen.conf is ‘Netflow sources’, it should contain exactly the same port number(s) you’ve configured Cisco with — recall ‘ip flow-export …’ line where we’ve specified port 23456. E.g.

%sources = (
‘Router1’ => { ‘port’ => ‘23456’, ‘col’ => ‘#0000ff’, ‘type’ => ‘netflow’ },
);

Now it’s time to finish the installation:

./install.pl etc/nfsen.conf

In case of success you’ll see corresponding notification after which you will have to start nfsen daemon to get the ball rolling:

/path/to/nfsen/bin/nfsen start

From this point nfdump started collecting netflow data exported by Cisco router and nfsen is hardly working to visualize it — just open web browser and go to http://linux_web_server/nfsen/nfsen.php to make sure. If you see empty graphs just wait for a while to let nfsen to collect enough data to visualize it.

That’s it!