89{
90
91
92
93
94 string rbufin = string(m_conf->getconf("system", "unitname")) + ":" +
95 string(m_conf->getconf("collector", "ringbufin"));
96
97 string rbufout = string(m_conf->getconf("system", "unitname")) + ":" +
98 string(m_conf->getconf("collector", "ringbufout"));
99
100
101 string shmname = string(m_conf->getconf("system", "unitname")) + ":" +
102 string(m_conf->getconf("collector", "nodename"));
103
104
105
106 char* hport = m_conf->getconf("collector", "historecv", "port");
107
108
109
110
111
112
113
114
115
116
117
118 char* src = m_conf->getconf("collector", "destination");
119 if (strstr(src, "net") != 0) {
120
121 char* sender = m_conf->getconf("collector", "sender", "script");
122 char* port = m_conf->getconf("collector", "sender", "port");
123 char idbuf[3];
124 sprintf(idbuf, "%2.2d", RF_OUTPUT_ID);
125 m_pid_sender = m_proc->
Execute(sender, (
char*)rbufout.c_str(), port, (
char*)shmname.c_str(), idbuf);
126 m_flow->clear(RF_OUTPUT_ID);
127 } else if (strstr(src, "file") != 0) {
128
129 char* writer = m_conf->getconf("collector", "writer", "script");
130 char* file = m_conf->getconf("collector", "writer", "filename");
131 char* nnode = m_conf->getconf("processor", "nnodes");
132 m_pid_sender = m_proc->
Execute(writer, (
char*)rbufout.c_str(), file, nnode);
133 } else {
134
135 }
136
137
138 char* basf2 = m_conf->getconf("collector", "basf2", "script");
139 if (nsmm->len > 0) {
140 basf2 = (char*) nsmm->datap;
141 printf("Configure: basf2 script overridden : %s\n", basf2);
142 }
143 m_pid_basf2 = m_proc->
Execute(basf2, (
char*)rbufin.c_str(), (
char*)rbufout.c_str(), hport);
144
145
146 m_nnodes = 0;
147 int maxnodes = m_conf->getconfi("processor", "nnodes");
148 int idbase = m_conf->getconfi("processor", "idbase");
149
150 char* hostbase = m_conf->getconf("processor", "hostbase");
151 char* badlist = m_conf->getconf("processor", "badlist");
152 char* port = m_conf->getconf("processor", "sender", "port");
153
154 char* receiver = m_conf->getconf("collector", "receiver", "script");
155 char hostname[512], idname[3], shmid[3];
156 for (int i = 0; i < maxnodes; i++) {
157 sprintf(idname, "%2.2d", idbase + i);
158 sprintf(shmid, "%2.2d", i);
159 if (badlist == NULL ||
160 strstr(badlist, idname) == 0) {
161 sprintf(hostname, "%s%2.2d", hostbase, idbase + i);
162 m_pid_receiver[m_nnodes] = m_proc->
Execute(receiver, (
char*)rbufin.c_str(), hostname, port, (
char*)shmname.c_str(), shmid);
163 m_flow->clear(i);
164 m_nnodes++;
165 }
166 }
167
170 return 0;
171}
int Execute(char *script, int nargs, char **args)
void forceClear()
Forcefully clear the RingBuffer with resetting semaphore.