I want to give credit to Lennart Ljungqvist whose article I found for installing net-snmp on Solaris helped me to create a startup script for net-snmp.
Installing software on Solaris is for a different time, but if you want to know how to configure net-snmp for startup, and in this case for it to coexist with other snmp daemons, then read on.
We already have the Sun snmp daemon running on UDP port 161. I have read of ways to integrate net-snmp with that daemon, but I was not attempting that today. I will run net-snmp on a different port (10161 in this case) but I need it to start on boot.
Here are the steps to follow. Thank you Lennart.
1. Create the init script.
vi /etc/init.d/netsnmp
put the following in the file:
##### START SCRIPT #####
#!/sbin/sh
#
case $1 in
'start')
/usr/local/sbin/snmpd udp:10161
;;
'stop')
kill `pgrep -U root snmpd`
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
##### END SCRIPT #####
2. Set the execute permission on the init script and link to the proper director for startup and shutdown:
chmod u+x /etc/init.d/netsnmp
ln -s /etc/init.d/netsnmp /etc/rc3.d/S99netsnmp
ln -s /etc/init.d/netsnmp /etc/rc2.d/K03netsnmp
3. Start the netsnmp daemon and try a snmpwalk
/etc/init.d/netsnmp start
snmpwalk -v1 -c rocommunity host:10161
Good luck.
Matthew
Wednesday, December 16, 2009
Monday, November 03, 2008
Cacti 32bit to 64bit - Updated 11/06/08
Update: It turns out that the problem is the version of rrdtool that is being used. I downgraded to version 1.2.23 and the graphs started showing up properly. Good news as I was able to migrate from 32 bit Centos 4.4 to 64bit Centos 5.2 and retain everything.
Matthew
I attempted to upgrade cacti across platforms, Centos 4.4 32bit to Centos 5.2 64bit. I went round and round and ended up having to export the rrd files on the old platform and then import them on the new. The data came across but the graphs are messed up with no legend or graph description. I have done some digging and have come to the conclusion that if I want to make this jump that I will just start over. Below is the shell script I found that can export and import rrd files. I wish I could remember where I found it to give the author credit as it worked well. In the end I have had suspicions that my cacti install has gotten corrupted and every once in awhile I like building from scratch. A lot has changed over two years and I fortunately don't have a pressing need for historical data.
#!/bin/sh
ECHO="echo -e"
rrdump ()
{
for rrd in `find . -type f -name "*.rrd"`
do
xml=`echo $rrd | sed 's/.rrd//g'`
rrdtool dump $rrd > $xml.xml
rm $rrd
done
}
xmlimport ()
{
for xml in `find . -type f -name "*.xml"`
do
rrd=`echo $xml | sed 's/.xml//g'`
rrdtool restore $xml $rrd.rrd
#rm $xml
done
}
case "$1" in
dump)
rrdump
;;
import)
xmlimport
;;
*)
$ECHO "$0 takes one of two arguments\n"
$ECHO "$0 dump -- dumps contents to xml\n"
$ECHO "$0 import -- imports xml files to rrd\n"
;;
esac
Matthew
I attempted to upgrade cacti across platforms, Centos 4.4 32bit to Centos 5.2 64bit. I went round and round and ended up having to export the rrd files on the old platform and then import them on the new. The data came across but the graphs are messed up with no legend or graph description. I have done some digging and have come to the conclusion that if I want to make this jump that I will just start over. Below is the shell script I found that can export and import rrd files. I wish I could remember where I found it to give the author credit as it worked well. In the end I have had suspicions that my cacti install has gotten corrupted and every once in awhile I like building from scratch. A lot has changed over two years and I fortunately don't have a pressing need for historical data.
#!/bin/sh
ECHO="echo -e"
rrdump ()
{
for rrd in `find . -type f -name "*.rrd"`
do
xml=`echo $rrd | sed 's/.rrd//g'`
rrdtool dump $rrd > $xml.xml
rm $rrd
done
}
xmlimport ()
{
for xml in `find . -type f -name "*.xml"`
do
rrd=`echo $xml | sed 's/.xml//g'`
rrdtool restore $xml $rrd.rrd
#rm $xml
done
}
case "$1" in
dump)
rrdump
;;
import)
xmlimport
;;
*)
$ECHO "$0 takes one of two arguments\n"
$ECHO "$0 dump -- dumps contents to xml\n"
$ECHO "$0 import -- imports xml files to rrd\n"
;;
esac
Saturday, November 01, 2008
Yard Care
Based off of recent advice...
less than .02% of weed seed
2 weeks to germinate for rye grass
4 weeks to germinate for bluegrass
25 pounds of seed for over seeding, I need at least 50 pounds in the spring after 25 pounds this fall.
precision lawnscape
aeration + lime in the spring and fall next year, after that only in the fall
water lawn to liquefy lime, mulch yard once aerated pieces dry up to break them up and put them back into the yard
water straight for two weeks once over seeding has been done
less than .02% of weed seed
2 weeks to germinate for rye grass
4 weeks to germinate for bluegrass
25 pounds of seed for over seeding, I need at least 50 pounds in the spring after 25 pounds this fall.
precision lawnscape
aeration + lime in the spring and fall next year, after that only in the fall
water lawn to liquefy lime, mulch yard once aerated pieces dry up to break them up and put them back into the yard
water straight for two weeks once over seeding has been done
Tuesday, September 18, 2007
Sendmail Relay
How do you get root's mail to my inbox on a different PC?
1. Edit your sendmail.mc file to include "define(`SMART_HOST', `a.b.c.d')", where a.b.c.d is the ip of a mail server you are allowed to relay through.
2. Generate a new sendmail.cf file using the m4 utility
cd /etc/mail
m4 sendmail.mc > sendmail.cf
3. Restart sendmail
service sendmail restart
4. Edit /etc/aliases to point root's mail to your mail
root: user@domain.com
5. Run the newaliases command
6. It is always a good idea to insure that sendmail is only running on the localhost, this can be verified by checking the sendmail.mc file for
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Note: You can always edit the submit.cf file to change the relay host from the localhost to the actual mail relay server. This will allow you to get mail from cronjobs that have you specified in the mailto=... syntax. You would do this if sendmail was not running.
There may be better ways but I have not found them.
Matthew
1. Edit your sendmail.mc file to include "define(`SMART_HOST', `a.b.c.d')", where a.b.c.d is the ip of a mail server you are allowed to relay through.
2. Generate a new sendmail.cf file using the m4 utility
cd /etc/mail
m4 sendmail.mc > sendmail.cf
3. Restart sendmail
service sendmail restart
4. Edit /etc/aliases to point root's mail to your mail
root: user@domain.com
5. Run the newaliases command
6. It is always a good idea to insure that sendmail is only running on the localhost, this can be verified by checking the sendmail.mc file for
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Note: You can always edit the submit.cf file to change the relay host from the localhost to the actual mail relay server. This will allow you to get mail from cronjobs that have you specified in the mailto=... syntax. You would do this if sendmail was not running.
There may be better ways but I have not found them.
Matthew
Wednesday, September 05, 2007
Oracle Stuff
Ok, I am back to posting things I need to remember. Been a bit overwhelmed lately and didn't have the time to even think about stuff I needed to remember. Ridculous if you ask me.
To reboot a server running Oracle 10g:
1. Login as the oracle user.
2. shutdb rev53p1
3. reboot
4. Login as the oracle user.
5. startdb rev53p1
Replace "rev53p1" with whatever database name you are working on. Apparently the one I work on is named rev53p1.
To reboot a server running Oracle 10g:
1. Login as the oracle user.
2. shutdb rev53p1
3. reboot
4. Login as the oracle user.
5. startdb rev53p1
Replace "rev53p1" with whatever database name you are working on. Apparently the one I work on is named rev53p1.
Monday, July 30, 2007
Ok
Ok, so the training in DC did not work out and that sucked. My friends Brad and Robert are there now drinking Yuengling I am sure. That is ok for my hometown brewery has just released their seasonal Oktoberfest, which I have to add is quite fantastic. The next seasonal beer on my horizon is the Christmas Ale, which is one of the best beers I have ever had the pleasure to taste.
Work has been really crazy and I need to show you what I have been up to. In the morning, around 5:00am, I will be joining two Internet architectures together, modifying BGP, the works. I can't wait.
Matthew
Work has been really crazy and I need to show you what I have been up to. In the morning, around 5:00am, I will be joining two Internet architectures together, modifying BGP, the works. I can't wait.
Matthew
Thursday, June 28, 2007
Memories
I was getting ready to sign up for some training at this year's SANSFIRE 2007 in Washington DC when I thought about my previous SANS GIAC certifications. I looked them up and they are still posted on-line. The memories!
Here is my first, probably not very good, practical for the GCFW certification.
And here is my second, hopefully better, practical for the GCUX certification.
It is funny how fast time flies and how much you can learn when you put your mind to it. I will hopefully be attending the SANSFIRE 2007 conference in Washington this year, though I am not going after a major certification. I am going to be taking an official SANS management class and three USENIX hosted training classes, two for Solaris (System Administration and Security) and one for system and network performance tunning. I am still mulling it over, but I am pretty sure this is what I am going to do.
Matthew
Here is my first, probably not very good, practical for the GCFW certification.
And here is my second, hopefully better, practical for the GCUX certification.
It is funny how fast time flies and how much you can learn when you put your mind to it. I will hopefully be attending the SANSFIRE 2007 conference in Washington this year, though I am not going after a major certification. I am going to be taking an official SANS management class and three USENIX hosted training classes, two for Solaris (System Administration and Security) and one for system and network performance tunning. I am still mulling it over, but I am pretty sure this is what I am going to do.
Matthew
Subscribe to:
Posts (Atom)