Thursday, July 31, 2008

Howto Link ilo2 Webinterface into Nagios

i needed to link my ilo2 webinterfaces into the Nagios Host Pages. As i got a bunch of servers i searched something to make this as simple as possible for me.

To ease the pain in of adding new servers, just add all your ilo2 controller to your dns domain. I added a CNAME Entry for every server like -ilo..tld

Now just create a hostextinfo file:

/usr/local/nagios/etc/hostextinfo_custom.cfg
# HP Server with ilo2 Controllers
define hostextinfo {
host_name server1,server2,server3,server4,serverX
notes <a href=https://$HOSTNAME$-ilo.mydomain.tld target=_blank style='text-decoration: underline'>$HOSTNAME$ -- ilo2 Webinterface</a>
icon_image hp.png
}

Now place something like: cfg_file hostextinfo_custom.cfg to your nagios.cfg to make sure it will be included on startup of the nagios daemon.

Now you will see a ilo2 Link in every Host View.

bohboh,
kratediggah

Tuesday, July 29, 2008

Change Server Name on ilo2 via SSH

it's pretty easy. Just connect to your ilo2 Controller via SSH.

Then just hit it like this:

hpiLO-> set /system1 oemhp_server_name=myFreshServer

and you will see something like this:

status=0
status_tag=COMMAND COMPLETED

Too make sure it worked out try this:

hpiLO-> show /system1 oemhp_server_name
status=0
status_tag=COMMAND COMPLETED


/system1
Properties
oemhp_server_name=myFreshServer
Verbs
cd version exit show set


hpiLO-> exit
status=0
status_tag=COMMAND COMPLETED

and you're finished.

BohBoh,
kratediggah

Monday, July 21, 2008

Firefox: Nagios Checker

I am using this since several weeks and it is a great plugin. Just try it out, it is great for getting nagios informations without being directly on the webinterface. It is developed by Peter Simek.

You can check it out here projects webpage or you can download the plugin here

bohboh,
kratediggah

Howto tell pound to log into its own logfile - pound.log

Ever wondered around why pound is logging into /var/log/syslog by default? I did. After some hours of searching around in the web for some solutions how to teach pound to log in its own logfile without finding anyhting, i needed to do some.

After some research i found the proper solution. My explanation will depend on a ubuntu 8.04 LTS Server.

Normally, sysklogd will overtake all messages from pound and will put them into syslog as anything with the facility 'daemon' goes in there by default. So first you need to change the LogFacility of pound as it is 'daemon' by default.

Just edit your /etc/pound.conf as follows:

#facility local0 is needed as sysklogd will
#seperate pound messages by this facility
LogFacility local0
LogLevel 3

And the change your /etc/syslog.conf

# log all (auth and such) to /var/log/syslog
# except messages with the facility local0 (pound)
#
*.*;auth,authpriv.none,local0.none -/var/log/syslog

# get the messages with the facility local0 and
# log them into the pound logfile
local0.* -/var/log/pound.log

The next step is to make sure that there is always a pound.log present. Therefore you need to modify the start script by adding a short conditional block into the top section of /etc/init.d/pound.

# Check if the pound.log exists, if not create one
if [ ! -e "/var/log/pound.log" ]
then
log_warning_msg "There is no pound.log, i'll create one"

touch /var/log/pound.log
chmod 0644 /var/log/pound.log
chown syslog:adm /var/log/pound.log
/etc/init.d/sysklogd reload > /dev/null
else
log_success_msg "pound.log was found"
/etc/init.d/sysklogd reload > /dev/null
fi

After you reloaded the sysklogd by /etc/init.d/sysklogd reload and restarted the pound, you should see the first log entries.

In my case the logfile increased to a size of more than 900 Mbyte after 24 hours, so don't forget to rotate the log. This could be done like this (/etc/logrotate.d/pound)

/var/log/pound.log {
daily
missingok
rotate 14
dateext
compress
notifempty
create 0644 syslog adm
postrotate
/etc/init.d/sysklogd reload > /dev/null
endscript
}

bohboh,
kratediggah

Teach firefox how to get back and what to select

I think it is pretty annoying, that clicking in the urlbar in firefox doesn't select anything by default. The next annoyance is that backspace won't bring you back the the previous page.

Every time i need to reinstall some of my systems i am searching around to get these fixed. Because of that I'll describe now how (makes it for me easier to find the answer next time ;-))

Type in the URL Bar in your Firefox: about:config (If you are using Firefox 3 you can click on the "I'll be careful, i promise!" to go on) and search for:

browser.urlbar.clickSelectsAll and set it to true - this will enable the Select on Click function

The next to change will be:
browser.backspace_action change it to 0

bohboh,
kratediggah

Tuesday, July 8, 2008

Amazing Sleeve Vinyl Heads

Today i heard about it at my favourite Radio Station about these so called "Vinyl Sleeve Heads". I like Jazz Liberatorz



Have a look at these (i mostly love the one with John Coltrane's Blue Train 2xLP) i found on another blog: http://yadogg.com/pictures/vinyl-sleeve-heads/


bohboh,
kratediggah

Bash: unrar several RAR Archives automatically

I recently had the case to unrar more than 100 .rar archives which all were password secured.

This one heleped me:
~$: find -type f -name '*.rar' -exec unrar -pPASSWORD x {} \;

Hope it will help you too.

bohboh,
kratediggah

Thursday, July 3, 2008

Nagios Plugin for Checking Cisco MPLS / HSRP States and IPs

This is my first self written plugin.

It will Check Cisco Routers (Active/Passive/HSRP) for Correct Active and Passive IP's and the Actual State of Components.

Download:

You can download it here.


This Script is capable to check MPLS Routers for their correct Ip's (Active / Passive) by querying them with SNMP and to compare this result with provided Ip's.
It is also possible to check for the Standby State of a Router.

Just see ./check_cisco_hsrp.sh -h for more Information.

Some Examples:

Check if the Active Router got a specific IP-Address

./check_cisco_hsrp.sh -H 10.35.10.250 -C public -m active 10.35.10.248
OK - Active Router Ip 10.35.10.248 is the correct ip (10.35.10.248)


Check if the Standby Router got the correct IP-Address

./check_cisco_hsrp.sh -H 10.35.10.250 -C public -m standby 10.35.10.249
OK - Standby Router Ip 10.35.10.249 is the correct ip (10.35.10.249)


Check if the Second (Standby) Router is in Standby State

./check_cisco_hsrp.sh -H 10.35.10.249 -C public -m state 5
OK - 10.35.10.249 is in HSRP State: standby

./check_cisco_hsrp.sh -H 10.35.10.248 -C public -m state 5
CRITICAL - 10.35.10.248 is in HSRP State: Active but should be Standby

HSRP States:
Standby = 5
Active = 6

Please let me know what you think about it. Please report bugs if you find some (i think so).

bohboh,
kratediggah