nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

How to configure NET-SNMP for multiple different Networks

This is a discussion on How to configure NET-SNMP for multiple different Networks within the Networking, Firewalls and Security forums, part of the Mastering Servers category; Hi Well I want to configure Net-snmp for MRTG. But I wana know how to configure com2sec rule in snmpd.conf ...


Go Back   nixCraft Linux Forum > Mastering Servers > Networking, Firewalls and Security

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 06-12-2007, 08:53 PM
Junior Member
User
 
Join Date: Jun 2007
My distro: Freebsd, CentOS, Solaris, RHEL, Fedora, and Ubuntu
Posts: 15
Rep Power: 0
manish_2479 is on a distinguished road
Send a message via ICQ to manish_2479 Send a message via AIM to manish_2479 Send a message via MSN to manish_2479 Send a message via Yahoo to manish_2479
Default How to configure NET-SNMP for multiple different Networks

Hi Well I want to configure Net-snmp for MRTG. But I wana know how to configure com2sec rule in snmpd.conf file for so many different Networks which are configured on routers switches and nodes with the different ranges of network classes.Like /24, /30, /26 ,/28 with the different ranges.And also wana know how to configure MRTG for cpu , disk and memory usage.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-12-2007, 10:15 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,061
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
Originally Posted by manish_2479 View Post
also wana know how to configure MRTG for cpu , disk and memory usage.
Make sure snmpd configured.

Create directory for mrtg grap in Apache webroot:
Code:
mkdir /var/www/mrtg
Run cfgmaker:
Code:
cfgmaker  \
--output=/etc/mrtg/traffic.cfg \
--ifdesc=ip \
--ifref=descr \
--global "WorkDir: /var/www/mrtg" \
--global "Options[_]: bits,growright" \
  public@localhost
Create /etc/mrtg/cpu.cfg and append config code:
Code:
WorkDir: /var/www/mrtg
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
Target[localhost.cpu]:ssCpuRawUser.0&ssCpuRawUser.0:public@127.0.0.1+ ssCpuRawSystem.0&ssCpuRawSystem.0:public@127.0.0.1+ ssCpuRawNice.0&ssCpuRawNice.0:public@127.0.0.1
RouterUptime[localhost.cpu]: public@127.0.0.1
MaxBytes[localhost.cpu]: 100
Title[localhost.cpu]: CPU Load
PageTop[localhost.cpu]: <H1>Active CPU Load %</H1>
Unscaled[localhost.cpu]: ymwd
ShortLegend[localhost.cpu]: %
YLegend[localhost.cpu]: CPU Utilization
Legend1[localhost.cpu]: Active CPU in % (Load)
Legend2[localhost.cpu]:
Legend3[localhost.cpu]:
Legend4[localhost.cpu]:
LegendI[localhost.cpu]:  Active
LegendO[localhost.cpu]:
Options[localhost.cpu]: growright,nopercent
Create /etc/mrtg/memory.cfg and append config code:
Code:
LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt
Target[localhost.mem]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.6.0:public@localhost
PageTop[localhost.mem]: <H1>Free Memory</H1>
WorkDir: /var/www/mrtg
Options[localhost.mem]: nopercent,growright,gauge,noinfo
Title[localhost.mem]: Free Memory
MaxBytes[localhost.mem]: 1000000
kMG[localhost.mem]: k,M,G,T,P,X
YLegend[localhost.mem]: bytes
ShortLegend[localhost.mem]: bytes
LegendI[localhost.mem]:  Free Memory:
LegendO[localhost.mem]:
Legend1[localhost.mem]: Free memory, not including swap, in bytes
Run mrtg -
Code:
env LANG=C /usr/bin/mrtg /etc/mrtg/cpu.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/memory.cfg
env LANG=C /usr/bin/mrtg /etc/mrtg/traffic.cfg
Run indexmaker
Code:
indexmaker --output=/var/www/mrtg \
--title="Server.Domain.Com MRTG" \
--sort=name \
--enumerate \
/etc/mrtg/traffic.cfg \
/etc/mrtg/cpu.cfg \
/etc/mrtg/memory.cfg
Setup cron job:
Code:
crontab -e
Append code:
Code:
*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/cpu.cfg
*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/memory.cfg
*/5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg/traffic.cfg
More config docs @ MRTG - MRTG Companion Sites
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 06-13-2007, 01:11 AM
Junior Member
User
 
Join Date: Jun 2007
My distro: Freebsd, CentOS, Solaris, RHEL, Fedora, and Ubuntu
Posts: 15
Rep Power: 0
manish_2479 is on a distinguished road
Send a message via ICQ to manish_2479 Send a message via AIM to manish_2479 Send a message via MSN to manish_2479 Send a message via Yahoo to manish_2479
Default SNMP Error: no response received

Well I ran cfgmaker to create mrtg.cfg file but it gives me an SNMP Error: no response received.The command is as below #cfgmaker --global &quot;workdir: usr/local/www/mrtg/node-01&quot; -ifref=ip --output /usr/local /www/mrtg/node-01/node-01-mrtg.cfg --global 'options[_]: growright,bits' public@node-01 ERROR is as below SNMP Error: no response received SNMPv1_Session (remote host: &quot;node-01&quot; [192.168.10.8].161) community: &quot;endai-snmp&quot; request ID: -736885146 PDU bufsize: 8000 bytes timeout: 2s retries: 5 backoff: 1) at /usr/local/lib/perl5/site_perl/5.8.8/SNMP_util.pm line 627 SNMPWALK Problem for 1.3.6.1.2.1.1 on public@node-01::::::v4only at /usr/local/bin/cfgmaker line 918 WARNING: Skipping public@node-01: as no info could be retrieved ################################################## ### So where could be the problem with this setup and I have also got so many ranges of subnets and network so how to define com2sec source in snmpd.conf file.

Last edited by manish_2479; 06-13-2007 at 01:14 AM..
Reply With Quote
  #4 (permalink)  
Old 06-14-2007, 01:29 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Configure snmpd as i described eariler
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Problems with perl module Net::SNMP Jason Linux software 1 12-28-2007 03:09 AM
1 Router - 3 Networks - Big Help phatlix Networking, Firewalls and Security 0 09-06-2007 03:26 PM
Python with SNMP Supportq rcordeiro Shell scripting 2 12-16-2006 11:48 PM
Net-snmp header file puppen Linux software 2 05-23-2006 06:45 PM
SNMP error CODE MRTG Mediocre Linux software 3 03-18-2005 02:05 PM


All times are GMT +5.5. The time now is 02:04 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36