Category Archives: Linux - Page 14

Compiling NRPE and nagios-plugins for Solaris 11.2

I have some Solaris 11.2 storage servers which run a number of ZFS pools, I wanted to monitor these through NRPE via Nagios. To do this I needed to compile NRPE and nagios-plugins from source, this article covers how this was done.

Read more »

How to use the hosts file to fake DNS

The hosts file is stored on a computer or device to provide local entries for DNS lookup. Normally when you try to resolve a hostname or domain, your computer will consult your specified DNS server to discover the IP address that it points to. This requires that there is an existing DNS server out there with the record that you require, with the hosts file you can fake DNS entries that will resolve only on the local machine.

Why would you want to do this? It’s great for testing or troubleshooting. You may want to use a specific hostname that no DNS exists for, though ideally you should create DNS records where possible as they can be centrally managed. It can help you get around DNS propagation issues, for example if a DNS record has been updated but had a TTL of 24 hours you may have to wait up to this long (assuming the cache cannot be cleared) before the record will resolve to the new IP address. By adding a temporary host file entry you can resolve to the new IP address straight away as the hosts file takes precedence over external DNS.

Read more »

How to “ping” a port

Most of us would be familiar with the simple ICMP based ‘ping’ command which allows us to test for a basic response from some network connected device. While great for basic troubleshooting it does not allow us to confirm if the particular host at the other end is responding on TCP or UDP ports where the majority of services are likely to be provided.

Ping isn’t the be all and end all of network troubleshooting, if a firewall blocks inbound ICMP traffic then a ping will not succeed which can produce a false perception that the host is down as it is not responding to the ping, however other services could still be responding fine.

Alternatively while ping may come back fine with a response it doesn’t indicate if a web server is responding on port 80 for HTTP requests, the web server may have failed and no longer be responding.

So if ping is ICMP based, can we hit a TCP or UDP port for response instead? The answer is yes, let’s take a look.

Read more »

How to fix template transfer in CloudStack

While trying to transfer templates within Citrix CloudPlatform (Apache CloudStack) between different zones I received the below error:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

This post covers how to fix this.

Read more »

How to test network connectivity with telnet

This post is a follow on from my post last week regarding how to install the telnet client. The telnet client is simple yet extremely powerful in helping us gain a quick idea of where a problem may lie with TCP connectivity, it’s one of my first go to tools to use when testing a network connection to a server.

Read more »

Monitoring multiple back end Nagios/Icinga servers with Thruk

Thruk acts as a central web interface allowing you to monitor multiple backends such as Naemon, Nagios, Icinga and Shinken via the Livestatus API. I had some difficulty getting it connecting to my back end servers so here are the steps I took to get it done. By the end of this guide you should be able to add your back end monitoring servers into Thruk, we’ll cover adding an Icinga server in this instance however the steps will be very similar for a Nagios server, given Icinga is a Nagios port.

Read more »

Linux Server Maintenance Checklist

Server maintenance needs to be performed regularly in order to ensure that your server will continue to run with minimal problems, while a lot of maintenance tasks are automated within the Linux operating system now there are still things that need to be checked and monitored regularly to ensure that Linux is running optimally. Below are steps that should be taken in order to maintain your servers.

Read more »

Raspberry Pi Heat Sinks – Temperature before and after

Raspberry Pi Heat Sinks

Raspberry Pi heat sinks – are these needed to keep things cool and running optimally or overkill? Two years ago I purchased a small 3 piece set of copper heat sinks from Ebay for my Raspberry Pi, I was intending to compare the temperature differences with and without them. This was inspired from the testing I did in my Raspberry Pi overclocking benchmarks however I just never got around to putting the heat sinks to use – until now!

Read more »

Virtual machine not powering on in Citrix XenServer 6.2

Today I connected to a CentOS 6 server via SSH and quickly noticed that the file system was in read only mode, after checking a few other Linux servers on the same XenServer host it quickly became apparent that there had been a network issue between the storage and compute layers which caused the Linux file systems to go read only in order to protect themselves.

After not being able to do anything useful within the operating system such as remounting the file system as read/write, I decided that it was time to reboot and force a file system check to pick up and fix any problems, however once the server had shut down it did not power back on as part of the restart task, it also did not power back on when attempting to start it up. This only happened to one VM, all of the others powered back on fine and worked as expected.

Read more »

Monitoring devices by sending syslog to OSSEC

Lately I’ve been working a lot with OSSEC, which is an open source host-based intrusion detection system (HIDS). This has primarily involved installing Linux or Windows based agents onto servers and configuring them to point to the OSSEC server, a process which is straight forward and fairly well documented. Unfortunately you aren’t going to be able to run an agent on some devices, such as those provided by Cisco or Juniper, so we instead have to look towards agentless or syslog monitoring.

Read more »