91 printf(
"Couldn't find Nodes directory\n");
101 sprintf(input,
"%s/login.dat",
dataDir.c_str());
103 if ((fd = fopen(input,
"r")) != NULL)
107 if (fgets(input,100,fd) != NULL)
119 for (i=0; i<
nodes.size(); ++
i)
121 #if defined(COSMOS_WIN_OS) 122 char command_line[100];
123 sprintf(command_line,
"agent_node %s", (
const char*)
nodes[i].
node.name);
126 PROCESS_INFORMATION pi;
128 ZeroMemory( &si,
sizeof(si) );
130 ZeroMemory( &pi,
sizeof(pi) );
132 #if defined(COSMOS_WIN_BUILD_MSVC) 133 if (CreateProcess(NULL, (LPWSTR) command_line, NULL, NULL,
FALSE, 0, NULL, NULL, &si, &pi))
135 if (CreateProcessA(NULL, (LPSTR) command_line, NULL, NULL,
FALSE, 0, NULL, NULL, &si, &pi))
141 CloseHandle( pi.hProcess );
142 CloseHandle( pi.hThread );
155 devn = open(
"/dev/null",O_RDWR);
156 dup2(STDIN_FILENO, devn);
157 dup2(STDOUT_FILENO, devn);
158 dup2(STDERR_FILENO, devn);
160 execl(
"agent_node", (
const char*)
nodes[i].
node.name,(
char*)
nullptr);
int32_t request_getnodelist(string &request, string &response, Agent *)
Definition: agent_data-2-0.cpp:232
int fd
Definition: arduino_lib.cpp:61
int i
Definition: rw_test.cpp:37
char username[1000][50]
Definition: agent_data-2-0.cpp:73
int waitsec
Definition: agent_data-2-0.cpp:61
int agent_data()
Definition: agent_data-2-0.cpp:188
int32_t set_cosmosnodes(string name, bool create_flag)
Set Nodes Directory.
Definition: datalib.cpp:1445
int iretn
Definition: rw_test.cpp:37
int usercount
Definition: agent_data-2-0.cpp:72
int32_t data_get_nodes(vector< cosmosstruc > &node)
Get vector of Node structures.
Definition: datalib.cpp:636
char agentname[COSMOS_MAX_NAME+1]
Definition: agent_data-2-0.cpp:59
int32_t request_login(string &request, string &response, Agent *)
Definition: agent_data-2-0.cpp:203
#define FALSE
Definition: jpleph.cpp:69
char node[40+1]
Definition: jsondef.h:928
int32_t pid
Agent process ID.
Definition: jsondef.h:1021
int32_t check_agent(string node, string agent, double waitsec)
Check agent.
Definition: agentclass.cpp:546
std::vector< cosmosstruc > nodes
Definition: agent_data-2-0.cpp:57
int32_t add_request(string token, external_request_function function, string synopsis="", string description="")
Add internal request to Agent request list with description and synopsis.
Definition: agentclass.cpp:312
beatstruc beat
Heartbeat.
Definition: jsondef.h:1029
std::string dataDir
Definition: agent_data-2-0.cpp:60
Definition: agentclass.h:139
std::vector< agentstruc > agents
Definition: agent_data-2-0.cpp:52
Agent * agent
Definition: agent_data-2-0.cpp:66
int32_t request_log(string &request, string &response, Agent *)
Definition: agent_data-2-0.cpp:245
char password[1000][50]
Definition: agent_data-2-0.cpp:74
agentstruc tempagent
Definition: agent_data-2-0.cpp:53
#define MAXBUFFERSIZE
Definition: agent_data-2-0.cpp:68
static string node
Definition: agent_monitor.cpp:126