LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-25-2006, 11:10 AM   #1
Mithrilhall
Member
 
Registered: Feb 2002
Location: Massachusetts
Distribution: Debian (Lenny)
Posts: 286

Rep: Reputation: 30
Question Net-SNMP (snmpd)


I just installed net-snmp and configured snmpd and it works great. The one problem I'm having is it doesn't start when the computer boots.

How can I get snmpd to start when the computer boots up?

BTW...I have no gui installed other than webmin. I'm doing all configuration changes from via CLI.
 
Old 05-25-2006, 09:38 PM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Which of the distros listed in your sig is this on? How did you install net-snmp? If it was done from a source package, they sometimes include start up scripts, that can be installed with a command like make install-script or something like that. Browse the location where you unzipped the source, and you'll probably find some startup scripts. If you installed it through a package management system, it should have given you the choice to configure an autostart for the utility.

you usually find startup/stop scripts in /etc/init.d, or some closely related directory. In debian I would copy a script from /etc/init.d, and change the script itself to call net-snmp rather than whatever it did originally.

Peace,
JimBass
 
Old 05-25-2006, 10:15 PM   #3
Mithrilhall
Member
 
Registered: Feb 2002
Location: Massachusetts
Distribution: Debian (Lenny)
Posts: 286

Original Poster
Rep: Reputation: 30
Thanks JimBass. I'm running Asterisk@Home 2.8 (aka CentOS 4.3) with no WM. I'll check the source package and see if there was a startup script included.
 
Old 05-25-2006, 10:59 PM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Just to see I installed it from source, and not only does it not install startup scripts, it doesn't include sample ones. Digging through the net-snmp mail archives, I found somebody who posted a simple start stop script for Solaris, located here: http://sourceforge.net/mailarchive/m...msg_id=5099720

By changing the first line to #!/bin/bash from #!/sbin/sh everything works on my debian system. I ran through the debian system to cause that script (/etc/init.d/net-snmp on mine) to be started automatically at boot. The code itself in that file looks like this:

Code:
#!/bin/bash
#
case "$1" in
"start")
       /usr/local/sbin/snmpd
       ;;

"stop")
       /usr/bin/pkill -9 -x -u 0 "(snmpd|snmptrapd)"
       ;;

*)
       echo "Usage: $0 { start | stop }"
       exit 1
       ;;
esac
exit 0
I don't know CentOS, so figuring out where to put that script and how to make it auto start falls back to you, but this code should make the service run.

peace,
JimBass
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to generate snmp trap using the ucLinux /user/snmpd API jonathan_wu Programming 3 08-27-2008 10:15 AM
How to configure ucd-snmp and net-snmp? Tazzmanian Linux - Networking 1 05-27-2005 09:09 AM
Net-Snmpd load at boot? IntelSlacker Linux - Software 2 04-22-2005 06:12 PM
Install snmp or snmpd rob_roman23 Linux - Software 13 03-28-2003 06:42 AM
snmp (ucd-snmp, net-snmp) markus1982 Linux - Software 1 11-21-2002 11:45 AM


All times are GMT -5. The time now is 07:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration