Archive

Posts Tagged ‘monitor’

Automatically update iptables rules for Pingdom monitors.

March 14th, 2012 4 comments

Pingdom is an awesome service that tracks the uptime, downtime, and performance of websites (you can see an example of the public stats of this server here). If you have a firewall running on your system, you need to whitelist Pingdom’s servers or else their monitors will fail. As their servers may change at any given time, it is better to automate this whitelisting by realistically and responsibly polling the RSS feed of their monitoring servers.

It’s been done before, but this is how I have chosen to do it.

First, a little php helper script to extract the Active IP addresses of the monitors. For this example, let’s save it as pingdom.com.php alongside our bash script which will be executed by cron.

preg_match_all(
    '/((\d+\.){3}\d+).*?Active/',
    file_get_contents('https://www.pingdom.com/rss/probe_servers.xml'),
    $ips
);

echo implode("\n", $ips[1]);

Then, our bash script which is called from cron:

for ip in $(/usr/bin/php pingdom.com.php); do
    $IPTABLES -A INPUT -s $ip -p icmp -j ACCEPT
done

Of course, this is just an example and you will need to modify the firewall rule(s) according to your needs.

Fedora 15 NVIDIA external Samsung SyncMaster… finally!

August 21st, 2011 3 comments

Ever since Fedora 15 came out, I couldn’t get my external monitor to work with my Lenovo W520 laptop which has an NVIDIA Quadro 1000M graphics adapter. I am using the proprietary driver and no matter what settings I would choose, I’d always get a nasty “Oops, something went wrong!” error message when logging in. I knew that there shouldn’t be a problem as I dual boot into Win7 and the external monitor was working fine.

Today I tried a few more combinations and finally got it working, most probably because I have chosen “TwinView” in the configuration, rather than “Separate X screen”. I also specified each screen’s resolution and refresh rates instead of leaving everything on “Auto”. Further settings include:

  • Screen 0: Absolute Position +0+0
  • Screen 0: Make this the primary display for the X screen
  • Screen 1: Position +1920+0 (where 1920 is the width of the laptop display)

My setup is perfect again.