62 articles Linux Page 2 / 7

Graphing disk temperatures with the Eluna Graph System

I have been using the Eluna Graph System for several years, as I like it’s simplicity. As per this post, I graph my ESXi disk temperatures so that I can keep an eye on them. Content of create.sh: #!/bin/bash rrdtool create esxi_disks.rrd \ –start `date +%s` \ –step 300 \ DS:disk1:GAUGE:600:0:U \ DS:disk2:GAUGE:600:0:U \ DS:disk3:GAUGE:600:0:U…

Blocking bogons with iptables

ipsets is a fairly recent addition to the netfilter family. It is possible to define networks / addresses and then use them in iptables. ipset –create bogons nethash ipset –add bogons 10.0.0.0/8 ipset –add bogons 192.168.0.0/16 ipset –add bogons 0.0.0.0/8 ipset –add bogons 169.254.0.0/16 ipset –add bogons 172.16.0.0/12 ipset –add bogons 192.0.2.0/24 ipset –add bogons…

MySQL initial run

This serves to remind me how to initialise a new MySQL installation, if it doesn’t happen automatically. PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password ‘new-password’ /usr/bin/mysqladmin -u root -h password ‘new-password’ Alternatively you can run:…

Fix font path for gnuplot

In the console enter: In my gnuplot (bash) scripts I have: export GDFONTPATH=”/usr/share/fonts/truetype/ttf-dejavu/” export GNUPLOT_FONTPATH=”/usr/share/fonts/truetype/ttf-dejavu/” Other methods: export GDFONTPATH=”/your/font/directory/fonts/” before you start gnuplot. The fonts should be in the folder “/fonts”. To make this persistent across reboots, and to set the paths for fonts in postscript terminal, add lines similar to the ones below to…

Some useful Linux commands

Rename files / folders with spaces: IFS=$’\n’;for f in `find .`; do file=$(echo $f | tr [:blank:] ‘_’); [ -e $f ] && [ ! -e $file ] && mv “$f” $file;done;unset IFS Rsync: rsync -r -a -v rsync://ns2/storage/www-srv /storage/ ^^^ from ns2 to new host – (run on new host) Rsync (local to remote)…

Create and manage Linux volumes (LVM)

Create the physical volume: pvcreate /dev/sdb Create the Volume Group: vgcreate vg_backuppc_storage /dev/sdb Create the logical volume: lvcreate -l +100%FREE vg_backuppc_storage Create a filesystem on the logical volume: mkfs.ext4 /dev/vg_backuppc_storage/lvol0 Resize the physical volume: (need to unmount the LV before doing this) pvresize /dev/sdb Extend the volume: lvextend -l +100%FREE -r /dev/vg_backuppc_storage/lvol0 Mount your new…

Define a new service in Nagios

To define a new service in Nagios you need to do the following: 1) Add the necessary commands to /etc/nagios/objects/commands.cfg 2) Define the host and service in /etc/nagios/objects/templates.cfg 3) Define a host definition in /etc/nagios/objects/.cfg Command definition in commands.cfg define command{ command_name check-ssl-cert command_line $USER1$/check_ssl_certificate -H $ARG1$ -p $ARG2$ -c $ARG3$ -w $ARG4$ } The…