Month: December 2014

Cleaning your Apt

My 16 GB Ubuntu partition has ran of out space. Disk usage analyzer claims that /var/cache/apt is using 669 MB. Time to clean it up my apt with apt-get clean! Basically, apt-get clean removes .deb packages that apt caches when you install or update programs.

elton@laptop:/var/cache$ du -hs
 du: cannot read directory `./ldconfig': Permission denied
 du: cannot read directory `./lightdm/dmrc': Permission denied
 743M .
 elton@laptop:/var/cache$ sudo !!
 sudo du -hs
 743M .
 elton@laptop:/var/cache$ sudo apt-get clean
 elton@laptop:/var/cache$ sudo du -hs
 105M

A few other options:

apt-get autoclean
to remove partial packages from the system
apt-get autoremove to remove packages installed as dependencies after the original package is removed

Filed under: Debian, Linux, Ubuntu

SNMPd in Ubuntu/Debian

Install the SNMP daemon.

aptitude install snmpd

To check which version of SNMP daemon that was installed, run the following

aptitude show snmpd

Make a backup of the original SNMP daemon configuration file.

cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf_ORIGINAL

Modify the SNMP daemon configuration file

vim /etc/snmp/snmpd.conf

The above command should also create the same file, if the configuration file does not exist. Append the following lines. Adjust the values to the SNMP community string that you use. This assumes SNMP version 2


rocommunity public
syslocation "Your Location"
syscontact admin@domain.com

Modify the /etc/default/snmpd file. Duplicate the the following line then uncomment it (the original line). You always want to make a copy of the original line.

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid'

Append the following to the duplicate line. Basically, point to the SNMP configuration file.

-c /etc/snmp/snmpd.conf'

It should look like the following:

SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'

Two ways to restart the snmpd service

service restart snmpd

or

/etc/init.d/snmpd restart

While you poll the machine, run this on the server to check the status

tcpdump -i eth0 "src or dst [ip address of SNMP polling server]"

Filed under: Debian, Linux, Ubuntu