Thread: Trapsnmp nagios
View Single Post
  #1 (permalink)  
Old 22-Jun-2009, 08:00
ophicius ophicius is offline
Puzzled Penguin
 
Join Date: Jun 2009
Posts: 14
ophicius hasn't been rated much yet
Default Trapsnmp nagios

hello,

i would like to do any trapsnmp with nagios on opensuse, but i've a problem with the configuration.

i'm reading tutorial about trapsnmp and they tell me to configure the snmptrapd.conf file on /etc/init.d/snmptrapd.conf and put that in "OPTIONS="-On -Lsd -p /var/run/snmptrapd.pid", but i don't have this file on my suse. i just have snmpd.conf

must i used snmpd.conf ? if yes could you tell me how i must include this line "OPTIONS="-On -Lsd -p /var/run/snmptrapd.pid""

SNMPD.conf

Quote:
case "$1" in
start)
echo -n "Starting snmpd"
#
# do not even try to start if the log file is (2GB-1MB) big.
# the snmpd doesnt handle LFS properly
#
SNMPD_LOGFILE="${SNMPD_LOGFILE:-/var/log/net-snmpd.log}"
if [ -e "$SNMPD_LOGFILE" ] ; then
SNMPD_SIZE_LOGFILE="$(stat -c "%s" $SNMPD_LOGFILE)"
SNMPD_SIZE_MAX="1073741824"
if [ $SNMPD_SIZE_LOGFILE -gt $SNMPD_SIZE_MAX ] ; then
echo -e "\n\"$SNMPD_LOGFILE\" was to large. Running 'logrotate' for net-snmp." >&2
/usr/sbin/logrotate /etc/logrotate.d/net-snmp
fi # if [ $SNMPD_SIZE_LOGFILE -gt $SNMPD_SIZE_MAX ] ; then
fi # if [ -e "$SNMPD_LOGFILE" ] ; then
get_agents
# Do not add -c /etc/snmpd.conf, since it is already loaded by default.
if [ $SNMPDCONF = "/etc/snmp/snmpd.conf" ]; then
SNMPDCONF=""
else
SNMPDCONF="-c $SNMPDCONF"
fi
case "${SNMPD_USE_SMUX:-yes}" in
[Nn][Oo])
SNMPDNOSMUX="-I -smux"
;;
esac
case "${SNMPD_LOG_SUCCESSFUL_CONNECTIONS:-yes}" in
[Nn][Oo])
SNMPDNOTCPWRAPPERLOG="--dontLogTCPWrappersConnects"
;;
esac
startproc $SNMPD $SNMPDCONF -r -A -LF ${SNMPD_LOGLEVEL:-d} $SNMPD_LOGFILE -p /var/run/snmpd.pid $agentargs $SNMPDNOSMUX $SNMPDNOTCPWRAPPERLOG
rc_status -v
rc_reset

# start all agents
if test -n "$agents"; then
usleep 300000
for agent in $agents; do
echo -en "\tStarting `basename $agent`"
startproc -t1 $agent
rc_status -v ; rc_reset
done
fi
;;
stop)
echo -n "Shutting down snmpd:"
killproc -TERM $SNMPD
rc_status -v ; rc_reset
# we also need to make sure all agents die
get_agents
if test -n "$agents"; then
for agent in $AGENTDIR/*; do
test -x $agent || continue
echo -ne "\tShutting down `basename $agent`:"
killproc $agent
rc_status -v ; rc_reset
done
fi
;;
try-restart)
$0 status >/dev/null && $0 restart
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
echo -n "Reload service snmpd:"
killproc -HUP $SNMPD
rc_status -v
;;
reload)
echo -n "Reload service snmpd:"
killproc -HUP $SNMPD
rc_status -v
;;
status)
echo -n "Checking for service snmpd:"
checkproc $SNMPD
rc_status -v
get_agents
if test -n "$agents"; then
echo -e "Checking for agents:"

for agent in $agents; do
echo -en "\t`basename $agent`"
checkproc $agent
rc_status -v
done
fi
;;
*)
echo "Usage: $0 {start|stop|try-restart|restart|force-reload|reload|status}"
exit 1
;;
esac
rc_exit
Reply With Quote