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
Could anyone donate snmpd.conf file?
Moderators: Developers, Moderators
Could anyone donate snmpd.conf file?
www.navigatoris.net
-
- Cacti User
- Posts: 311
- Joined: Tue Jun 29, 2004 12:52 pm
- Location: Indiana
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.###########################################################################
#
# 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
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
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.
Test with
Alternatively, with privacy enabled (dunno how well supported it is though)
Test with
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
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
Code: Select all
snmpwalk -v 3 -u my_v3 -l authNoPriv -a MD5 -A My_Pass HOSTNAME ipAdEntAddr
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
Code: Select all
snmpwalk -v 3 -u my_v3 -l authPriv -a MD5 -A My_Pass -x DES -X My_Pass HOSTNAME ipAdEntAddr
HTH,
--
Adam
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
I would do the following, it's too simply and supports snmpv1 and snmpv2
snmpd.conf
Like I said, it's too simple. Don't forget to restart snmpd afterwords.
TheWitness
snmpd.conf
Code: Select all
rocommunity public
disk /
disk /var
disk /tmp
disk /<my_nfs_mount_point>
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?
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?
Who is online
Users browsing this forum: No registered users and 1 guest