Jun
4
Graph uptime for Linux devices via SNMP with Cacti
Sam Burney | Thu, 06/04/2009 - 02:37 | 800 comments
Cacti is a great tool for graphing your network load as well as a whole bunch of other data from SNMP enabled devices. One glaring ommision however is the ability to graph the uptime of your devices.
Cacti allows you to make custom data/graph templates that allow you to graph pretty much any data your heart desire, as long as you have a data source of some kind. I found a tutorial Andrew McMillan which described exactly what I was after - how to graph the uptime of a Linux device via SNMP, but as it's not exactly for the faint of heart I've decided to post my template definitions here so that if anyone else needs this they can get going in a matter of seconds.
Usage:
1. Download cacti_graph_template_ucdnet_-_uptime.xml
2. Logged into you Cacti console, click 'Import Templates'
3. Click browse, locate the graph template you just downloaded, then click save
4. Add a graph for 'ucd/net Uptime' to your devices as needed
Easy!
Apr
3
sifnt Modal - jQuery Port
Sam Burney | Thu, 04/02/2009 - 23:58 | 222 comments
I think the thing I enjoy most about computers is learning new things; finding new, better and/or more efficient ways of performing a task. In order to do this, I will often look for new ideas to implement when beginning even a boring mundane project to make it more challenging and to ensure I come out of the other end having learnt something new.
With one (Of the many) projects I'm working on at the moment I've decided to use it as a chance to learn the jQuery JavaScript library, which seems pretty neat so far. One of the dependancies of this project is sifnt Modal which of course was written with the Prototype library in mind, so a port of that was needed before I could even start!
Jan
6
YC09 Photos
Sam Burney | Tue, 01/06/2009 - 11:34 | 563 comments
My YC09 (Youth Conference '09, Sydney) photos are up in the gallery (almost) as they happen.
Enjoy!
http://www.sifnt.net.au/gallery2/v/Christadelphian+Events/YC09+Sydney/
Dec
2
Regular Expression to match a Windows (Local and UNC) or UNIX Path
Sam Burney | Tue, 12/02/2008 - 11:23
I've been looking for a regular expression (regex) to get a path, file name and extension from a full UNIX path for a small app I'm working on but could only come across Windows ones.
For anyone looking, here I've come up with what I was looking for: A regular expression to match a Windows (Both UNC and Local paths) or UNIX paths as well as breaking that path into it's relavant segments all in one go.
Regular Expression:
^(.*?/|.*?\\)?([^\./|^\.\\]+)(?:\.([^\\]*)|)$
PHP Function Example:
// Split filepath path, name and extension
function namesplit($path)
{
preg_match('@^(.*?/|.*?\\\\)?([^\./|^\.\\\\]+)(?:\.([^\\\\]*)|)$@', $path, $namesplit);
return $namesplit;
}
Output Example:
Array ( [0] => /path/to/file/filename.ext [1] => /path/to/file/ [2] => filename [3] => ext )
I hope this saves someone some time!
Nov
14
A Working BluePhoneElite2 / iSync Sync-When-in-BlueTooth-Range AppleScript
Sam Burney | Fri, 11/14/2008 - 05:50 | 761 comments
I love integration, the ability to have one device do a million different things, like the Nokia E71 (Another story ;)). I also love to have the ability to have the same information available on all of my different devices (Laptop, Desktop, Mobile phone(s), etc...).
When I was using Windows on my main computer, I used Nokia's PC Suite to synchronise my calendars and contacts with my phone via bluetooth. One of the great things about Nokia's sync tool is that it can automatically sync on a regular intervalof your choosing, or even sync when it detected your phone within range.
When I moved to Mac OS it felt like a breath of fresh air. The iSync plugin for my phone was tiny and simple to install, bluetooth no longer freaking crashed all the time and the Apple Address Book/iCal combination kicks Outlook's ugly butt.
All this was great, but for whatever silly reason Apple neglected to include the ability to syncronise your devices on a schedule (iSync can do it for MobileMe, but not devices).
Another application I use is BluePhoneElite, and it you own a Nokia S60 phone and a Mac with bluetooth I seriously recommend you give it a go, it's an amazing piece of software. BluePhoneElite can, among other things, do 'stuff' when it detects a phone come into range, it even includes an example AppleScript to do exactly what I'm after, force an iSync device synchronisation when it detects a phone come into rang, but it doesn't work!
After a bit of playing around with the two supplied AppleScripts and quite a lot of Googling I came up with a working script
BluePhoneElite / iSync AppleScript
Links: Download
Instructions:
- Download to your computer
- In BluePhoneElite, add in 'In Range' handler and specify this AppleScript
Once installed, every time your phone comes into range this AppleScript will be run. The script checks to see if your phone has been synchronised in the last 2 hours (This is configurable), and if not it synchronises it immediately.
Updated 2/3/2009
I have updated the download link to contain a version that supports BPE2.1's AppleScript changes.