The next version of up.time will make it dramatically easier to share up.time information with other applications in your datacenter. Why is this important? IT Systems Monitoring is a small piece of the IT puzzle. To gain the most value from performance and availability information, you’ll need to be able to share information between systems and team members. Getting the right information to the right people or systems, at the right time, and in the right format is essential for building an effective monitoring platform. up.time has always been a great tool for sharing information, but has not been easy to extract information in a customized way to fit perfectly with your existing applications.
Enter the up.time API.
Over the next few up.time releases, we will be providing a complete RESTful API that will allow you to pull up.time data into other tools like dashboards, corporate portals, mobile apps, or any existing application. We are also planning to allow you to control the configuration of up.time from other applications. For example, you will be able to add and remove systems, adjust maintenance, and acknowledge service outages in an automated way, directly from other tools.
Take a look at a quick example below. Say I wanted a web page to display a chart showing the distribution of elements I’m monitoring by type.

up.time Data Displayed in a Google Bar Chart
Let’s start by listing out the elements that we’ve added to up.time using the GET command below:
GET https://win-dleith/api/v1/elements
This results in a json structure being returned with basic information about each element:
[
{
"description": "Default self-monitoring host",
"groupId": 1,
"hostname": "localhost",
"id": 1,
"isMonitored": true,
"monitors": [],
"name": "win-dleith",
"tags": [],
"type": "Server",
"typeName": "Server",
"typeOs": "Windows 7/Server 2008 R2",
"typeSubtype": "Windows",
"typeSubtypeName": "Microsoft Windows"
},
{
"description": null,
"groupId": 1,
"hostname": "10.1.52.1",
"id": 2,
"isMonitored": true,
"monitors": [], // hidden for ease
"name": "10.1.52.1",
"tags": [],
"type": "NetworkDevice",
"typeName": "Network Device",
"typeOs": "Ethernet Routing Switch",
"typeSubtype": "Switch",
"typeSubtypeName": "Switch"
}
]
In my case, I only have 2 elements added. If I wanted to reference a specific element, I would use the format GET https://win-dleith/api/v1/elements/1 for element ID 1.
Now let’s take this one step further. Here is a simple php page that will access the list of elements and summarize them by type. The result looks like this:

up.time Data Displayed in a php page
Here is the php source to produce this page using lib_curl to fetch the data:
<html>
<head><title>OS Summary</title></head>
<body>
<?php
// set some defaults for access control, change these to your up.time specifics
$apiHostname="win-dleith.rd.local";
$apiPort="9997";
$apiUsername="admin";
$apiPassword="admin";
// specify what API end point we would like
$apiRequest="/api/v1/elements";
// initialize our curl session
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://".$apiHostname.":".$apiPort.$apiRequest);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $apiUsername.":".$apiPassword);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
// fetch our list of elements
$res = curl_exec($ch);
if (curl_error($ch))
{
die( "Error Fetching Data => ".curl_error($ch) );
}
curl_close($ch);
// display elements using custom format
$j = json_decode ( $res );
$list = array( );
foreach( $j as $k )
{
$list["$k->hostname"] = $k->typeSubtype;
}
$summary = array_count_values($list);
?>
<h1>Operating System Summary</h1>
<table>
<tr><th>OS Type</th><th>Count</th></tr>
<?
foreach ( $summary as $k => $v )
{
print "\n<tr><td>".$k."</td><td>".$v."</td></tr>";
}
?>
</table></body></html>
This is just one quick example of harvesting up.time data and displaying it in a customized way. Using up.time’s API, you can completely manage and manipulate your data output anyway you want. Earlier in this blog I displayed the same info using a Google Charts Bar Chart, here is the javascript source that produced that example based on data that had already been fetched:
<html><head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart()
{
var data = google.visualization.arrayToDataTable(
[['OS Type', 'Count'],
['Windows', 122 ],
['Switch', 1],
['Linux', 72],
['Solaris', 1],
['VcenterServer',1],
['Netware',2],['VcenterHostSystem',7]]
);
var options = {title: 'OS Summary',hAxis: {title: 'OS Type', titleTextStyle: {color: 'red'}}};
var chart = new google.visualization.ColumnChart(document.getElementById('chart_div'));chart.draw(data, options);}
</script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="chart_div" style="width: 900px; height: 500px;"></div>
</body>
</html>
The API provides similar functions for listing Service Monitors and Element Groups which I’ve listed below.
Monitors
GET https://win-dleith/api/v1/monitors
[
{
"description": "mysql running on port 3308",
"elementId": 1,
"id": 5,
"isHidden": false,
"isHostCheck": false,
"isMonitored": true,
"name": "Default up.time data store",
"type": "MySQL (Basic Checks)"
},
{
"description": "apache running on port 9999",
"elementId": 1,
"id": 6,
"isHidden": false,
"isHostCheck": false,
"isMonitored": true,
"name": "Default up.time web server",
"type": "HTTP (Web Services)"
},
{
"description": "monitors the available space on the local file systems",
"elementId": 1,
"id": 7,
"isHidden": false,
"isHostCheck": false,
"isMonitored": true,
"name": "Default File System Capacity",
"type": "File System Capacity"
},
...
]
Groups
GET https://win-dleith/api/v1/groups
[
{
"description": "",
"elements": [], // hidden for ease
"groupId": null,
"id": 1,
"monitors": [], // hidden for ease
"name": "My Infrastructure"
},
{
"description": "",
"elements": [],
"groupId": 1,
"id": 2,
"monitors": [],
"name": "Discovered Virtual Machines"
},
{
"description": "",
"elements": [],
"groupId": 1,
"id": 3,
"monitors": [],
"name": "Discovered Hosts"
}
]
Without hesitation, this API integration into up.time is a very exciting enhancement and will provide much more flexibility for our users. Look out for this new feature in the coming months, and if you haven’t downloaded up.time yet, try it out for free today!
– Dave