Scopira 20080306

scopira::agent::uptime_service Class Reference

#include <uptimeservice.h>

List of all members.

Public Member Functions

 uptime_service (scopira::agent::task_context &ctx)
 constructor
 ~uptime_service ()
 destructor
void update_uptime (void)
int get_num_agents (void)
 returns the number of agents being monitored
const std::string & get_value (int agentnum, const std::string &key)

Detailed Description

This is a service pack for accessing the uptime service. Each agent has uptime task service, which, when queried can return many statistics and other information about that agent, it's host machine and it's tasks.

These uptime server tasks are created one-per-agent when this class is created and destroyed. Therefore, this is not a light operation.

A "service pack" is a C++ API object that easies access to a service task. It handles all the protocol communication with that service.

Author:
Aleksander Demko

Member Function Documentation

const std::string& scopira::agent::uptime_service::get_value ( int  agentnum,
const std::string &  key 
)

Get the value for the given key from the given agentid. agentid should be [0..get_num_agents).

This will return BAD_AGENT or BAD_KEY for various errors.

Key, for now, can be: keylist hostname age agentuuid load numcpu tasks ostype

Author:
Aleksander Demko
void scopira::agent::uptime_service::update_uptime ( void  )

All the values for get_value are cached internally. Call this will update the cached values from the agents. This is called initially by the uptime_service constructor, too.

Author:
Aleksander Demko

The documentation for this class was generated from the following file: