Could anyone donate snmpd.conf file?

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Francisco
Posts: 31
Joined: Sun Aug 01, 2004 11:09 pm

Could anyone donate snmpd.conf file?

Post by Francisco »

Hi,

I was wondering could someone donate (Paste here) his snmpd.conf file so I can see how to configure cacti an SNMP

btw; is the start command /etc/init.d/snmpd start OK?

Because I still see SNMP Error on cacti :o
www.navigatoris.net
melchandra
Cacti User
Posts: 311
Joined: Tue Jun 29, 2004 12:52 pm
Location: Indiana

Post by melchandra »

###########################################################################
#
# snmpd.conf
#
# - created by the snmpconf configuration program
#
###########################################################################
# SECTION: Access Control Setup
#
# This section defines who is allowed to talk to your running
# snmp agent.

# rocommunity: a SNMPv1/SNMPv2c read-only access community name
# arguments: community [default|hostname|network/bits] [oid]

rocommunity public

# rwcommunity: a SNMPv1/SNMPv2c read-write access community name
# arguments: community [default|hostname|network/bits] [oid]

rwcommunity private



###########################################################################
# SECTION: Extending the Agent
#
# You can extend the snmp agent to have it return information
# that you yourself define.

# pass: Run a command that intepretes the request for an entire tree.
# The pass program defined here will get called for all
# requests below a certain point in the mib tree. It is then
# responsible for returning the right data beyond that point.
#
# arguments: miboid program
#
# example: pass .1.3.6.1.4.1.2021.255 /path/to/local/passtest
#
# See the snmpd.conf manual page for further information.
#
# Consider using "pass_persist" for a performance increase.

pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat



###########################################################################
# SECTION: Monitor Various Aspects of the Running Host
#
# The following check up on various aspects of a host.

# proc: Check for processes that should be running.
# proc NAME [MAX=0] [MIN=0]
#
# NAME: the name of the process to check for. It must match
# exactly (ie, http will not find httpd processes).
# MAX: the maximum number allowed to be running. Defaults to 0.
# MIN: the minimum number to be running. Defaults to 0.
#
# The results are reported in the prTable section of the UCD-SNMP-MIB tree
# Special Case: When the min and max numbers are both 0, it assumes
# you want a max of infinity and a min of 1.

proc 0 0

# disk: Check for disk space usage of a partition.
# The agent can check the amount of available disk space, and make
# sure it is above a set limit.
#
# disk PATH [MIN=100000]
#
# PATH: mount path to the disk in question.
# MIN: Disks with space below this value will have the Mib's errorFlag set.
# Can be a raw byte value or a percentage followed by the %
# symbol. Default value = 100000.
#
# The results are reported in the dskTable section of the UCD-SNMP-MIB tree

disk /mnt/sda 0
disk /mnt/sdb 0
disk /mnt/sdd 0

###########################################################################
# SECTION: System Information Setup
#
# This section defines some of the information reported in
# the "system" mib group in the mibII tree.

# syslocation: The [typically physical] location of the system.
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysLocation.0 variable will make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: location_string

syslocation Unknown (edit /etc/snmp/snmpd.conf)
syslocation "Location goes here"

# syscontact: The contact information for the administrator
# Note that setting this value here means that when trying to
# perform an snmp SET operation to the sysContact.0 variable will make
# the agent return the "notWritable" error code. IE, including
# this token in the snmpd.conf file will disable write access to
# the variable.
# arguments: contact_string

syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
syscontact "Contact info goes here"

# sysservices: The proper value for the sysServices object.
# arguments: sysservices_number

sysservices 76

#
# Unknown directives read in from other files by snmpconf
#
access CactiGroup "" any noauth exact Cacti-All Cacti-All Cacti-All
com2sec local localhost public
com2sec mynetwork 10.2.100.0/24 private
group MyRWGroup any local
group MyROGroup any mynetwork
view all included .1 80
access MyROGroup "" any noauth 0 all none none
access MyRWGroup "" any noauth 0 all all all
I used the snmpconf program to generate this file, it's really easy. And yes, the start command will be either /etc/rc.d/init.d/snmpd start or /etc/init.d/snmpd start... you might also be able to use "service snmpd start" as well.

