ec2-54-162-166-214.compute-1.amazonaws.com (54.162.166.214) Register or Sign In


Forgot password?
 

/// API usage

×DEMO MODE: You are not signed in. However all the features can be used - with only few limitations (check interval, ping only). Sign In or Register to get the full set of features. It's free!

There is an API in place you can use for automatic info gathering. We are continuosly increasing amount of data available via API.

/// Anonymous requests

Information about hosts set as publicly visible is accessible via anonymous api request. Simple put hostid as a parameter and you can get json formatted answer:

http://www.nsmon.com/api?hostid=500aa2a3569d88a171000001

Every server has its own API HostId and can be found on every info page for each server - e.g. here

A simple PHP client implementation could be like this:

// construct url
$url = "http://www.nsmon.com/api?hostid=500aa2a3569d88a171000001";

// get the response
$json = file_get_contents($url);

/// Authenticated requests

To get more sensitive information (like user details or non-public servers info) you must be authenticated to get a valid answer. You have to have a pair of your API ID and API SECRET key and every such a request has to be signed by this key. Let's explain using PHP example:

// fill out your api credentials
$id = "500aa2a35693498758403304";                 // your API ID taken from your profile page
$apisecret = "123456789012345678901234567890";    // your API SECRET taken from your profile page

// API URL
$apiurl = "http://www.nsmon.com/api";

// prepare our request
$data = array('hostid' => '500aa2a3569d88a171000001',
              'messages' => array('type' => 'host','severity' => 'warning')
             );


if ($id && $apisecret) {
// non-public requests must be signed

// API ID
  $data['id'] = $id;
// Valid time stamp must be a part of every signed request  
  $data['time'] = time();

// construct url
  $url = $apiurl. '?' . http_build_query($data);
// make a signature by API SECRET key
  $signature = hash_hmac('sha256', $url, $apisecret, false);
// and append it to the request
  $url  .= '&signature='.$signature;
}else{
// simple requests do not need api credentials
  $url = $apiurl. '?' . http_build_query($data);
}

// get the response
$json = file_get_contents($url);

// we can parse data
$output = json_decode($json,true);

// and print the data
print_r($output);

More to be added

/// Our Twitter Feed

Find out what's happening, right now, with the people and organizations you care about.

Visit link
Copyright © 2004 - 2017   Algosystems