openSUSE Forums > Applications > Multimedia » Trapsnmp nagios

Go Back   openSUSE Forums > Applications > Multimedia
Forums FAQ Members List Search Today's Posts Mark Forums Read

Multimedia Questions about media applications, codecs (DVD, music, video, pdf) configuration (usage, bugs)

Reply
Page 1 of 3 1 23
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 22-Jun-2009, 08:00
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
  #2 (permalink)  
Old 22-Jun-2009, 08:52
malcolmlewis's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Podunk
Posts: 4,285
malcolmlewis has a spectacular reputation aura about
Default Re: Trapsnmp nagios

Quote:
Originally Posted by ophicius
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
<snip>
Hi
Don't think multimedia was the correct place to post this

You need to create the snmptrap.conf file see the man page;

man snmptrapd.conf

"The Net-SNMP notification receiver (trap daemon) uses one or
more configuration files to control its operation and how incoming
traps (and INFORM requests) should be processed. This file
(snmptrapd.conf) can be located in one of several locations, as
described in the snmp_config(5) manual page."

--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.23-0.1-default
up 11:58, 2 users, load average: 0.07, 0.19, 0.15
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Reply With Quote
  #3 (permalink)  
Old 22-Jun-2009, 09:00
Puzzled Penguin
 
Join Date: Jun 2009
Posts: 14
ophicius hasn't been rated much yet
Default Re: Trapsnmp nagios

yes i 've created this file

Quote:
SNMPTRAPD.conf (etc/snmp/)
traphandle default /usr/sbin/snmptt
disableAuthorization yes
donotlogtraps yes
and
Quote:
snmp.conf

com2sec Local 103.2.4.0/24 rtvyti

group rogroup v1 Local


view all included .1 80

prefixe lecture ecriture notification
Reply With Quote
  #4 (permalink)  
Old 22-Jun-2009, 09:42
malcolmlewis's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Podunk
Posts: 4,285
malcolmlewis has a spectacular reputation aura about
Default Re: Trapsnmp nagios

Quote:
Originally Posted by ophicius
yes i 've created this file

> SNMPTRAPD.conf (etc/snmp/)
> traphandle default /usr/sbin/snmptt
> disableAuthorization yes
> donotlogtraps yes


and
> snmp.conf
>
> com2sec Local 103.2.4.0/24 rtvyti
>
> group rogroup v1 Local
>
>
> view all included .1 80
>
> prefixe lecture ecriture notification
>
>
Hi
Have you manually started snmptrapd from the command line to see if
it's working ok? (you may want to enable logging to start with)
Code:
snmptrapd&
--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.23-0.1-default
up 12:51, 2 users, load average: 0.07, 0.02, 0.00
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Reply With Quote
  #5 (permalink)  
Old 22-Jun-2009, 10:18
Puzzled Penguin
 
Join Date: Jun 2009
Posts: 14
ophicius hasn't been rated much yet
Default Re: Trapsnmp nagios

when i do snmptrapd& i've that :

linux-fxqr:/var/log # snmptrapd&
[11] 21832

what can i do now lol
Reply With Quote
  #6 (permalink)  
Old 22-Jun-2009, 11:46
malcolmlewis's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Podunk
Posts: 4,285
malcolmlewis has a spectacular reputation aura about
Default Re: Trapsnmp nagios

Quote:
Originally Posted by ophicius
when i do snmptrapd& i've that :

linux-fxqr:/var/log # snmptrapd&
[11] 21832

what can i do now lol
Hi
So if you use ps -ef you see the process running ok? Have you tried
sending a test trap and see if it's detected?

eg;
Code:
snmptrap -v 2c -m ALL -c public localhost '' coldStart
--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.23-0.1-default
up 14:49, 3 users, load average: 0.22, 0.10, 0.02
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Reply With Quote
  #7 (permalink)  
Old 23-Jun-2009, 02:38
Puzzled Penguin
 
Join Date: Jun 2009
Posts: 14
ophicius hasn't been rated much yet
Default Re: Trapsnmp nagios

yes,

linux-fxqr:/var/log # ps -ef | grep snmptrapd
root 21833 1 0 08:56 ? 00:00:00 snmptrapd


but when i do :

snmptrap -v 1 -m ALL -c loiuc localhost '' coldStart


i've

Quote:
linux-fxqr:/var/log # snmptrap -v 1 -c loiuc localhost '' coldStart
/etc/snmp/snmp.conf: line 6: Warning: Unknown token: com2sec.
/etc/snmp/snmp.conf: line 13: Warning: Unknown token: group.
/etc/snmp/snmp.conf: line 18: Warning: Unknown token: view.
/etc/snmp/snmp.conf: line 22: Warning: Unknown token: access.
unknown host: coldStart

My SNMP.conf
Quote:
com2sec Local 192.168.77.0/24 loiuc
group rogroup v1 Local
view all included .1 80
access rogroup "" v1 noauth exact all none none

-------
but about snmptrap, how can i do to restart .. because snmptrapd& isn't really good, why i do not have this file on /init.d/... only snmpd...
thanks
Reply With Quote
  #8 (permalink)  
Old 23-Jun-2009, 08:25
malcolmlewis's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Podunk
Posts: 4,285
malcolmlewis has a spectacular reputation aura about
Default Re: Trapsnmp nagios

Quote:
Originally Posted by ophicius
yes,

linux-fxqr:/var/log # ps -ef | grep snmptrapd
root 21833 1 0 08:56 ? 00:00:00 snmptrapd


but when i do :

snmptrap -v 1 -m ALL -c loiuc localhost '' coldStart


i've

> linux-fxqr:/var/log # snmptrap -v 1 -c loiuc localhost '' coldStart
> /etc/snmp/snmp.conf: line 6: Warning: Unknown token: com2sec.
> /etc/snmp/snmp.conf: line 13: Warning: Unknown token: group.
> /etc/snmp/snmp.conf: line 18: Warning: Unknown token: view.
> /etc/snmp/snmp.conf: line 22: Warning: Unknown token: access.
> unknown host: coldStart



My SNMP.conf
> com2sec Local 192.168.77.0/24 loiuc
> group rogroup v1 Local
> view all included .1 80
> access rogroup "" v1 noauth
> exact all none none



-------
but about snmptrap, how can i do to restart .. because snmptrapd& isn't
really good, why i do not have this file on /init.d/... only snmpd...
thanks
Hi
Don't think you have configured up snmpd.conf quite correctly. To start
just run as root user;

Code:
snmpconf -g basic_setup
The startup file is not in /etc/init.d by default, to add run the
following;

Code:
sudo
cp /usr/share/doc/packages/net-snmp/rc.snmptrapd /etc/init.d/snmptrapd
sudo chmod 755 /etc/init.d/snmptrapd
sudo /sbin/chkconfig snmptrapd on
--
Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.23-0.1-default
up 1 day 9:55, 2 users, load average: 0.08, 0.09, 0.03
GPU GeForce 8600 GTS Silent - Driver Version: 185.18.14

Reply With Quote
  #9 (permalink)  
Old 23-Jun-2009, 12:20
Puzzled Penguin
 
Join Date: Jun 2009
Posts: 14
ophicius hasn't been rated much yet
Default Re: Trapsnmp nagios

Thanks for the help malcolmlewis

in my /etc/snmp/ i've snmpd.conf and snmptrapd.conf

Snmpd.conf

# Please see /usr/share/doc/packages/net-snmp/EXAMPLE.conf for a
# more complete example and snmpd.conf(5).
#
# Writing is disabled by default for security reasons. If you'd like
# to enable it uncomment the rwcommunity line and change the community
# name to something nominally secure (keeping in mind that this is
# transmitted in clear text).

# don't use ' < > in strings for syslocation or syscontact
# Note that if you define the following here you won't be able to change
# them with snmpset
syslocation salleserver
syscontact Sysadmin (root@localhost)

# These really aren't meant for production use. They include all MIBS
# and can use considerable resources. See snmpd.conf(5) for information
# on setting up groups and limiting MIBS.
rocommunity test 127.0.0.1
rocommunity test 192.168.20.16
# rwcommunity mysecret 127.0.0.1


and

snmptrapd.conf

traphandle default /usr/sbin/snmptt
disableAuthorization yes
donotlogtraps yes

i'm going to test with on my hp procurve, i tell you what
Reply With Quote
  #10 (permalink)  
Old 29-Jun-2009, 03:00
Puzzled Penguin
 
Join Date: Jun 2009
Posts: 14
ophicius hasn't been rated much yet
Default Re: Trapsnmp nagios

hi,

i would like to put that in my nagios file configuration :

Quote:
define service{
name generic-service
register 0
check_period 24x7
max_check_attempts 3
normal_check_interval 15
retry_check_interval 5
active_checks_enabled 1
passive_checks_enabled 0
parallelize_check 1
obsess_over_service 0
check_freshness 0
event_handler_enabled 0
flap_detection_enabled 0
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 60
notification_period 24x7
notification_options w,u,c,r
notifications_enabled 1
}

define service{
name snmptrap-service
use generic-service
register 0
service_description TRAP
is_volatile 1
check_command check-host-alive
max_check_attempts 1
normal_check_interval 1
retry_check_interval 1
passive_checks_enabled 1
check_period none
notification_interval 31536000
contact_groups toutlemonde
}
but i don't have services file

Quote:
drwxrwxr-x 2 nagios nagios 4096 juin 15 15:27 ./
drwxrwxr-x 3 nagios nagios 4096 juin 15 15:29 ../
-rw-rw-r-- 1 nagios nagios 7722 juin 15 15:27 commands.cfg
-rw-rw-r-- 1 nagios nagios 7722 juin 15 15:25 commands.cfg~
-rw-rw-r-- 1 nagios nagios 2166 juin 15 15:27 contacts.cfg
-rw-rw-r-- 1 nagios nagios 2166 juin 15 15:25 contacts.cfg~
-rw-rw-r-- 1 nagios nagios 5403 juin 15 15:27 localhost.cfg
-rw-rw-r-- 1 nagios nagios 5403 juin 15 15:25 localhost.cfg~
-rw-rw-r-- 1 nagios nagios 3124 juin 15 15:27 printer.cfg
-rw-rw-r-- 1 nagios nagios 3124 juin 15 15:25 printer.cfg~
-rw-rw-r-- 1 nagios nagios 3293 juin 15 15:27 switch.cfg
-rw-rw-r-- 1 nagios nagios 3293 juin 15 15:25 switch.cfg~
-rw-rw-r-- 1 nagios nagios 10812 juin 15 15:27 templates.cfg
-rw-rw-r-- 1 nagios nagios 10812 juin 15 15:25 templates.cfg~
-rw-rw-r-- 1 nagios nagios 3209 juin 15 15:27 timeperiods.cfg
-rw-rw-r-- 1 nagios nagios 3209 juin 15 15:25 timeperiods.cfg~
-rw-rw-r-- 1 nagios nagios 4007 juin 15 15:27 windows.cfg
-rw-rw-r-- 1 nagios nagios 4007 juin 15 15:25 windows.cfg~
thks
Reply With Quote
Reply
Page 1 of 3 1 23

Bookmarks


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




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2