Ubuntu 9.04 Snmpd filling up /var/log/messages and sending excessive syslog

I recently upgraded to Ubuntu 9.04 and found that snmpd was going overboard with the amount of syslog messages it was sending to my syslog server.

Example:

May 22 12:49:55 Server snmpd[4386]: Connection from UDP: [10.1.1.1]:58410
May 22 12:49:55 Server snmpd[4386]: Connection from UDP: [10.1.1.1]:56401
May 22 12:49:55 Server snmpd[4386]: Connection from UDP: [10.1.1.1]:51123
May 22 12:49:55 Server snmpd[4386]: Connection from UDP: [10.1.1.1]:49181
May 22 12:49:55 Server snmpd[4386]: Connection from UDP: [10.1.1.1]:42994
May 22 12:49:55 Server snmpd[4386]: Connection from UDP: [10.1.1.1]:46429
May 22 12:49:55 Server snmpd[4386]: Connection from UDP: [10.1.1.1]:60154

The fix was to modify the following line in my /etc/default/snmpd file:

Before:
SNMPDOPTS=’-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 0.0.0.0′

After:
SNMPDOPTS=’-LS4d -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 0.0.0.0′

Once this is done restart snmpd: sudo /etc/init.d/snmpd restart

Enjoy!

Update:

I checked on my Ubuntu 8.04 server (64bit) and saw that I was suffering from the same snmpd logging issue. I saw that this box was too running snmpd v5.4.1. I tried the same fix detailed above but it did not take and snmpd would complain about the options used. I was able to resolve the issue with the followng line in my /etc/default/snmpd :

SNMPDOPTS=’-LS 0-4 d -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 0.0.0.0′

How to quickly chmod files and directories selectivly

I recently had to secure a number of samba file shares which contained a few thousand directories and files. I wanted a quick way to set the permissions on all the files and then turn around and set the permissions on the folders but in a different manner. The following command will recursively search though a folder and find all files and change their permissions to the octal permission 664:

sudo find . -type f -exec chmod 0664 {} \;

Likewise we can change the search type to directories and change their permissions to 775.

sudo find . -type d -exec chmod 0775 {} \;

Php-syslog-ng for Ubuntu / Apache2

As I mentioned before I recently replaced my Windows Kiwi Syslog server with syslog-ng for syslog capturing and alerting. It has been running great for the past few months, however it lacks one nice feature of Kiwi and that was a front end GUI for easy viewing. To overcome this I decided to install php-syslog-ng. This app has some nice features, not only does it let you view the current log but you can do historical searches and filters. I have to say Im really pleased with it. Take a look at Openmaniak’s tutorial for more information on how to get it up and running on your box.

Syslog-ng and Ubuntu Gutsy

I have run Kiwi syslog server on window for years however it is starting to show its age. I figure why not move to an open platform that rocks! The great thing is that Syslog-ng on Ubuntu is configured as a drop in replacement to sysklog ( the default logger daemon). The first thing we need to do is grab and install syslog-ng.

sudo atp-get syslog-ng

Once this has been completed its time we pop open it’s config file and make some needed changes to allow for the reception of remote systems syslogs.

Continue reading

Ubuntu Backup Script

I covered creating an IPcop backup script last time. This time around I want to go over a backup script I’ve been using for an Ubuntu box. The script works just like the IPcop script with some slight modifications made to accommodate Ubuntu’s file system. In my case I mounted a separate volume at /media/backup. Either copy or create the following files in that location and modify them to fit your needs. If you want to ignore any files or folders for any reason simply add them to the ignore.txt file and they will be skipped. Remember to ignore any network mount points you may have, otherwise that MP3 collection on your other box is going to end up in your new 40gb backup tar file 😉

Continue reading

Add Command Prompt Here to Windows Context Menus

Windows explorer by default does not give you the option to drop to a DOS command shell in the current folder. Unzip this file, right click on doshere.inf and choose install. At this point you have a new folder context menu option for ‘Cmd Prompt Here’. Simply right click on any folder and select ‘Cmd Prompt Here’ and *wabam* you will have the command prompt opened to the directory you selected.

New 320GB HDD shows 137GB in the bios!

I recently purchased a Seagate Barracuda 7200.10 – ST3320620A 320GB HDD to backup my systems. I decided to make my life easy and pop it into a external USB/Firewire case. All went well except that I could only format the drive to 137GB. After reading many posts online about this problem I decided to hook the drive up to the onboard HDD controller on my Asus A8N-SLI.  Even the system BIOS displayed 137GB! Many reports on the Internet say the cause of this is due to old firmware or hardware, in my case this was just not true. I tried about six other HDD controllers without luck. Finally I decided to try some software tools just to see if the drive was in fact 320GB in sieze. In my searches I found a killer tool named Victoria (sorry it's in Russian only). It turns out that some how my HPA (Host-Protected Area) accessible size of the disk got altered. Using this application you can set the HPA accessible size of the disk back to the maximum or to factory defaults. Upon a reboot I was back in business, the BIOS now saw the drive as having 320GB!

If your Russian is not up to speed, check out MHDD it boasts the same functionality as Victoria but it's web page is in English.