Tuesday, June 30, 2009

Zabbix monitoring tips

Random Tips


  • The zabbix server comes with some great example graphs, copy these to your own templates and every host linked with the template will have them available to use as screens.
  • You can disable an item/trigger inherited from a template for just a single host by disabling it in the hosts view (not the template).
  • If you delete an item, triggers depending upon that item will automatically be deleted.
  • The multi-value graphs you can create under the graphs tab are way better than the 'simple
    graph' type available in the screens menu.
  • You can automatically add hosts discovered through automatic discovery to templates (and do many other things) using actions under the actions tab.

Errors


I got the following error from the zabbix agent daemon (zabbix_agentd):

Can't find shared memory for collector

Restarting didn't help, but deleting the shared memory objects did:

ipcs -ma to list the objects
ipcrm to delete the objects owned by the zabbix user

Restarting the zabbix daemon and killing off the defunct processes got me back into business.

Tuesday, June 23, 2009

Creating new server certificates with an existing CA

Creating new server certificates with an existing CA, using unencrypted server keys so you don't get prompted when apache starts:
openssl req -new -config openssl.cnf -nodes -keyout newkey.pem -out newreq.pem -days 1825
openssl ca -config openssl.cnf -policy policy_anything -out newcert.pem -infiles newreq.pem

Wednesday, June 3, 2009

Firefox XUL dialog box transparent by default

This took far too long to figure out. I was opening a dialog in XUL in my firefox plugin, but it was arriving with a transparent background, which made it render really weirdly. The solution is to put the following in your css for the dialog tag:

background-color: menu !important;
opacity: 1.0;

My guess is that the background is transparent so you can see images set by firefox themes/skins, but it is pretty annoying!

Friday, May 15, 2009

HOWTO Convert a windows vmware image to a linux qemu/kvm

This is a good HOWTO for converting windows vmware images to linux Kernel Virtual Machines (KVMs). Note that if you don't have a single monolithic vmdk disk file, you can just run qemu-img over each individual file, converting it to raw, then cat them together in order. I tried this and it worked a treat:

for i in $( ls *.vmdk ); do qemu-img convert -O raw $i ~/$i.dd; done
cat s001.vmdk.dd s002.vmdk.dd s003.vmdk.dd > monolithic_image.dd

Monday, May 11, 2009

Verify ssl certificates and keys

The following openssl commands are handy for verifying/inspecting/converting keys/certificates and inspecting CRLs:

# Check a private key
openssl rsa -in /etc/apache2/ssl/server.key -check -noout -text

# Verify this cert against this CA list
openssl verify -verbose -purpose sslserver -CAfile /etc/ssl/cacert.pem /etc/apache2/ssl/server.pem

# Display cert details
openssl x509 -in /var/cert.pem -text -noout

# What purposes does this cert have?
openssl x509 -in mycert.pem -purpose

# Connect to a server and show the certs
openssl s_client -debug -connect localhost:443 -showcerts

# Inspect a CRL
openssl crl -inform DER -in blah.crl -text -noout

# Convert DER (.crt .cert .der) to PEM
openssl x509 -inform der -in cert.cer -out cert.pem

# Inspect DER without converting
openssl x509 -inform der -in cert.cer -noout -text

All calls on Samsung F480 appearing as "unknown" number

My phone wasn't displaying any numbers when I received a call - even though I had corresponding entries in the phonebook. For the benefit of others googling for a solution to this problem: it isn't your phone. It doesn't matter if your contacts are in the phone or in the sim. Most likely you need to call your provider and make sure caller id forwarding is enabled on your service. This can happen when you change providers or start a new service.

Sunday, May 10, 2009

Convert epoch timestamp (seconds since 1970) on the command line

Use this to convert epoch timestamp (seconds since 1970) on the command line. For some reason the man page doesn't reveal this secret:

date -d @1241958464
If you have the epoch seconds in hex, use this on linux:
echo $((0x4f91d6f8)) | xargs -I## date -d @##
The same thing is much easier on OS X:
date -r 0x4f91d6f8