agent_008 is a test agent that demonstrates the interconnectivity with another agent, namely agent_002, through the use of agent requests. This agent will send a request to agent_002 and will print the response that agent_002 provides.
52 cout <<
"Starting agent_001" << endl;
57 string agent004 =
"004";
71 string requestString =
"request_hello";
81 if (response.size() > 1) {
83 cout <<
"Received from agent_004: " << response.size() <<
" bytes : " << response << endl;
91 cout <<
"What happened to agent_004? Let's try to find it..." << endl;
93 beat_agent_004.
node[0] =
'\0';
96 cout <<
"beat agent_004 node: " << beat_agent_004.
utc << endl;
Definition: jsondef.h:923
int32_t send_request(beatstruc cbeat, string request, string &output, float waitsec=5.)
Send a request over AGENT.
Definition: agentclass.cpp:424
string cosmos_error_string(int32_t cosmos_errno)
Definition: cosmos-errno.cpp:45
uint16_t running()
Check if we're supposed to be running.
Definition: agentclass.cpp:391
static Agent * agent
Definition: agent_008.cpp:41
char node[40+1]
Definition: jsondef.h:928
string agentname
Definition: agent_add_soh.cpp:53
Definition: agentclass.h:139
string nodename
Definition: agent_add_soh.cpp:54
int32_t last_error()
Definition: agentclass.cpp:414
beatstruc find_agent(string node, string agent, double waitsec=0.)
Find agent.
Definition: agentclass.cpp:559
double utc
Definition: jsondef.h:926