the agent

Description

The plugin-based agent written in c++. It provide a REST api to the data that the backend consume.

Installation

The configuration file

# vi /etc/watched/agent.config.json
{
        /*      Configure the collectors plugins */
        "collectors" : 
        {
                "cpuload" : 
                {
                        "enable" : true, /*             Enable this plugin ?*/
                        "history" : 150, /*             Number of elements to keep*/
                        "poll-frequency" : 10 /*        Number of seconds between snapshots*/
                },
                "cpuspeed" : 
                {
                        "enable" : true, /*             Enable this plugin ?*/
                        "history" : 300, /*             Number of elements to keep*/
                        "poll-frequency" : 5 /*         Number of seconds between snapshots*/
                },
                "cpuuse" : 
                {
                        "enable" : true, /*             Enable this plugin ?*/
                        "history" : 300, /*             Number of elements to keep*/
                        "poll-frequency" : 5 /*         Number of seconds between snapshots*/
                },
                "diskstats" : 
                {
                        "enable" : true, /*             Enable this plugin ?*/
                        "history" : 300, /*             Number of elements to keep*/
                        "poll-frequency" : 5 /*         Number of seconds between snapshots*/
                },
                "diskusage" : 
                {
                        "enable" : true, /*             Enable this plugin ?*/
                        "history" : 100, /*             Number of elements to keep*/
                        "poll-frequency" : 300 /*       Number of seconds between snapshots*/
                },
                "memory" : 
                {
                        "enable" : true, /*             Enable this plugin ?*/
                        "history" : 150, /*             Number of elements to keep*/
                        "poll-frequency" : 10 /*        Number of seconds between snapshots*/
                },
                "netdev" : 
                {
                        "enable" : true, /*             Enable this plugin ?*/
                        "history" : 300, /*             Number of elements to keep*/
                        "poll-frequency" : 5 /*         Number of seconds between snapshots*/
                },
                "uptime" : 
                {
                        "enable" : true, /*             Enable this plugin ?*/
                        "history" : 100, /*             Number of elements to keep*/
                        "poll-frequency" : 300 /*       Number of seconds between snapshots*/
                },
                "vmstat" : 
                {
                        "enable" : true, /*             Enable this plugin ?*/
                        "history" : 300, /*             Number of elements to keep*/
                        "poll-frequency" : 5 /*         Number of seconds between snapshots*/
                }
        },
        "server" : 
        {
                "collectors_dir" : "plugins",
                "host" : "", /*         Host string to listen on (default: all interfaces) */
                "port" : 9080, /*               TCP port number */
                "threads" : 8 /*                Number of concurrent threads use to reply on network interface */
        }
}

For now the agent doesnt check for changes in its configuration file, so after each edit you'll need to restart it using :

# systemctl restart watched.agent