If this doesn't fix your snmp error on cacti, then post the error and the context (output from cmd.php, error when you click on a certain screen...) and somebody should be able to help you.
Dave
Coeus
Cacti User
Posts: 51
Joined: Mon Aug 04, 2003 8:46 pm
Location: Perth - Western Australia

Post by Coeus »

Quick followup to this

snmpconf -g basic_setup

Will create an snmp.conf file in the current directory.

Use snmpwalk -c CommunityName -v Version-2cOr1 ipaddress to test if snmp is working correctly.

Carl
foobie
Posts: 3
Joined: Tue Jun 27, 2006 12:24 pm

Post by foobie »

Apologies for the bump, but I'm sure I'm not the only one to battle with this.

Here is a minimal config for SNMP v3 as part of a kickstart (redhat's automatic installer) file. Read-only, SNMP version 3 only, authentication but no privacy. Note that you should add a "disk" line for each mount point you want to be available to ucd/net - Get Monitored Partitions, and really ought to update the syslocation and syscontact too.

Note that if you want to run this on an already-installed system, *stop snmpd first* - otherwise the user won't be added.

Code: Select all

yum install -y net-snmp net-snmp-libs
# ensure snmpd starts on bootup
chkconfig snmpd on

# set up my_v3 user
mkdir /var/net-snmp
echo 'createUser my_v3 MD5 "My_Pass" DES' > /var/net-snmp/snmpd.conf

# blat snmpd.conf with a minimal config
echo 'disk /' > /etc/snmp/snmpd.conf
echo 'rouser my_v3 auth' >> /etc/snmp/snmpd.conf
echo 'syslocation Newmachine' >> /etc/snmp/snmpd.conf
echo 'syscontact Root <root@localhost>' >> /etc/snmp/snmpd.conf
/etc/init.d/snmpd start
Test with

Code: Select all

snmpwalk -v 3 -u my_v3 -l authNoPriv -a MD5 -A My_Pass HOSTNAME ipAdEntAddr
Alternatively, with privacy enabled (dunno how well supported it is though)

Code: Select all

yum install -y net-snmp net-snmp-libs
# ensure snmpd starts on bootup
chkconfig snmpd on

# set up my_v3 user
mkdir /var/net-snmp
echo 'createUser my_v3 MD5 "My_Pass" DES' > /var/net-snmp/snmpd.conf

# blat snmpd.conf with a minimal config
echo 'disk /' > /etc/snmp/snmpd.conf
echo 'rouser my_v3 priv' >> /etc/snmp/snmpd.conf
echo 'syslocation Newmachine' >> /etc/snmp/snmpd.conf
echo 'syscontact Root <root@localhost>' >> /etc/snmp/snmpd.conf
/etc/init.d/snmpd start
Test with

Code: Select all

snmpwalk -v 3 -u my_v3 -l authPriv -a MD5 -A My_Pass -x DES -X My_Pass HOSTNAME ipAdEntAddr
I had fun with RHEL3 in that it has authentication problems and will respond to a v3 get request with an incorrect password, or return the first value for an snmpwalk. Hnnng. RHEL4 is fine, as is CentOS4.

HTH,
--
Adam
guru_root
Posts: 1
Joined: Tue Nov 18, 2008 1:05 am

Post by guru_root »

Hi do u check for NFS mount ?
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

I would do the following, it's too simply and supports snmpv1 and snmpv2

snmpd.conf

Code: Select all

rocommunity public
disk /
disk /var
disk /tmp
disk /<my_nfs_mount_point>
Like I said, it's too simple. Don't forget to restart snmpd afterwords.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests