Sunday, August 13, 2017

GenMon That CPU Temp

A little, really a very, very little script to get the CPU temp from my boxes (tested on my baby Thinkpads and on the Dell XPS M1330).
Used with the little known marvel of the XFCE Panel plugin called GenMon (lately a favorite of mine)  you end up getting something like the screenshot on the left.
So here is the script:

#!/bin/bash
cat /sys/class/thermal/thermal_zone0/temp > /tmp/cpu_temp
echo $((`cat /tmp/cpu_temp`/1000))"°"

Labels: , , , , , , , , ,

Tuesday, July 11, 2017

GenMon That Load & RAM Usage


And yet another genmon little use...
Two small scripts that add the load and RAM usage on the XFCE Panel.

Get Load:
#!/bin/bash
cat /proc/loadavg | awk '{print $1}'

Get RAM:
#!/bin/bash
free -m | awk 'NR==2{printf "RAM: %s/%sMB %.2f%%\n", $3,$2,$3*100/$2 }'| cut -d " " -f3

Save those as a separate script, and then invoke each one of them from a separate instance of Gen Mon on the Panel, with a value of 2 for the Period.

Labels: , , , , , , , ,

Saturday, June 10, 2017

The Return Of The Temperature

Since the Weather plugin died on all of my XFCE boxens I was left on the dark, without any reliable way of knowing what was going on (weather wise) out in the real world.

I had a bunch of shell scripts that pull the weather, so I was thinking in a way of adding the output of one of those scripts onto the XFCE Panel somehow...

Enter Genmon, a plugin for the XFCE Panel that does one thing, executes a program and prints the result, over and over again.
So, let's get going! Install the plugin like this:

sudo apt-get install xfce4-genmon-plugin

Add the plugin to the Panel, and then edit it to execute whatever you want to have displayed on the Panel.
It doesn't like to execute arguments nor pipes, so I've saved that onto a shell script, and then call it from the plugin, the script looks like this:

#!/bin/bash
WGET='wget -q -O- '
$WGET http://www.accuweather.com/en/ar/buenos-aires/7894/weather-forecast/7894\
 | awk -F\' '/acm_RecentLocationsCarousel\.push/{print  "" $10"°"}'| head -1;

And then set it to execute every 1000 seconds.

Labels: , , , , , , , , , , , ,

Wednesday, December 02, 2015

Monit & Ruby: What a (Environment) Hell!!

These last couple of days I've been dealing with Monit and a Linux box running a bunch of Ruby stuff...
What a freakin' fucking nightmare is to setup Monit to start those damn processes, by Jeebus!
It took me a lot of fumblin' and testing to get those fuckers up & running thru Monit.
The whole thing remind me of those halcyon days of setting up Oracle on a Red Hat 6.2 box, the only difference was that getting Oracle installed and running on those boxes was a pain, and getting this hipster crap is a piece of cake, the hard part was getting it to start using a different user.


Labels: , , , , ,

Saturday, November 28, 2015

OpenVPN: Use MRTG To Graph Connected Users To The VPN

This is a little and simple shell script I wrote to graph using MRTG the number of users who are connected to a VPN server.
The script is really, really simple (as this VPN setup).
It searches for a string on a log file, and then counts and graphs how many times that string appears.
The script itself (simply edit the LAN to suit your needs):

#!/bin/sh

LOG='/path/to/your.openvpn.log'
LAN='10.17.25.'

if [ `cat $LOG | egrep $LAN | wc -l` = 0 ]
then
    echo `cat $LOG | egrep $LAN | wc -l`
    echo `cat $LOG | egrep $LAN | wc -l` Logged Users
else
    echo `cat $LOG | egrep $LAN | wc -l`
    echo `cat $LOG | egrep $LAN | wc -l` Logged Users
fi

# EoF #


And then the MRTG configuration file snip:

###############################
## Users connected to the VPN
###############################
Target[local_openvpn]: `sh /path/to/script.sh`
Options[local_openvpn]: nopercent,gauge,noinfo,nobanner,noo
Title[local_openvpn]: Number of VPN Connections
MaxBytes[local_openvpn]: 100
YLegend[local_openvpn]: Users
ShortLegend[local_openvpn]:
LegendO[local_openvpn]: VPN Users:
Legend2[local_openvpn]: VPN Users

PageTop[local_openvpn]: Users Logged to The VPN
WithPeak[local_openvpn]:wmy
Legend4[local_openvpn]: Max number of users on the VPN






Labels: , , , , , ,

Friday, November 20, 2015

Monit: Apache returns "Execution Failed" status

Got a gig to administer a couple of servers on the Google Cloud Platform the other day.
So I got a few Ubuntu Servers 14.04 up & running and installed all the crap I usually need/ run on the boxes I get my hands on...

Now, after setting up Monit a bit, and starting it up, I've noticed that the Apache process was in problems.
No matter what I did, I got the same status... In the end, the problem was really, really stupid to fix...

Check the path to the pid file on the /etc/monit/conf.d/apache2 file:
Change the pid from /var/run/apache2.pid to /var/run/apache2/apache2.pid and restart the Monit service.
Of course, you already have copied the file /etc/monit/monitrc.d/apache2 to /etc/monit/conf.d/apache2, right?

Labels: , , , , , , , ,

Friday, December 12, 2014

Help: Munin thinks it has nothing to do

So, setting up a centOS server, and getting Munin up & running.
No big deal, it should be done && done in less than 5 minutes nowadays, specially if it will be graphing only itself.
But, after the install (thru the EPEL repo) and starting the service, you access the page, and instead aof getting grafancy graphics, all you see is a lousy list of the files.
And then you start getting problem report emails that look like this:

[FATAL] There is nothing to do here, since there are no nodes with any plugins.\
Please refer to http://munin-monitoring.org/wiki/FAQ_no_graphs at\
 /usr/share/munin/munin-html line 40


Those come from the cronjob that actually runs Munin.
If you look on the file /var/log/munin/munin-update.log, you'll find something like this:

2014/12/11 04:25:01 [INFO]: Starting munin-update
2014/12/11 04:25:01 [INFO] starting work in 1101 for localhost/127.0.0.1:4949.
2014/12/11 04:25:01 Failed to connect to node 127.0.0.1:4949/tcp : Connection refused
2014/12/11 04:25:01 [ERROR] Munin::Master::UpdateWorker failed to connect to node
2014/12/11 04:25:01 [INFO] Reaping Munin::Master::UpdateWorker.  Exit value/signal: 20/0
2014/12/11 04:25:01 [INFO] No old data available for failed worker localhost;localhost.  This node will disappear from the html web page hierarchy
2014/12/11 04:25:01 [INFO]: Munin-update finished (0.02 sec)


The workaround?
Edit the file /etc/munin/munin.conf from this:

# a simple host tree
[localhost]
    address 127.0.0.1
    use_node_name yes

to this:

# a simple host tree
[localhost.localdomain]
    address 127.0.0.1
    use_node_name yes


And then restart the service:

sudo /etc/init.d/munin-node restart


Labels: , , , , ,

Monday, December 06, 2010

(Quick) Nagios setup

A quick & dirty "guide" to get Nagios monitoring on a local Linux server in no time. This has been done on CentOS, but the same applies to just about any other distro, as long as you take care of the paths to the configuration files.

cp template.HOSTNAME.FQDN.cfg $HOSTNAME.cfg
emacs $HOSTNAME.cfg

Meta X replace-regex HOSTNAME host
Meta X replace-regex $HOSTNAME.FQDN $HOSTNAME

Section "define host":
Replace "Description here" with the real data
Replace "ip.address.here" with the real IP address of the host

Section "define contact":
Replace "Description here" with the real data, a concise description.
email Replace with the real email addresses of the contacts, or the contact that should receive notifications from this server.

Section "define contactgroup":
Replace "Description here" with the real data of the Linux server.
Be sure to add more services to suit your needs, or the needs of the monitored server.
Copy the file to the Nagios directory:

sudo cp $HOSTNAME.cfg /etc/nagios/objects/


Edit the commands file:

sudo emacs /etc/nagios/objects/commands.cfg


Specifically, edit the strings "***** Nagios *****" on 'notify-host-by-email' & 'notify-service-by-email' to something that identifies the box from which the emails are coming from.
I usually leave like this:

** Nagios $HOSTNAME **

Edit Nagio's master configuration file, so it uses the cfg file just created, and discard the default localhost.cfg one.

sudo emacs /etc/nagios/nagios.cfg

Comment the line:

cfg_file=/etc/nagios/objects/localhost.cfg

And add a line with the cfg file just created.

cfg_file=/etc/nagios/objects/$HOSTNAME.cfg

Before launching Nagios, tight a bit the web access:

sudo emacs /etc/httpd/conf.d/nagios.conf

And setup basic security (enable SSL, setup the password protection, limit IP range, etc).

Test it

sudo /usr/bin/nagios -v /etc/nagios/nagios.cfg

And if its OK, launch it.

Here is a copy of "template.HOSTNAME.FQDN.cfg":

## -----------------------------------------------

## History

## -----------------------------------------------

## sudo /usr/bin/nagios -v /etc/nagios/nagios.cfg

define host{
name HOSTNAME-host
use generic-host
check_period 24x7
check_interval 5
retry_interval 1
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 120
notification_options d,u,r
contact_groups HOSTNAME-contactgroup
register 0
}

define host{
use HOSTNAME-host
host_name HOSTNAME.FQDN
alias Description here
address ip.address.here
}

define contact{
contact_name HOSTNAME-contact
use generic-contact
alias Description here
email 1@email.com, 2@email.com, 3@email.com
}

define contactgroup{
contactgroup_name HOSTNAME-contactgroup
alias Description here
members HOSTNAME-contact
}

# SERVICE DEFINITIONS

define service{
name HOSTNAME-generic-service
active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 5
retry_check_interval 2
contact_groups HOSTNAME-contactgroup
notification_options w,u,c,r
notification_interval 120
notification_period 24x7
register 0
}

define service{
name HOSTNAME-service
use HOSTNAME-generic-service
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
register 0
}

define service{
use HOSTNAME-service
host_name HOSTNAME.FQDN
service_description Connectivity
check_command check_ping!100.0,20%!500.0,60%
}

# Define a service to check the disk space of the root partition
# on the local machine. Warning if < 20% free, critical if
# < 10% free space on partition.

define service{
use HOSTNAME-service
host_name HOSTNAME.FQDN
service_description Partition /
check_command check_local_disk!20%!10%!/
}

define service{
use HOSTNAME-service
host_name HOSTNAME.FQDN
service_description Partition /boot
check_command check_local_disk!20%!10%!/boot
}

# Define a service to check the number of currently logged in
# users on the local machine. Warning if > 20 users, critical
# if > 50 users.

define service{
use HOSTNAME-service
host_name HOSTNAME.FQDN
service_description Current Users
check_command check_local_users!20!50
}

# Define a service to check the number of currently running procs
# on the local machine. Warning if > 250 processes, critical if
# > 400 users.

define service{
use HOSTNAME-service
host_name HOSTNAME.FQDN
service_description Total Processes
check_command check_local_procs!250!400!RSZDT
}

define service{
use HOSTNAME-service
host_name HOSTNAME.FQDN
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}

define service{
use HOSTNAME-service
host_name HOSTNAME.FQDN
service_description Swap Usage
check_command check_local_swap!20!10
}

define service{
use HOSTNAME-service
host_name HOSTNAME.FQDN
service_description Service SSH
check_command check_ssh
}

define service{
use HOSTNAME-service
host_name HOSTNAME.FQDN
service_description Service HTTP
check_command check_http
}

# EoF #

Labels: , , , ,

Friday, July 16, 2010

MRTG: Reload Ok file on Ubuntu Server

I had a problem with an MRTG server while graphing the interface use on a Cisco 2600 & another 2800 router, out of the blue, the MRTG started to graph a completely pegged interface, and printing errors such as this when "executed by hand" from the CLI:

WARNING: Can not determine ifNumber for xxxx@XXX.XXX.XXX.XXX: ref: 'Name' key: 'Et0/0'
WARNING: Can not determine ifNumber for xxxx@XXX.XXX.XXX.XXX: ref: 'Name' key: 'Se0/0'
WARNING: Can not determine ifNumber for xxxx@XXX.XXX.XXX.XXX: ref: 'Name' key: 'Se0/0.240'
ERROR: Target[XXX.XXX.XXX.XXX_et0_0][_IN_] ' $target->[1]{$mode} ' did not eval into defined data
ERROR: Target[XXX.XXX.XXX.XXX_et0_0][_OUT_] ' $target->[1]{$mode} ' did not eval into defined data
ERROR: Target[XXX.XXX.XXX.XXX_se0_0][_IN_] ' $target->[2]{$mode} ' did not eval into defined data
ERROR: Target[XXX.XXX.XXX.XXX_se0_0][_OUT_] ' $target->[2]{$mode} ' did not eval into defined data
ERROR: Target[XXX.XXX.XXX.XXX_se0_0.240][_IN_] ' $target->[3]{$mode} ' did not eval into defined data
ERROR: Target[XXX.XXX.XXX.XXX_se0_0.240][_OUT_] ' $target->[3]{$mode} ' did not eval into defined data

After Googling for a while the error message, all the references pointed towards of "getting rid of the '*.ok' files", but since I had none of those on my system that I could tell, what I did was renaming the file for that particular device on the directory defined on the directive 'ThreshDir':

sudo mv /var/lib/mrtg/_etc_mrtg_cfgs_xxxxxx.+++++++++.cfg /var/lib/mrtg/_etc_mrtg_cfgs_xxxxxx.+++++++++.cfg.OLD

After that, it started to work A Ok once again...

The files did actually changed, the original looked like this:

xxxx@XXX.XXX.XXX.XXX_ Descr Ethernet0/0 1
xxxx@XXX.XXX.XXX.XXX_ Descr Null0 3
xxxx@XXX.XXX.XXX.XXX_ Descr Serial0/0 2
xxxx@XXX.XXX.XXX.XXX_ Descr Serial0/0.240 4
xxxx@XXX.XXX.XXX.XXX_ Ip XXX.XXX.XXX.XXX 1
xxxx@XXX.XXX.XXX.XXX_ Name Et0/0
xxxx@XXX.XXX.XXX.XXX_ Name Nu0 3
xxxx@XXX.XXX.XXX.XXX_ Name Se0/0
xxxx@XXX.XXX.XXX.XXX_ Name Se0/0.240
xxxx@XXX.XXX.XXX.XXX_ Type 32 2
xxxx@XXX.XXX.XXX.XXX_ Type 6 1

While the new one, automagically generated right after the first MRTG run, looks like this:

xxxx@XXX.XXX.XXX.XXX_ Descr Ethernet0/0 1
xxxx@XXX.XXX.XXX.XXX_ Descr Null0 3
xxxx@XXX.XXX.XXX.XXX_ Descr Serial0/0 2
xxxx@XXX.XXX.XXX.XXX_ Descr Serial0/0.240 4
xxxx@XXX.XXX.XXX.XXX_ Eth Dup
xxxx@XXX.XXX.XXX.XXX_ Eth xx-xx-x-x-x-x-x-x-x-x-x-x-x-x 1
xxxx@XXX.XXX.XXX.XXX_ Ip XXX.XXX.XXX.XXX 1
xxxx@XXX.XXX.XXX.XXX_ Ip 10.16.254.22 4
xxxx@XXX.XXX.XXX.XXX_ Name Et0/0 1
xxxx@XXX.XXX.XXX.XXX_ Name Nu0 3
xxxx@XXX.XXX.XXX.XXX_ Name Se0/0 2
xxxx@XXX.XXX.XXX.XXX_ Name Se0/0.240 4
xxxx@XXX.XXX.XXX.XXX_ Type 1 3
xxxx@XXX.XXX.XXX.XXX_ Type 32 Dup
xxxx@XXX.XXX.XXX.XXX_ Type 6 1

Labels: , , , ,

Tuesday, March 16, 2010

Install MRTG on CentOS

Installed this morning on a remote server, it already had a basic setup of Apache up & running.

# rpm --test -ivh mrtg-2.14.5-2.i386.rpm
warning: mrtg-2.14.5-2.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
perl-Socket6 is needed by mrtg-2.14.5-2.i386
perl-IO-Socket-INET6 is needed by mrtg-2.14.5-2.i386
# rpm --test -ivh mrtg-2.14.5-2.i386.rpm perl-Socket6-0.19-3.fc6.i386.rpm perl-IO-Socket-INET6-2.51-2.fc6.noarch.rpm
warning: mrtg-2.14.5-2.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]

Labels: , , , , ,

Wednesday, December 02, 2009

Ubuntu: Logwatch & RootKit Hunter on a workstation

On all my Linux servers I get a daily Logwatch report, so, since I'm using my Ubuntu laptops almost on a 24x7 basis, I would like to know what I have done in the past 24hrs, and how their are performing, so I have installed Logwatch on Karmic, but, since I don want to install and configure a lot of stuff, I have installed ssmtp as well, so the box can send emails without problems and without configuring a full blown MTA.

So here it goes.

$ sudo aptitude install ssmtp rkhunter logwatch

As usual, the logwatch needs a couple thing to get it up & working normally...
Create the missing directory:

$ sudo mkdir /var/cache/logwatch

And copy the default installation configuration file to its correct directory:

$ sudo cp /usr/share/logwatch/default.conf/logwatch.conf /etc/logwatch/conf/

And then edit the file '/etc/logwatch/conf/logwatch.conf', for the moment, the options that needs to be enabled are these:

Output = email
Detail = High


Later on, when everything is setup correctly and working, there is one last thing to edit on the configuration file, if you want to, and that is the detail, the amount of data that it will send on its daily reports; but for the moment, it is good enough to leave it with the default settings, so the test emails (and the CPU involved to create those reports) it is not wasted.

Then, onto the ssmtp stuff... Copy the original, and then edit the configuration file:

sudo cp /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.ORIG
sudo emacs /etc/ssmtp/ssmtp.conf


This file is super easy to configure, basically needs five configuration options, refer to this setup guide, Sending Email From Your System with sSMTP, you'll be sending emails with ssmtp in a jiffy.


EDIT:
January 29th 2010

Changed the Detail to High, it was on Low, the default.
Added a cp to the command:
sudo /etc/ssmtp/ssmtp.conf /etc/ssmtp/ssmtp.conf.ORIG

Labels: , , , , , ,

Tuesday, October 27, 2009

/dev/mapper/VolGroup00-LogVol00 & MRTG


A little script, edited from the original which I found on the internet many years ago, in order to graph HDD used space when you are using LVM


#!/bin/sh

PATH=/bin:/usr/bin

# The available HDD space as "incoming"

## Avai
df /dev/mapper/VolGroup00-LogVol00 | tail -1 | awk '{print $3}'
## Used
df /dev/mapper/VolGroup00-LogVol00 | tail -1 | awk '{print $2}'
uptime | cut -d, -f 1 | awk '{print $3, $4}'
echo $df | awk '{print $1}'

# EoF #

And the mrtg.cfg snip using the script:

Target[df-root]: `mrtg-df-local.sh`
Options[df-root]: nopercent,nobanner,nolegend,noinfo,integer,gauge
kmg[df-root]:kB,MB,GB
Title[df-root]: Disk use for / partition
PageTop[df-root]: Disk use /
YLegend[df-root]: 1k blocks
ShortLegend[df-root]:  
LegendI[df-root]: avail 
LegendO[df-root]: used 

Labels: , ,

Saturday, December 27, 2008

The summer of pings


Lately being rather lazy, not much to do about work, the holidays are an effing blessing, and we didn't have any emergency so far, once again, we are living another period of non hostility and I still can hear the pings reply.

The weather, ITOH, has been a bitch, luckily, come Monday night, I'm off on vacation.
The summer, the real one, the one on the calendar, has started 6 days ago, and everything points toward a fucking beast of a summer.

Labels: , , ,

Monday, November 24, 2008

Nagios install on CentOS 5

There are a ton of sites/ HOWTOs, examples out there, this is just a reminder of the damn RPM necessary packages to get the Nagios up & running in no time on a CentOS 5 boxen.
All the packages (that can not be installed via yum) are from DAG

fping is the only dependency that has not other one but itself, and perl(Net::SNMP) is the one that has all the other ones.
After the install, Nagios' configuration files will be on '/etc/nagios/' (with a ready made minimalist configuration on the file 'localhost.cfg') and the check plugins will reside on '/usr/lib/nagios/plugins/'.

There will be also the web access configuration file on '/etc/httpd/conf.d/mrtg.conf'.
The Nagios RPM sets itself to start automagically on RunLevels 3,4,5.


# rpm --test -ivh fping-2.4-1.b2.2.el5.rf.i386.rpm
warning: fping-2.4-1.b2.2.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing... ########################################### [100%]

# rpm --test -ivh nagios-2.9-1.el5.rf.i386.rpm
warning: nagios-2.9-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
error: Failed dependencies:
libltdl.so.3 is needed by nagios-2.9-1.el5.rf.i386

[root@ltfs351 nagios]# rpm --test -ivh nagios-2.9-1.el5.rf.i386.rpm libtool-libs-1.5.6-4.EL4.2.i386.rpm
warning: nagios-2.9-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
warning: libtool-libs-1.5.6-4.EL4.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]

[root@ltfs351 nagios]# rpm -ivh nagios-2.9-1.el5.rf.i386.rpm libtool-libs-1.5.6-4.EL4.2.i386.rpm
warning: nagios-2.9-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
warning: libtool-libs-1.5.6-4.EL4.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID db42a60e
Preparing... ########################################### [100%]
1:libtool-libs ########################################### [ 50%]
2:nagios ########################################### [100%]

# rpm --test -ivh nagios-plugins-1.4.9-1.el5.rf.i386.rpm
warning: nagios-plugins-1.4.9-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
error: Failed dependencies:
perl(Net::SNMP) is needed by nagios-plugins-1.4.9-1.el5.rf.i386

# rpm --test -ivh nagios-plugins-1.4.9-1.el5.rf.i386.rpm perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch.rpm
warning: nagios-plugins-1.4.9-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
error: Failed dependencies:
perl(Crypt::DES) is needed by perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch
perl(Digest::HMAC) is needed by perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch
perl(Digest::SHA1) is needed by perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch

# rpm --test -ivh nagios-plugins-1.4.9-1.el5.rf.i386.rpm perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch.rpm \
perl-Crypt-DES-2.05-3.2.el5.rf.i386.rpm perl-Digest-HMAC-1.01-2.rf.0.rh7.rf.noarch.rpm \
perl-Digest-SHA1-2.11-1.el5.rf.i386.rpm
warning: nagios-plugins-1.4.9-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing... ########################################### [100%]

# rpm -ivh nagios-plugins-1.4.9-1.el5.rf.i386.rpm perl-Net-SNMP-5.2.0-1.2.el5.rf.noarch.rpm \
perl-Crypt-DES-2.05-3.2.el5.rf.i386.rpm perl-Digest-HMAC-1.01-2.rf.0.rh7.rf.noarch.rpm \
perl-Digest-SHA1-2.11-1.el5.rf.i386.rpm
warning: nagios-plugins-1.4.9-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing... ########################################### [100%]
1:perl-Digest-SHA1 ########################################### [ 20%]
2:perl-Digest-HMAC ########################################### [ 40%]
3:perl-Crypt-DES ########################################### [ 60%]
4:perl-Net-SNMP ########################################### [ 80%]
5:nagios-plugins ########################################### [100%]

Labels: , , , ,

Wednesday, November 12, 2008

Forced to use the Window


Today I had to use Windows.

Yes, I was forced to, just like that... And the worst of the whole thing is that it was to use a web app, from a GPL project.

Had to make some changes on one of the Zabbix servers from work and, to begin with, using Os X' Safari I was unable to login, it simply did not work, don't know what might have been the problem, but it was impossible to do accomplish that.

So I moved to Tango, to give it a shot, and test it with Ubuntu and Firefox, I was able to login without any problem, but, it was of no use, since the buttons showed no words at all, you had to guess what was the purpose of each one, or had a lot of memory.

Labels: , , , , , ,

Thursday, September 04, 2008

Outlook: color coding emails

Most of the work emails I get are from other machines, and many, many of those are from a Nagios instance running on some Linux box somewhere.
So, I can easily predict what an email from a given machine, reporting such and such thing, would look like.
On all my boxes I had my email client with some sort of color coding setup to differentiate emails from difference importance, origin, etc, etc.

I did the same on the Outlook 2002 I have on my Vista laptop Tango, I can't believe how complicated the whole thing is on Outlook, I mean, for such a stupid thing as adding color based on the sender or a keyword on the subject...
I'll post the screen shots here, in case I have to do this again with more rules, or to edit the current colors.

Go to 'View' -> 'Current View' -> 'Customize'




Click on 'Add', set a name for the rule, and the click on 'Condition' to set the email address or the keyword to set the color of the email.

Labels: , ,

Wednesday, July 09, 2008

A Quad-Core beast

A stack of CPU crunching...
A screenshot of a new server at work, (actually, it is a screenshot of a couple of PuTTY terminal emulators connected to it, thru SSH :D ), I have never saw such a beast before... A 2 x Quad-Core Xeon, with 8 GB RAM.

Take a look at the stack of CPUs on the top & and on the htop window!!

Labels: , , , ,

Saturday, June 14, 2008

Weather geek nirvana



Last night I found a new service that the local weather forecast agency if offering, they call it Estación Meteorológica EMA ORTUZAR

It seems they bought a new toy to play with: a Davis Instruments Vantage Pro2 weather station.

The page has a ton of trend graphs, the only drawback, is that the trends are not that old, I wish they could offer a greater history on the trends; say a month and a year, to see the variations.

Labels: ,

Sunday, May 25, 2008

Mailgraph install on CentOS 5

Been with a lot of work this week, most of the time busy and pressured with our mail server migration, so, I took a bit of a time off from the box yesterday.

Mailgraph is a very cool utility to graph (duh !) the behavior of your mail server's ability to send, reject & bounce emails.

Installing it is pretty simple, it is a Perl script after all, simply untar the package and copy the Perl script and the init script, edit the some values of the init script, and you are done.
The thing is, the Perl script has some dependencies, most of them dealing with the RRD package.

Personally, I prefer not to touch the repos that the default yum install use on the servers, so here is a round down of the necessary steps to make the installation work, using all the packages from DAG.

[web10 rpms]# sudo rpm --test -ivh rrdtool-1.2.23-1.el5.rf.i386.rpm
warning: rrdtool-1.2.23-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
error: Failed dependencies:
libart_lgpl_2.so.2 is needed by rrdtool-1.2.23-1.el5.rf.i386
perl(RRDp) is needed by rrdtool-1.2.23-1.el5.rf.i386
perl(RRDs) is needed by rrdtool-1.2.23-1.el5.rf.i386


According to Egopoly, you need this packages first hand:

[web10 rpms]# sudo yum install libpng-devel \
freetype freetype-devel libart_lgpl-devel


After that, you'll still have problems (Egopoly seems to be compiling from source):

[web10 rpms]# sudo rpm --test -ivh rrdtool-1.2.23-1.el5.rf.i386.rpm
warning: rrdtool-1.2.23-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
error: Failed dependencies:
perl(RRDp) is needed by rrdtool-1.2.23-1.el5.rf.i386
perl(RRDs) is needed by rrdtool-1.2.23-1.el5.rf.i386


So, get Perl-RRDTool first:

[web10 rpms]# sudo rpm --test -ivh perl-rrdtool-1.2.23-1.el5.rf.i386.rpm
warning: perl-rrdtool-1.2.23-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
error: Failed dependencies:
librrd.so.2 is needed by perl-rrdtool-1.2.23-1.el5.rf.i386
rrdtool = 1.2.23 is needed by perl-rrdtool-1.2.23-1.el5.rf.i386


There is still a dependency problem, so, you'll have to install both packages at the same time:

rpm --test -ivh perl-rrdtool-1.2.23-1.el5.rf.i386.rpm \
rrdtool-1.2.23-1.el5.rf.i386.rpm rrdtool-devel-1.2.23-1.el5.rf.i386.rpm


You'll still need to install the last rpm package to get Mailgraph up & running:

[web10 rpms]# sudo rpm -ivh perl-File-Tail-0.99.3-1.2.el5.rf.noarch.rpm
warning: perl-File-Tail-0.99.3-1.2.el5.rf.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing... ########################################### [100%]
1:perl-File-Tail ########################################### [100%]

Labels: , , , ,

Friday, May 23, 2008

Monitoring HDD temperature with MRTG


I complain a lot about the weather in Bs As, so here is a little script to get the values inside a hard disk on a linux server... On the average, the temperature seems like a really, really torrid summer day around here, say towards the end of December.

In order to get this little script up & you'll need to have the hddtemp program, utility, installed.

The shell script, pretty, pretty simple:

#!/bin/sh

## mrtg-hddtemp.sh

PATH=/bin:/usr/bin:/usr/sbin
DISK='/dev/hdc'

uptime | cut -c 2-
hddtemp ${DISK} | awk '{print $4}'

# EoF #

And the snip from the mrtg.cfg file:

Target[local_hddtemp]: `/usr/local/etc/scripts/dataGathering/mrtg-hddtemp.sh`
Options[local_hddtemp]: nopercent,gauge,noinfo,nobanner,noi,nolegend
Title[local_hddtemp]: HDD temperature
PageTop[local_hddtemp]: HDD temperature
MaxBytes[local_hddtemp]: 100000
YLegend[local_hddtemp]: Degrees
ShortLegend[local_hddtemp]:  
LegendO[local_hddtemp]: Cent: 
Legend2[local_hddtemp]: HDD temperature
WithPeak[local_hddtemp]: wmy
Legend4[local_hddtemp]: Max HDD temperature

Labels: , , ,