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);
int usercount
Definition: agent_data.cpp:72
char username[1000][50]
Definition: agent_data.cpp:73
int fd
Definition: arduino_lib.cpp:61
std::vector< agentstruc > agents
Definition: agent_data.cpp:52
int i
Definition: rw_test.cpp:37
Agent * agent
Definition: agent_data.cpp:66
int32_t set_cosmosnodes(string name, bool create_flag)
Set Nodes Directory.
Definition: datalib.cpp:1445
int iretn
Definition: rw_test.cpp:37
std::string dataDir
Definition: agent_data.cpp:60
char agentname[COSMOS_MAX_NAME+1]
Definition: agent_data.cpp:59
int32_t data_get_nodes(vector< cosmosstruc > &node)
Get vector of Node structures.
Definition: datalib.cpp:636
int waitsec
Definition: agent_data.cpp:61
int32_t request_log(string &request, string &response, Agent *)
Definition: agent_data.cpp:245
#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
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
int32_t request_login(string &request, string &response, Agent *)
Definition: agent_data.cpp:203
beatstruc beat
Heartbeat.
Definition: jsondef.h:1029
Definition: agentclass.h:139
int agent_data()
Definition: agent_data.cpp:188
char password[1000][50]
Definition: agent_data.cpp:74
agentstruc tempagent
Definition: agent_data.cpp:53
int32_t request_getnodelist(string &request, string &response, Agent *)
Definition: agent_data.cpp:232
#define MAXBUFFERSIZE
Definition: agent_data.cpp:68
std::vector< cosmosstruc > nodes
Definition: agent_data.cpp:57
static string node
Definition: agent_monitor.cpp:126