Developer documentation: Sending sensor/profile data to the server

Back to the documentation overview

This document describes how monitored hosts send their sensor or profile data to the ScopePort server.

Connect to the server (Standard port is 12201): Open a socket to the ScopePort server. You have five seconds to complete the whole transaction. Your connection will be closed after the time has passed.

Pass the blacklist: Your connection will be closed if the host you are connecting from is on the blacklist. You can get on the blacklist by sending wrong login credentials or violating the procotol. Your IP is checked against the MySQL table blacklisted_hosts.

mysql> EXPLAIN blacklisted_hosts;
+------------+--------------+------+-----+---------+----------------+
| Field      | Type         | Null | Key | Default | Extra          |
+------------+--------------+------+-----+---------+----------------+
| id         | int(11)      | NO   | PRI | NULL    | auto_increment | 
| host       | varchar(255) | YES  |     | NULL    |                | 
| created_at | datetime     | YES  |     | NULL    |                | 
| updated_at | datetime     | YES  |     | NULL    |                | 
+------------+--------------+------+-----+---------+----------------+

Login: Send the host ID and password in the following format: [host_id],login,[password]
Example: 16,login,secret - Try to login as host 16 with password secret.

You will get a reply that says why you could not be logged in if the login failed. The connection will be closed afterwards.

Send the data: You can now send the profile or sensor data in the following format. Only send one sensor package, then close the connection and start at the beginning. [host_id],[sensor_name],[sensor_value]
Example: 16,cpuload15,3.25 - Host 16 has a 15 minute averaged CPU load of 3.25

You will get a reply that says why the data has not accepted if something failed. The connection will be closed afterwards. There will be a simple okay reply if the data has been stored successfully.

Sensor types: To be added