1. Home
  2. API
  3. API Documentation
  4. Snapt Aria Framework API Documentation

Snapt Aria Framework API Documentation

Please ensure you have read the beginners guide in order to understand the commands below.

OS Module

The OS module provides various OS functions, all of which you can request using the system.listMethods call to the /os API. Below are some examples of common commands.

print(str(proxy.os.getInterfaces()));
['lo', 'eth0']
print(str(proxy.os.getIPs()));
{'1': '192.168.1.231', '0': '192.168.1.240', '2': '127.0.0.1'}

The activity module handles activity logging on the system, and the notices module handles alerts. They both function in the same fashion.

proxy = xmlrpclib.ServerProxy("http://localhost:8080/api/key/secret/activity");
print(str(proxy.activity.getLogs(10)));
[{'action': 'Snapt blacklist automatically updated [fail2ban].', 'userid': '0', 'tstamp': '2015-02-25 12:01'}, {'action': 'Snapt blacklist automatically updated [bogon].', 'userid': '0', 'tstamp': '2015-02-25 12:00'}, {'action': 'Snapt blacklist automatically updated [threats].', 'userid': '0', 'tstamp': '2015-02-25 12:00'}, {'action': 'Snapt blacklist automatically updated [spam].', 'userid': '0', 'tstamp': '2015-02-25 12:00'}, {'action': 'Snapt blacklist automatically updated [scanners].', 'userid': '0', 'tstamp': '2015-02-25 12:00'}, {'action': "Automatic directory creation: '/var/snapt/backups/haproxy'", 'userid': '-1', 'tstamp': '2015-02-25 11:59'}, {'action': "Automatic directory creation: '/var/snapt/backups/haproxy'", 'userid': '-1', 'tstamp': '2015-02-25 11:57'}, {'action': "Automatic directory creation: '/var/snapt/backups/haproxy'", 'userid': '-1', 'tstamp': '2015-02-25 11:55'}, {'action': "Automatic directory creation: '/var/snapt/backups/haproxy'", 'userid': '1', 'tstamp': '2015-02-25 11:24'}, {'action': 'A frontend (<strong>test</strong>) was edited in Balancer.', 'userid': '1', 'tstamp': '2015-02-25 11:24'}]
proxy = xmlrpclib.ServerProxy("http://localhost:8080/api/key/secret/notices");
print(str(proxy.notices.getUnread(10)));
[{'msg': 'A monitored process was not running! Restart attempted.', 'type': 'e', 'id': '5982', 'tstamp': '2020-03-07 22:17:27'}, {'msg': 'A monitored process was not running! Restart attempted.', 'type': 'e', 'id': '5979', 'tstamp': '2020-02-15 19:54:48'}, {'msg': 'A monitored process (nginx) was not running! Restart attempted.', 'type': 'e', 'id': '5978', 'tstamp': '2020-02-15 19:54:32'}]
Updated on March 19, 2020


Was this article helpful?

Related Articles