irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

reIn2p3SysRule.cpp
Go to the documentation of this file.
1 
6 #include "rcMisc.h"
7 #include "reIn2p3SysRule.hpp"
8 #include "genQuery.h"
9 #include "phyBundleColl.h"
10 #include "reDataObjOpr.hpp"
11 #include "rsGenQuery.hpp"
12 #include "rsGeneralRowInsert.hpp"
13 #include "rsGeneralAdmin.hpp"
14 #include "rsGeneralRowPurge.hpp"
15 
16 #ifndef windows_platform
17 #include <sys/socket.h>
18 #include <pthread.h>
19 #include <netinet/in.h>
20 #include <arpa/inet.h>
21 #include "irods_stacktrace.hpp"
22 static pthread_mutex_t my_mutex;
23 #endif
24 
27 #include "rodsErrorTable.h"
28 #include <boost/system/error_code.hpp>
29 #include <boost/asio.hpp>
30 #include <boost/algorithm/string.hpp>
31 
32 #include <vector>
33 #include <string>
34 #include <sstream>
35 
37 
38 int rodsMonPerfLog( char *serverName, char *resc, char *output, ruleExecInfo_t *rei ) {
39  char condstr[MAX_NAME_LEN], fname[MAX_NAME_LEN], msg[MAX_MESSAGE_SIZE],
40  monStatus[MAX_NAME_LEN], suffix[MAX_VALUE];
41  const char *delim1 = "#";
42  const char *delim2 = ",";
43  int rc1 = 0, rc2 = 0, rc3 = 0, rc4 = 0;
44  generalRowInsertInp_t generalRowInsertInp;
45  generalAdminInp_t generalAdminInp1, generalAdminInp2;
46  genQueryInp_t genQueryInp;
47 
48  genQueryOut_t *genQueryOut = NULL;
49  time_t tps = time( NULL );
50  struct tm *now = localtime( &tps );
51 
52  /* a quick test in order to see if the resource is up or down (needed to update the "status" metadata) */
53  if ( strcmp( output, MON_OUTPUT_NO_ANSWER ) == 0 ) {
54  strncpy( monStatus, RESC_AUTO_DOWN, MAX_NAME_LEN );
55  }
56  else {
57  strncpy( monStatus, RESC_AUTO_UP, MAX_NAME_LEN );
58  }
59  std::vector<std::string> output_tokens;
60  boost::algorithm::split( output_tokens, output, boost::is_any_of( delim1 ) );
61  output_tokens.erase( output_tokens.begin() ); // output has leading delimiter
62  if ( output_tokens.size() != 9 ) {
63  rodsLog( LOG_ERROR, "rodsMonPerfLog: output_tokens is of incorrect size: size [%ju], output [%s]", ( uintmax_t )output_tokens.size(), output );
64  return -1;
65  }
66  std::vector<std::string> resc_tokens;
67  boost::algorithm::split( resc_tokens, resc, boost::is_any_of( delim2 ) );
68  std::vector<std::string> disk_tokens;
69  boost::algorithm::split( disk_tokens, output_tokens[4], boost::is_any_of( delim2 ) );
70  std::vector<std::string> value_tokens;
71  boost::algorithm::split( value_tokens, output_tokens[7], boost::is_any_of( delim2 ) );
72  if ( resc_tokens.size() != disk_tokens.size() || resc_tokens.size() != value_tokens.size() ) {
73  rodsLog( LOG_ERROR, "rodsMonPerfLog: resc_tokens [%ju], disk_tokens [%ju], value_tokens [%ju]. output [%s]", ( uintmax_t )resc_tokens.size(), ( uintmax_t )disk_tokens.size(), ( uintmax_t )value_tokens.size(), output );
74  return -1;
75  }
76 
77  for ( std::vector<std::string>::size_type index = 0; index < resc_tokens.size(); ++index ) {
78  if ( strcmp( monStatus, RESC_AUTO_DOWN ) == 0 ) {
79  disk_tokens[index] = "-1";
80  value_tokens[index] = "-1";
81  }
82  snprintf( msg, sizeof( msg ), "server=%s resource=%s cpu=%s, mem=%s, swp=%s, rql=%s, dsk=%s, nin=%s, nout=%s, dskAv(MB)=%s\n",
83  serverName, resc_tokens[index].c_str(), output_tokens[0].c_str(), output_tokens[1].c_str(), output_tokens[2].c_str(),
84  output_tokens[3].c_str(), disk_tokens[index].c_str(), output_tokens[5].c_str(), output_tokens[6].c_str(), value_tokens[index].c_str() );
85  snprintf( suffix, sizeof( suffix ), "%d.%d.%d", now->tm_year + 1900, now->tm_mon + 1, now->tm_mday );
86  snprintf( fname, sizeof( fname ), "%s.%s", OUTPUT_MON_PERF, suffix );
87  /* retrieve the system time */
88  const time_t timestamp = time( &tps );
89 
90  /* log the result into the database as well */
91  generalRowInsertInp.tableName = "serverload";
92  generalRowInsertInp.arg1 = serverName;
93  generalRowInsertInp.arg2 = resc_tokens[index].c_str();
94  generalRowInsertInp.arg3 = output_tokens[0].c_str();
95  generalRowInsertInp.arg4 = output_tokens[1].c_str();
96  generalRowInsertInp.arg5 = output_tokens[2].c_str();
97  generalRowInsertInp.arg6 = output_tokens[3].c_str();
98  generalRowInsertInp.arg7 = disk_tokens[index].c_str();
99  generalRowInsertInp.arg8 = output_tokens[5].c_str();
100  generalRowInsertInp.arg9 = output_tokens[6].c_str();
101  /* prepare DB request to modify resource metadata: freespace and status */
102  generalAdminInp1.arg0 = "modify";
103  generalAdminInp1.arg1 = "resource";
104  generalAdminInp1.arg2 = resc_tokens[index].c_str();
105  generalAdminInp1.arg3 = "freespace";
106  generalAdminInp1.arg4 = value_tokens[index].c_str();
107  generalAdminInp2.arg0 = "modify";
108  generalAdminInp2.arg1 = "resource";
109  generalAdminInp2.arg2 = resc_tokens[index].c_str();
110  generalAdminInp2.arg3 = "status";
111  generalAdminInp2.arg4 = monStatus;
112  memset( &genQueryInp, 0, sizeof( genQueryInp ) );
113  addInxIval( &genQueryInp.selectInp, COL_R_RESC_STATUS, 1 );
114  snprintf( condstr, MAX_NAME_LEN, "= '%s'", resc_tokens[index].c_str() );
115  addInxVal( &genQueryInp.sqlCondInp, COL_R_RESC_NAME, condstr );
116  genQueryInp.maxRows = MAX_SQL_ROWS;
117 #ifndef windows_platform
118  pthread_mutex_lock( &my_mutex );
119 #endif
120  /* append to the output log file */
121  FILE *foutput = fopen( fname, "a" );
122  if ( foutput != NULL ) {
123  fprintf( foutput, "time=%ji %s", ( intmax_t )timestamp, msg );
124  // fclose(foutput); // JMC cppcheck - nullptr // cannot close it here. it is used later - hcj
125  }
126 
127  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
128  rc2 = rsGeneralAdmin( rei->rsComm, &generalAdminInp1 );
129  rc3 = rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut );
130  if ( rc3 >= 0 ) {
131  const char *result = genQueryOut->sqlResult[0].value;
132  if ( strcmp( result, "\0" ) == 0 || ( strncmp( result, "auto-", 5 ) == 0 && strcmp( result, monStatus ) != 0 ) ) {
133  rc4 = rsGeneralAdmin( rei->rsComm, &generalAdminInp2 );
134  }
135  }
136  else {
137  rodsLog( LOG_ERROR, "msiServerMonPerf: unable to retrieve the status metadata for the resource %s", resc_tokens[index].c_str() );
138  }
139 #ifndef windows_platform
140  pthread_mutex_unlock( &my_mutex );
141 #endif
142  if ( foutput != NULL ) {
143  if ( rc1 != 0 ) {
144  fprintf( foutput, "time=%ji : unable to insert the entries for server %s into the iCAT\n",
145  ( intmax_t )timestamp, serverName );
146  }
147  fclose( foutput );
148  }
149  if ( rc2 != 0 ) {
150  rodsLog( LOG_ERROR, "msiServerMonPerf: unable to register the free space metadata for the resource %s", resc_tokens[index].c_str() );
151  }
152  if ( rc4 != 0 ) {
153  rodsLog( LOG_ERROR, "msiServerMonPerf: unable to register the status metadata for the resource %s", resc_tokens[index].c_str() );
154  }
155  }
156 
157  clearGenQueryInp( &genQueryInp );
158  freeGenQueryOut( &genQueryOut );
159 
160  return 0;
161 }
162 
163 int getListOfResc( rsComm_t *rsComm, char serverList[MAX_VALUE][MAX_NAME_LEN], int nservers,
164  monInfo_t monList[MAX_NSERVERS], int *nlist ) {
165 
170  int i, j, k, index[MAX_NSERVERS], l, status;
171  genQueryInp_t genQueryInp;
172  genQueryOut_t *genQueryOut = NULL;
173  char condStr[MAX_NAME_LEN];
174 
175  memset( &genQueryInp, 0, sizeof( genQueryInp_t ) );
176  memset( &index, -1, MAX_NSERVERS * sizeof( int ) );
177  genQueryInp.maxRows = MAX_SQL_ROWS;
178 
179  //clearGenQueryInp( &genQueryInp );
180  addInxIval( &genQueryInp.selectInp, COL_R_LOC, 1 );
181  addInxIval( &genQueryInp.selectInp, COL_R_RESC_NAME, 1 );
182  addInxIval( &genQueryInp.selectInp, COL_R_TYPE_NAME, 1 );
183  addInxIval( &genQueryInp.selectInp, COL_R_VAULT_PATH, 1 );
184  addInxVal( &genQueryInp.sqlCondInp, COL_R_LOC, "!='EMPTY_RESC_HOST'" );
185  addInxVal( &genQueryInp.sqlCondInp, COL_R_VAULT_PATH, "!='EMPTY_RESC_PATH'" );
186  snprintf( condStr, MAX_NAME_LEN, "!='%s'", BUNDLE_RESC );
187  addInxVal( &genQueryInp.sqlCondInp, COL_R_RESC_NAME, condStr );
188 
189  status = rsGenQuery( rsComm, &genQueryInp, &genQueryOut );
190  if ( status < 0 ) {
191  irods::log( ERROR( status, "rsGenQuery failed." ) );
192  }
193  if ( genQueryOut->rowCnt > 0 ) {
194  l = 0;
195  for ( i = 0; i < genQueryOut->attriCnt; i++ ) {
196  for ( j = 0; j < genQueryOut->rowCnt; j++ ) {
197  char *tResult;
198  tResult = genQueryOut->sqlResult[i].value;
199  tResult += j * genQueryOut->sqlResult[i].len;
200  switch ( i ) {
201  case 0:
202  if ( nservers >= 0 ) {
203  for ( k = 0; k < nservers; k++ ) {
204  if ( strcmp( serverList[k], tResult ) == 0 ) {
205  index[j] = l;
206  l++;
207  }
208  }
209  }
210  else {
211  index[j] = l;
212  l++;
213  }
214  if ( index[j] != -1 ) {
215  rstrcpy( monList[index[j]].serverName, tResult, LONG_NAME_LEN );
216  }
217  break;
218  case 1:
219  if ( index[j] != -1 ) {
220  rstrcpy( monList[index[j]].rescName, tResult, MAX_NAME_LEN );
221  }
222  break;
223  case 2:
224  if ( index[j] != -1 ) {
225  rstrcpy( monList[index[j]].rescType, tResult, LONG_NAME_LEN );
226  }
227  break;
228  case 3:
229  if ( index[j] != -1 ) {
230  rstrcpy( monList[index[j]].vaultPath, tResult, LONG_NAME_LEN );
231  }
232  break;
233  }
234  }
235  }
236  ( *nlist ) = l;
237  clearGenQueryInp( &genQueryInp );
238  freeGenQueryOut( &genQueryOut );
239  return 0;
240  }
241  return -1;
242 }
243 
244 void *startMonScript( void *arg ) {
245 
250  char *output;
251  msParam_t msp1, msp2, msp3, msp4, msp5, msout;
252  int thrid, status;
253  int retval;
254 
255  thrInp_t *tinput = ( thrInp_t* )arg;
256 #ifndef windows_platform
257  pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, NULL );
258  pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS, NULL );
259 #endif
260  fillStrInMsParam( &msp1, tinput->cmd );
261  fillStrInMsParam( &msp2, tinput->cmdArgv );
262  fillStrInMsParam( &msp3, tinput->execAddr );
263  fillStrInMsParam( &msp4, tinput->hintPath );
264  fillIntInMsParam( &msp5, tinput->addPathToArgv );
265  thrid = tinput->threadId;
266 
267  threadIsAlive[thrid] = 0;
268  status = msiExecCmd( &msp1, &msp2, &msp3, &msp4, &msp5, &msout, &( tinput->rei ) );
269 
270  if ( status < 0 ) {
271  char noanswer[MAXSTR] = MON_OUTPUT_NO_ANSWER;
272  rodsLogError( LOG_ERROR, status, "Call to msiExecCmd failed in msiServerMonPerf. " );
273  rodsMonPerfLog( tinput->execAddr, tinput->rescName, noanswer, &( tinput->rei ) );
274  threadIsAlive[thrid] = 1;
275  retval = -1;
276 #ifndef windows_platform
277  pthread_exit( ( void * )&retval );
278 #endif
279  }
280 
281  /* if (&msout != NULL) { */
282  /* write into the irodsMonPerf log file */
283  if ( ( char * )( *( ( execCmdOut_t * ) msout.inOutStruct ) ).stdoutBuf.buf != NULL ) {
284  output = ( char * )( *( ( execCmdOut_t * ) msout.inOutStruct ) ).stdoutBuf.buf;
285  rodsMonPerfLog( tinput->execAddr, tinput->rescName, output, &( tinput->rei ) );
286  }
287  else {
288  char noanswer[MAXSTR] = MON_OUTPUT_NO_ANSWER;
289  rodsLog( LOG_ERROR, "Server monitoring: no output for the server %s, status = %i \n", tinput->execAddr, status );
290  rodsMonPerfLog( tinput->execAddr, tinput->rescName, noanswer, &( tinput->rei ) );
291  threadIsAlive[thrid] = 1;
292  retval = -1;
293 #ifndef windows_platform
294  pthread_exit( ( void * )&retval );
295 #endif
296  }
297  /*}
298  else {
299  char noanswer[MAXSTR] = MON_OUTPUT_NO_ANSWER;
300  rodsLog(LOG_ERROR, "Server monitoring: problem with the server %s, status = %i \n", tinput->execAddr, status);
301  rodsMonPerfLog(tinput->execAddr, tinput->rescName, noanswer,
302  &(tinput->rei));
303  threadIsAlive[thrid] = 1;
304  retval = -1;
305  #ifndef windows_platform
306  pthread_exit((void *)&retval);
307  #endif
308  } */
309 
310  threadIsAlive[thrid] = 1;
311 
312  retval = 0;
313 #ifndef windows_platform
314  pthread_exit( ( void * )&retval );
315 #endif
316 }
317 
319  const std::string& _user_name,
320  const std::string& _host_client,
321  const std::string& _groups_name ) {
322  namespace ip = boost::asio::ip;
323 
324  std::string cfg_file;
327  cfg_file );
328  if ( !ret.ok() ) {
329  irods::log( PASS( ret ) );
330  return ret.code();
331  }
332 
334  ret = cfg.load( cfg_file );
335  if ( !ret.ok() ) {
336  irods::log( PASS( ret ) );
337  return ret.code();
338  }
339 
340  std::vector< std::string > group_list;
341  boost::split(
342  group_list,
343  _groups_name,
344  boost::is_any_of( "\t " ),
345  boost::token_compress_on );
346 
347  try {
348  for ( const auto& el : cfg.get< const std::vector<boost::any> >("access_entries") ) {
349  try {
350  const auto& access_entry = boost::any_cast<const std::unordered_map<std::string, boost::any>&>(el);
351  const auto& user = boost::any_cast<const std::string&>(access_entry.at("user"));
352  const auto& group = boost::any_cast<const std::string&>(access_entry.at("group"));
353  const auto& addy = boost::any_cast<const std::string&>(access_entry.at("address"));
354  const auto& mask = boost::any_cast<const std::string&>(access_entry.at("mask"));
355 
356  boost::system::error_code error_code;
357  ip::address_v4 address_entry(
358  ip::address_v4::from_string(
359  addy,
360  error_code ) );
361  if ( error_code.value() ) {
362  continue;
363 
364  }
365 
366  ip::address_v4 mask_entry(
367  ip::address_v4::from_string(
368  mask,
369  error_code ) );
370  if ( error_code.value() ) {
371  continue;
372 
373  }
374 
375  ip::address_v4 host_client(
376  ip::address_v4::from_string(
377  _host_client,
378  error_code ) );
379  if ( error_code.value() ) {
380  continue;
381 
382  }
383 
384  bool user_match = false;
385  if ( user == _user_name ||
386  user == "all" ) {
387  user_match = true;
388 
389  }
390 
391  bool group_match = false;
392  if ( "all" == group ) {
393  group_match = true;
394 
395  }
396  else {
397  for ( size_t i = 0;
398  i < group_list.size();
399  ++i ) {
400  if ( group == group_list[ i ] ) {
401  group_match = true;
402 
403  }
404 
405  } // for i
406 
407  }
408 
409  if ( group_match || user_match ) {
410  // check if <client, group, clientIP>
411  // match this entry of the control access file.
412  if ( ( ( host_client.to_ulong() ^
413  address_entry.to_ulong() ) &
414  ~mask_entry.to_ulong() ) == 0 ) {
415  return 0;
416  }
417  }
418  } catch ( const boost::bad_any_cast& e ) {
419  irods::log( ERROR( INVALID_ANY_CAST, e.what() ) );
420  continue;
421  } catch ( const std::out_of_range& e ) {
422  irods::log( ERROR( KEY_NOT_FOUND, e.what() ) );
423  }
424 
425  }
426  } catch ( const irods::exception& e ) {
428  return e.code();
429  }
430 
431  return UNMATCHED_KEY_OR_INDEX;
432 
433 } // checkHostAccessControl
434 
471  char group[MAX_NAME_LEN], *hostclient, *result, *username;
472  char condstr[MAX_NAME_LEN];
473  int i, rc, status;
474  genQueryInp_t genQueryInp;
475  genQueryOut_t *genQueryOut = NULL;
476  rsComm_t *rsComm;
477 
478  RE_TEST_MACRO( " Calling msiCheckHostAccessControl" )
479  /* the above line is needed for loop back testing using irule -i option */
480 
481  group[0] = '\0';
482  rsComm = rei->rsComm;
483 
484  /* retrieve user name */
485  username = rsComm->clientUser.userName;
486  /* retrieve client IP address */
487  hostclient = inet_ntoa( rsComm->remoteAddr.sin_addr );
488  /* retrieve groups to which the user belong */
489  memset( &genQueryInp, 0, sizeof( genQueryInp ) );
490  snprintf( condstr, MAX_NAME_LEN, "= '%s'", username );
491  addInxVal( &genQueryInp.sqlCondInp, COL_USER_NAME, condstr );
492  addInxIval( &genQueryInp.selectInp, COL_USER_GROUP_NAME, 1 );
493  genQueryInp.maxRows = MAX_SQL_ROWS;
494  status = rsGenQuery( rsComm, &genQueryInp, &genQueryOut );
495  if ( status >= 0 ) {
496  for ( i = 0; i < genQueryOut->rowCnt; i++ ) {
497  result = genQueryOut->sqlResult[0].value;
498  result += i * genQueryOut->sqlResult[0].len;
499  strcat( group, result );
500  strcat( group, " " );
501  }
502  }
503  else {
504  rstrcpy( group, "all", MAX_NAME_LEN );
505  }
506  clearGenQueryInp( &genQueryInp );
507  freeGenQueryOut( &genQueryOut );
508 
509  rc = checkHostAccessControl( username, hostclient, group );
510  if ( rc < 0 ) {
511  rodsLog( LOG_NOTICE, "Access to user %s from host %s has been refused.\n", username, hostclient );
512  rei->status = rc;
513  }
514 
515  return rei->status;
516 
517 }
518 
519 
565  char line[MAX_VALUE], *verbosity;
566  char serverList[MAX_VALUE][MAX_NAME_LEN];
567  char cmd[MAX_NAME_LEN]; /* cmd => name of the Perl script */
568  char probtime[LEN_SECONDS], measTime[LEN_SECONDS];
569  FILE *filein; /* file pointers */
570  const char *delim = " \n";
571  char val[MAX_NAME_LEN] = ""; /* val => arguments for the script */
572  int check, i, indx, j, looptime, maxtime, nresc, nservers, thrCount, threadsNotfinished;
573  const char *probtimeDef = "10"; /* default value used by the monitoring script for the amount
574  of time for this measurement (in s) */
575  rsComm_t *rsComm;
576  monInfo_t rescList[MAX_NSERVERS];
577  thrInp_t *thrInput;
578  int addPathToArgv = 0;
579  char *hintPath = "";
580 
581  RE_TEST_MACRO( " Calling msiServerMonPerf" )
582 
583  /* the above line is needed for loop back testing using irule -i option */
584 
585  rsComm = rei->rsComm;
586 
587  std::stringstream valinit_stream;
588  if ( verb->inOutStruct != NULL ) {
589  verbosity = ( char * ) verb->inOutStruct;
590  if ( strcmp( verbosity, "verbose" ) == 0 ) {
591  valinit_stream << "-v ";
592  }
593  }
594 
595  valinit_stream << " -t ";
596 
597  snprintf( probtime, sizeof( probtime ), "%s", ( char * ) ptime->inOutStruct );
598  if ( atoi( probtime ) > 0 ) {
599  valinit_stream << probtime;
600  snprintf( measTime, sizeof( measTime ), "%s", probtime );
601  }
602  else {
603  valinit_stream << probtimeDef;
604  snprintf( measTime, sizeof( measTime ), "%s", probtimeDef );
605  }
606 
607  rstrcpy( val, "", MAX_NAME_LEN );
608 
609  /* read the config file or the iCAT to know the servers list to monitor */
610  nresc = 0;
611 
612  nservers = -1; /* nservers = -1, no config file available, consider all resources for the monitoring */
613  if ( ( filein = fopen( MON_CFG_FILE, "r" ) ) != NULL ) {
614  i = 0;
615  while ( fgets( line, sizeof line, filein ) != NULL ) { /* for each line of the file */
616  /* if begin of line = # => ignore */
617  if ( line[0] != '#' ) {
618  std::vector<std::string> tokens;
619  boost::algorithm::split( tokens, line, boost::is_any_of( delim ) );
620  snprintf( serverList[i], MAX_NAME_LEN, "%s", tokens[0].c_str() );
621  i++;
622  }
623  }
624  /* number of servers... useful for the threads */
625  nservers = i;
626  /* close the configuration file */
627  fclose( filein );
628  }
629  getListOfResc( rsComm, serverList, nservers, rescList, &nresc );
630 
631  /* If the list of resources is empty, just return early because
632  * there is no work to be done below. */
633  if ( 0 == nresc ) {
634  rodsLog( LOG_NOTICE, "msiServerMonPerf: no resources found\n" );
635  return rei->status;
636  }
637 
638  strcpy( cmd, MON_PERF_SCRIPT );
639 #ifndef windows_platform
640  pthread_t *threads = ( pthread_t* )malloc( sizeof( pthread_t ) * nresc );
641  pthread_mutex_init( &my_mutex, NULL );
642 #endif
643  thrInput = ( thrInp_t* )malloc( sizeof( thrInp_t ) * nresc );
644  thrCount = 0;
645 
646  for ( i = 0; i < nresc; i++ ) {
647  /* for each server, build the proxy command to be executed.
648  it will be put in a thrInp structure to be given to the thread.
649  then start one thread for each server to be monitored */
650  check = 0;
651  indx = 0;
652  for ( j = 0; j < thrCount; j++ ) {
653  if ( strcmp( thrInput[j].execAddr, rescList[i].serverName ) == 0 ) {
654  indx = j;
655  check = 1;
656  }
657  }
658  if ( check == 0 ) {
659  const char * path = strcmp( rescList[thrCount].rescType, "unixfilesystem" ) == 0 ?
660  rescList[i].vaultPath : "none";
661  snprintf( thrInput[thrCount].cmdArgv, sizeof( thrInput[thrCount].cmdArgv ),
662  "%s -fs %s", valinit_stream.str().c_str(), path );
663  rstrcpy( thrInput[thrCount].cmd, cmd, LONG_NAME_LEN );
664  rstrcpy( thrInput[thrCount].execAddr, rescList[i].serverName, LONG_NAME_LEN );
665  rstrcpy( thrInput[thrCount].hintPath, hintPath, MAX_NAME_LEN );
666  thrInput[thrCount].addPathToArgv = addPathToArgv;
667  thrInput[thrCount].threadId = thrCount;
668  rstrcpy( thrInput[thrCount].rescName, rescList[i].rescName, MAX_NAME_LEN );
669  memcpy( &( thrInput[thrCount].rei ), rei, sizeof( ruleExecInfo_t ) );
670  thrCount += 1;
671  }
672  else {
673  rstrcat( thrInput[indx].rescName, ",", MAX_NAME_LEN );
674  rstrcat( thrInput[indx].rescName, rescList[i].rescName, MAX_NAME_LEN );
675  if ( strcmp( rescList[i].rescType, "unixfilesystem" ) == 0 ) {
676  rstrcat( thrInput[indx].cmdArgv, ",", sizeof( thrInput[indx].cmdArgv ) );
677  rstrcat( thrInput[indx].cmdArgv, rescList[i].vaultPath, sizeof( thrInput[indx].cmdArgv ) );
678  }
679  else {
680  rstrcat( thrInput[indx].cmdArgv, ",none", sizeof( thrInput[indx].cmdArgv ) );
681  }
682  }
683  rstrcpy( val, "", MAX_NAME_LEN );
684  }
685 
686  for ( i = 0; i < thrCount; i++ ) {
687 #ifndef windows_platform
688  if ( pthread_create( &threads[i], NULL, *startMonScript, ( void * ) &thrInput[i] ) < 0 ) {
689  rodsLog( LOG_ERROR, "msiServerMonPerf: pthread_create error\n" );
690  exit( 1 );
691  }
692 #endif
693  }
694 
695  maxtime = atoi( measTime ) + TIMEOUT;
696  looptime = 0;
697  while ( 1 ) {
698  sleep( 1 );
699  looptime += 1;
700  if ( looptime >= maxtime ) {
701  for ( i = 0; i < thrCount; i++ ) {
702  if ( !threadIsAlive[i] ) {
703 #ifndef windows_platform
704  int rc = pthread_cancel( threads[i] );
705  if ( rc == 0 ) {
706  char noanswer[MAXSTR] = MON_OUTPUT_NO_ANSWER;
707  threadIsAlive[i] = 1;
708  rodsMonPerfLog( thrInput[i].execAddr,
709  thrInput[i].rescName,
710  noanswer,
711  &( thrInput[i].rei ) );
712  }
713 #endif
714  }
715  }
716  }
717  threadsNotfinished = 1;
718  for ( i = 0; i < thrCount; i++ ) {
719  if ( threadIsAlive[i] == 0 ) {
720  threadsNotfinished = 0;
721  }
722  }
723  if ( threadsNotfinished ) {
724  break;
725  }
726  }
727 
728 #ifndef windows_platform
729  free( threads );
730 #endif
731  free( thrInput );
732 
733  return rei->status;
734 
735 }
736 
737 
774 int msiFlushMonStat( msParam_t *inpParam1, msParam_t *inpParam2, ruleExecInfo_t *rei ) {
775  int elapseTime, defaultTimespan, rc;
776  char secAgo[MAXLEN], *tablename, *timespan;
777  generalRowPurgeInp_t generalRowPurgeInp;
778  rsComm_t *rsComm;
779 
780  RE_TEST_MACRO( " Calling msiFlushMonStat" );
781 
782  defaultTimespan = 24; /* in hours */
783 
784  if ( rei == NULL || rei->rsComm == NULL ) {
785  rodsLog( LOG_ERROR, "msiFlushMonStat: input rei or rsComm is NULL" );
787  }
788 
789  rsComm = rei->rsComm;
790 
791  if ( inpParam1 == NULL ) {
792  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
793  "msiFlushMonStat: input Param1 is NULL" );
794  return rei->status;
795  }
796 
797  if ( strcmp( inpParam1->type, STR_MS_T ) == 0 ) {
798  timespan = ( char * ) inpParam1->inOutStruct;
799  }
800  else {
801  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
802  "msiFlushMonStat: Unsupported input Param1 type %s",
803  inpParam1->type );
804  return rei->status;
805  }
806 
807  if ( inpParam2 == NULL ) {
808  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
809  "msiFlushMonStat: input Param2 is NULL" );
810  return rei->status;
811  }
812 
813  if ( strcmp( inpParam2->type, STR_MS_T ) == 0 ) {
814  tablename = ( char * ) inpParam2->inOutStruct;
815  }
816  else {
817  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
818  "msiFlushMonStat: Unsupported input Param2 type %s",
819  inpParam2->type );
820  return rei->status;
821  }
822 
823  if ( atoi( timespan ) > 0 ) {
824  elapseTime = atoi( timespan ) * 3600;
825  }
826  else {
827  elapseTime = defaultTimespan * 3600; /* default timespan in seconds */
828  }
829 
830  if ( strcmp( tablename, "serverload" ) != 0 &&
831  strcmp( tablename, "serverloaddigest" ) != 0 ) {
832  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
833  "msiFlushMonStat: table %s does not exist", tablename );
834  return rei->status;
835  }
836 
837  generalRowPurgeInp.tableName = tablename;
838  snprintf( secAgo, MAXLEN, "%i", elapseTime );
839  generalRowPurgeInp.secondsAgo = secAgo;
840  rc = rsGeneralRowPurge( rsComm, &generalRowPurgeInp );
841 
842  if ( rc != 0 && rc != CAT_SUCCESS_BUT_WITH_NO_INFO ) {
843  rodsLog( LOG_ERROR, "msiFlushMonStat failed, error %i", rc );
844  }
845 
846  return rei->status;
847 }
848 
849 
903 int msiDigestMonStat( msParam_t *cpu_wght, msParam_t *mem_wght, msParam_t *swap_wght, msParam_t *runq_wght,
904  msParam_t *disk_wght, msParam_t *netin_wght, msParam_t *netout_wght,
905  ruleExecInfo_t *rei ) {
906  char rescList[MAX_NSERVERS][MAX_NAME_LEN], *tResult,
907  timeList[MAX_NSERVERS][MAX_NAME_LEN];
908  char condStr1[MAX_NAME_LEN], condStr2[MAX_NAME_LEN], loadStr[MAX_NAME_LEN];
909  int i, j, loadFactor, nresc, rc, status, totalWeight, weight[NRESULT];
910  rsComm_t *rsComm;
911  generalRowInsertInp_t generalRowInsertInp;
912  genQueryInp_t genQueryInp;
913  genQueryOut_t *genQueryOut = NULL;
914 
915  RE_TEST_MACRO( " Calling msiDigestMonStat" );
916 
917  if ( rei == NULL || rei->rsComm == NULL ) {
919  "msiDigestMonStat: input rei or rsComm is NULL" );
921  }
922 
923  rsComm = rei->rsComm;
924 
925  if ( cpu_wght == NULL || mem_wght == NULL || swap_wght == NULL || runq_wght == NULL
926  || disk_wght == NULL || netin_wght == NULL || netout_wght == NULL ) {
927  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
928  "msiDigestMonStat: at least one of the input param is NULL" );
929  return rei->status;
930  }
931 
932  if ( strcmp( cpu_wght->type, STR_MS_T ) == 0 ) {
933  weight[0] = atoi( ( const char* )cpu_wght->inOutStruct );
934  }
935  else {
936  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
937  "msiDigestMonStat: Unsupported input cpu_wght type %s",
938  cpu_wght->type );
939  return rei->status;
940  }
941 
942  if ( strcmp( mem_wght->type, STR_MS_T ) == 0 ) {
943  weight[1] = atoi( ( const char* )mem_wght->inOutStruct );
944  }
945  else {
946  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
947  "msiDigestMonStat: Unsupported input mem_wght type %s",
948  mem_wght->type );
949  return rei->status;
950  }
951 
952  if ( strcmp( swap_wght->type, STR_MS_T ) == 0 ) {
953  weight[2] = atoi( ( const char* )swap_wght->inOutStruct );
954  }
955  else {
956  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
957  "msiDigestMonStat: Unsupported input swap_wght type %s",
958  swap_wght->type );
959  return rei->status;
960  }
961 
962  if ( strcmp( runq_wght->type, STR_MS_T ) == 0 ) {
963  weight[3] = atoi( ( const char* )runq_wght->inOutStruct );
964  }
965  else {
966  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
967  "msiDigestMonStat: Unsupported input runq_wght type %s",
968  runq_wght->type );
969  return rei->status;
970  }
971 
972  if ( strcmp( disk_wght->type, STR_MS_T ) == 0 ) {
973  weight[4] = atoi( ( const char* )disk_wght->inOutStruct );
974  }
975  else {
976  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
977  "msiDigestMonStat: Unsupported input disk_wght type %s",
978  disk_wght->type );
979  return rei->status;
980  }
981 
982  if ( strcmp( netin_wght->type, STR_MS_T ) == 0 ) {
983  weight[5] = atoi( ( const char* )netin_wght->inOutStruct );
984  }
985  else {
986  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
987  "msiDigestMonStat: Unsupported input netin_wght type %s",
988  netin_wght->type );
989  return rei->status;
990  }
991 
992  if ( strcmp( netout_wght->type, STR_MS_T ) == 0 ) {
993  weight[6] = atoi( ( const char* )netout_wght->inOutStruct );
994  }
995  else {
996  rodsLogAndErrorMsg( LOG_ERROR, &rsComm->rError, rei->status,
997  "msiDigestMonStat: Unsupported input netout_wght type %s",
998  netout_wght->type );
999  return rei->status;
1000  }
1001 
1002  totalWeight = 0;
1003  for ( i = 0; i < NRESULT; i++ ) {
1004  totalWeight += weight[i];
1005  }
1006 
1007  memset( &genQueryInp, 0, sizeof( genQueryInp ) );
1008  addInxIval( &genQueryInp.selectInp, COL_SL_RESC_NAME, 1 );
1010  genQueryInp.maxRows = MAX_SQL_ROWS;
1011  status = rsGenQuery( rsComm, &genQueryInp, &genQueryOut );
1012  if ( NULL == genQueryOut ) { // JMC cppcheck - nullptr
1013  rodsLog( LOG_ERROR, "msiDigestMonStat :: &genQueryOut is NULL" );
1014  return rei->status;
1015  }
1016  if ( status == 0 ) {
1017  nresc = genQueryOut->rowCnt;
1018  for ( i = 0; i < genQueryOut->attriCnt; i++ ) {
1019  for ( j = 0; j < nresc; j++ ) {
1020  tResult = genQueryOut->sqlResult[i].value;
1021  tResult += j * genQueryOut->sqlResult[i].len;
1022  if ( i == 0 ) {
1023  rstrcpy( rescList[j], tResult, genQueryOut->sqlResult[i].len );
1024  }
1025  if ( i == 1 ) {
1026  rstrcpy( timeList[j], tResult, genQueryOut->sqlResult[i].len );
1027  }
1028  }
1029  }
1030  }
1031  else {
1032  rodsLog( LOG_ERROR, "msiDigestMonStat: Unable to retrieve information \
1033  from R_SERVER_LOAD" );
1034  return rei->status;
1035  }
1036 
1037  memset( &genQueryInp, 0, sizeof( genQueryInp ) );
1038  addInxIval( &genQueryInp.selectInp, COL_SL_CPU_USED, 1 );
1039  addInxIval( &genQueryInp.selectInp, COL_SL_MEM_USED, 1 );
1040  addInxIval( &genQueryInp.selectInp, COL_SL_SWAP_USED, 1 );
1041  addInxIval( &genQueryInp.selectInp, COL_SL_RUNQ_LOAD, 1 );
1042  addInxIval( &genQueryInp.selectInp, COL_SL_DISK_SPACE, 1 );
1043  addInxIval( &genQueryInp.selectInp, COL_SL_NET_INPUT, 1 );
1044  addInxIval( &genQueryInp.selectInp, COL_SL_NET_OUTPUT, 1 );
1045  genQueryInp.maxRows = 1;
1046  generalRowInsertInp.tableName = "serverloaddigest";
1047  for ( i = 0; i < nresc; i++ ) {
1048  memset( &genQueryInp.sqlCondInp, 0, sizeof( genQueryInp.sqlCondInp ) );
1049  snprintf( condStr1, MAX_NAME_LEN, "= '%s'", rescList[i] );
1050  addInxVal( &genQueryInp.sqlCondInp, COL_SL_RESC_NAME, condStr1 );
1051  snprintf( condStr2, MAX_NAME_LEN, "= '%s'", timeList[i] );
1052  addInxVal( &genQueryInp.sqlCondInp, COL_SL_CREATE_TIME, condStr2 );
1053  status = rsGenQuery( rsComm, &genQueryInp, &genQueryOut );
1054  if ( status == 0 ) {
1055  loadFactor = 0;
1056  for ( j = 0; j < genQueryOut->attriCnt; j++ ) {
1057  tResult = genQueryOut->sqlResult[j].value;
1058  loadFactor += atoi( tResult ) * weight[j];
1059  }
1060  loadFactor = loadFactor / totalWeight;
1061  generalRowInsertInp.arg1 = rescList[i];
1062  snprintf( loadStr, MAX_NAME_LEN, "%i", loadFactor );
1063  generalRowInsertInp.arg2 = loadStr;
1064  rc = rsGeneralRowInsert( rsComm, &generalRowInsertInp );
1065  if ( rc != 0 ) {
1066  rodsLog( LOG_ERROR, "msiDigestMonStat: Unable to ingest\
1067  information into from R_SERVER_LOAD_DIGEST table" );
1068  }
1069  }
1070  }
1071 
1072  clearGenQueryInp( &genQueryInp );
1073  freeGenQueryOut( &genQueryOut );
1074 
1075  return rei->status;
1076 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
MAX_SQL_ROWS
#define MAX_SQL_ROWS
Definition: rodsGenQuery.h:16
NULL
#define NULL
Definition: rodsDef.h:70
MAXLEN
#define MAXLEN
Definition: reIn2p3SysRule.hpp:24
rstrcat
char * rstrcat(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:75
COL_SL_RUNQ_LOAD
#define COL_SL_RUNQ_LOAD
Definition: rodsGenQuery.h:373
rsComm_t
Definition: rcConnect.h:145
COL_R_RESC_NAME
#define COL_R_RESC_NAME
Definition: rodsGenQuery.h:144
irods::get_full_path_for_config_file
error get_full_path_for_config_file(const std::string &, std::string &)
Definition: irods_get_full_path_for_config_file.cpp:20
thrInp_t::rescName
char rescName[(1024+64)]
Definition: reIn2p3SysRule.hpp:48
generalRowPurgeInp_t::secondsAgo
char * secondsAgo
Definition: generalRowPurge.h:8
SYS_INTERNAL_NULL_INPUT_ERR
@ SYS_INTERNAL_NULL_INPUT_ERR
Definition: rodsErrorTable.h:92
rsGeneralRowPurge
int rsGeneralRowPurge(rsComm_t *rsComm, generalRowPurgeInp_t *generalRowPurgeInp)
Definition: rsGeneralRowPurge.cpp:13
COL_R_RESC_STATUS
#define COL_R_RESC_STATUS
Definition: rodsGenQuery.h:155
MON_PERF_SCRIPT
#define MON_PERF_SCRIPT
Definition: reIn2p3SysRule.hpp:30
generalRowPurgeInp_t::tableName
char * tableName
Definition: generalRowPurge.h:7
COL_R_LOC
#define COL_R_LOC
Definition: rodsGenQuery.h:148
MON_CFG_FILE
#define MON_CFG_FILE
Definition: reIn2p3SysRule.hpp:31
ExecCmdOut
Definition: execCmd.h:20
generalAdminInp_t
Definition: generalAdmin.h:6
UNMATCHED_KEY_OR_INDEX
@ UNMATCHED_KEY_OR_INDEX
Definition: rodsErrorTable.h:244
reDataObjOpr.hpp
thrInp_t::threadId
int threadId
Definition: reIn2p3SysRule.hpp:46
userInfo_t::userName
char userName[64]
Definition: rodsUser.h:66
irods_get_full_path_for_config_file.hpp
irods_stacktrace.hpp
RuleExecInfo::status
int status
Definition: irods_re_structs.hpp:19
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
startMonScript
void * startMonScript(void *arg)
Definition: reIn2p3SysRule.cpp:244
generalRowInsertInp_t::arg9
const char * arg9
Definition: generalRowInsert.h:16
getListOfResc
int getListOfResc(rsComm_t *rsComm, char serverList[512][(1024+64)], int nservers, monInfo_t monList[512], int *nlist)
Definition: reIn2p3SysRule.cpp:163
GenQueryInp
Definition: rodsGenQuery.h:24
generalRowInsertInp_t::arg2
const char * arg2
Definition: generalRowInsert.h:9
irods::configuration_parser::get
T & get(const std::string &_key)
Definition: irods_configuration_parser.hpp:76
SELECT_MAX
#define SELECT_MAX
Definition: rodsGenQuery.h:103
generate_iadmin_commands_for_41_to_42_upgrade.output
output
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:21
generalRowInsertInp_t::arg6
const char * arg6
Definition: generalRowInsert.h:13
rcMisc.h
generalRowInsertInp_t::arg7
const char * arg7
Definition: generalRowInsert.h:14
reIn2p3SysRule.hpp
checkHostAccessControl
int checkHostAccessControl(const std::string &_user_name, const std::string &_host_client, const std::string &_groups_name)
Definition: reIn2p3SysRule.cpp:318
BUNDLE_RESC
#define BUNDLE_RESC
Definition: phyBundleColl.h:11
LONG_NAME_LEN
#define LONG_NAME_LEN
Definition: rodsDef.h:57
monInfo_t
Definition: reIn2p3SysRule.hpp:52
rsGeneralRowPurge.hpp
generalAdminInp_t::arg4
const char * arg4
Definition: generalAdmin.h:11
monInfo_t::vaultPath
char vaultPath[256]
Definition: reIn2p3SysRule.hpp:56
rsGeneralAdmin
int rsGeneralAdmin(rsComm_t *rsComm, generalAdminInp_t *generalAdminInp)
Definition: rsGeneralAdmin.cpp:183
addInxVal
int addInxVal(inxValPair_t *inxValPair, int inx, const char *value)
Definition: rcMisc.cpp:921
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
generalAdminInp_t::arg0
const char * arg0
Definition: generalAdmin.h:7
MsParam::type
char * type
Definition: msParam.h:78
GenQueryInp::selectInp
inxIvalPair_t selectInp
Definition: rodsGenQuery.h:53
GenQueryInp::maxRows
int maxRows
Definition: rodsGenQuery.h:25
GenQueryOut::sqlResult
sqlResult_t sqlResult[50]
Definition: rodsGenQuery.h:72
OUTPUT_MON_PERF
#define OUTPUT_MON_PERF
Definition: reIn2p3SysRule.hpp:33
STR_MS_T
#define STR_MS_T
Definition: msParam.h:21
generalRowInsertInp_t::arg4
const char * arg4
Definition: generalRowInsert.h:11
rsGeneralAdmin.hpp
RuleExecInfo::rsComm
rsComm_t * rsComm
Definition: irods_re_structs.hpp:22
generalAdminInp_t::arg3
const char * arg3
Definition: generalAdmin.h:10
MAX_VALUE
#define MAX_VALUE
Definition: reIn2p3SysRule.hpp:34
generate_iadmin_commands_for_41_to_42_upgrade.cmd
list cmd
Definition: generate_iadmin_commands_for_41_to_42_upgrade.py:19
COL_SL_DISK_SPACE
#define COL_SL_DISK_SPACE
Definition: rodsGenQuery.h:374
rsComm_t::rError
rError_t rError
Definition: rcConnect.h:158
irods::error::code
long long code() const
Definition: irods_error.cpp:194
thrInp_t
Definition: reIn2p3SysRule.hpp:41
rodsLogAndErrorMsg
void rodsLogAndErrorMsg(int level, rError_t *myError, int status, const char *formatStr,...)
Definition: rodsLog.cpp:231
msiExecCmd
int msiExecCmd(msParam_t *inpParam1, msParam_t *inpParam2, msParam_t *inpParam3, msParam_t *inpParam4, msParam_t *inpParam5, msParam_t *outParam, ruleExecInfo_t *rei)
Definition: reDataObjOpr.cpp:2659
generalRowInsertInp_t
Definition: generalRowInsert.h:6
msiDigestMonStat
int msiDigestMonStat(msParam_t *cpu_wght, msParam_t *mem_wght, msParam_t *swap_wght, msParam_t *runq_wght, msParam_t *disk_wght, msParam_t *netin_wght, msParam_t *netout_wght, ruleExecInfo_t *rei)
Definition: reIn2p3SysRule.cpp:903
generalAdminInp_t::arg1
const char * arg1
Definition: generalAdmin.h:8
COL_USER_NAME
#define COL_USER_NAME
Definition: rodsGenQuery.h:132
generalRowInsertInp_t::arg1
const char * arg1
Definition: generalRowInsert.h:8
generalRowInsertInp_t::arg8
const char * arg8
Definition: generalRowInsert.h:15
irods::configuration_parser
Definition: irods_configuration_parser.hpp:20
GenQueryInp::sqlCondInp
inxValPair_t sqlCondInp
Definition: rodsGenQuery.h:56
irods::configuration_parser::load
error load(const std::string &)
Definition: irods_configuration_parser.cpp:72
genQuery.h
rsComm_t::remoteAddr
struct sockaddr_in remoteAddr
Definition: rcConnect.h:150
generalRowPurgeInp_t
Definition: generalRowPurge.h:6
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
terminate_irods_processes.e
e
Definition: terminate_irods_processes.py:19
my_mutex
static pthread_mutex_t my_mutex
Definition: reIn2p3SysRule.cpp:22
MAX_NSERVERS
#define MAX_NSERVERS
Definition: reIn2p3SysRule.hpp:36
addInxIval
int addInxIval(inxIvalPair_t *inxIvalPair, int inx, int value)
Definition: rcMisc.cpp:883
INVALID_ANY_CAST
@ INVALID_ANY_CAST
Definition: rodsErrorTable.h:771
KEY_NOT_FOUND
@ KEY_NOT_FOUND
Definition: rodsErrorTable.h:749
GenQueryOut
Definition: rodsGenQuery.h:67
MAXSTR
#define MAXSTR
Definition: reIn2p3SysRule.hpp:25
COL_R_TYPE_NAME
#define COL_R_TYPE_NAME
Definition: rodsGenQuery.h:146
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
GenQueryOut::attriCnt
int attriCnt
Definition: rodsGenQuery.h:69
rsGeneralRowInsert
int rsGeneralRowInsert(rsComm_t *rsComm, generalRowInsertInp_t *generalRowInsertInp)
Definition: rsGeneralRowInsert.cpp:13
MsParam
Definition: msParam.h:76
threadIsAlive
short threadIsAlive[512]
Definition: reIn2p3SysRule.cpp:36
GenQueryOut::rowCnt
int rowCnt
Definition: rodsGenQuery.h:68
irods::log
void log(const error &)
Definition: irods_log.cpp:13
generalAdminInp_t::arg2
const char * arg2
Definition: generalAdmin.h:9
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
COL_SL_CREATE_TIME
#define COL_SL_CREATE_TIME
Definition: rodsGenQuery.h:378
rsComm_t::clientUser
userInfo_t clientUser
Definition: rcConnect.h:153
thrInp_t::hintPath
char hintPath[(1024+64)]
Definition: reIn2p3SysRule.hpp:45
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
CAT_SUCCESS_BUT_WITH_NO_INFO
@ CAT_SUCCESS_BUT_WITH_NO_INFO
Definition: rodsErrorTable.h:434
irods::error
Definition: irods_error.hpp:23
COL_SL_SWAP_USED
#define COL_SL_SWAP_USED
Definition: rodsGenQuery.h:372
COL_SL_NET_OUTPUT
#define COL_SL_NET_OUTPUT
Definition: rodsGenQuery.h:377
COL_SL_CPU_USED
#define COL_SL_CPU_USED
Definition: rodsGenQuery.h:370
MON_OUTPUT_NO_ANSWER
#define MON_OUTPUT_NO_ANSWER
Definition: reIn2p3SysRule.hpp:38
MAX_MESSAGE_SIZE
#define MAX_MESSAGE_SIZE
Definition: reIn2p3SysRule.hpp:35
rsGeneralRowInsert.hpp
get_db_schema_version.l
l
Definition: get_db_schema_version.py:19
SqlResult::value
char * value
Definition: rodsGenQuery.h:64
thrInp_t::cmdArgv
char cmdArgv[100000]
Definition: reIn2p3SysRule.hpp:43
msiServerMonPerf
int msiServerMonPerf(msParam_t *verb, msParam_t *ptime, ruleExecInfo_t *rei)
Definition: reIn2p3SysRule.cpp:564
COL_SL_MEM_USED
#define COL_SL_MEM_USED
Definition: rodsGenQuery.h:371
NRESULT
#define NRESULT
Definition: reIn2p3SysRule.hpp:32
fillStrInMsParam
void fillStrInMsParam(msParam_t *msParam, const char *myStr)
Definition: msParam.cpp:278
rodsMonPerfLog
int rodsMonPerfLog(char *serverName, char *resc, char *output, ruleExecInfo_t *rei)
Definition: reIn2p3SysRule.cpp:38
LEN_SECONDS
#define LEN_SECONDS
Definition: reIn2p3SysRule.hpp:39
generalRowInsertInp_t::arg5
const char * arg5
Definition: generalRowInsert.h:12
RuleExecInfo
Definition: irods_re_structs.hpp:18
rodsLogError
void rodsLogError(int level, int errCode, char *formatStr,...)
Definition: rodsLog.cpp:422
RE_TEST_MACRO
#define RE_TEST_MACRO(msg)
Definition: reDefines.h:58
msiCheckHostAccessControl
int msiCheckHostAccessControl(ruleExecInfo_t *rei)
Definition: reIn2p3SysRule.cpp:470
irods::exception
Definition: irods_exception.hpp:15
SqlResult::len
int len
Definition: rodsGenQuery.h:63
irods_configuration_parser.hpp
phyBundleColl.h
COL_USER_GROUP_NAME
#define COL_USER_GROUP_NAME
Definition: rodsGenQuery.h:318
fillIntInMsParam
void fillIntInMsParam(msParam_t *msParam, const int myInt)
Definition: msParam.cpp:242
generalRowInsertInp_t::tableName
const char * tableName
Definition: generalRowInsert.h:7
rodsErrorTable.h
COL_SL_RESC_NAME
#define COL_SL_RESC_NAME
Definition: rodsGenQuery.h:369
rsGenQuery.hpp
thrInp_t::addPathToArgv
int addPathToArgv
Definition: reIn2p3SysRule.hpp:47
MsParam::inOutStruct
void * inOutStruct
Definition: msParam.h:80
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
TIMEOUT
#define TIMEOUT
Definition: reIn2p3SysRule.hpp:37
thrInp_t::execAddr
char execAddr[256]
Definition: reIn2p3SysRule.hpp:44
COL_SL_NET_INPUT
#define COL_SL_NET_INPUT
Definition: rodsGenQuery.h:375
freeGenQueryOut
int freeGenQueryOut(genQueryOut_t **genQueryOut)
Definition: rcMisc.cpp:1133
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
clearGenQueryInp
void clearGenQueryInp(void *voidInp)
Definition: rcMisc.cpp:1118
generalRowInsertInp_t::arg3
const char * arg3
Definition: generalRowInsert.h:10
HOST_ACCESS_CONTROL_FILE
const std::string HOST_ACCESS_CONTROL_FILE("HostAccessControl")
thrInp_t::cmd
char cmd[256]
Definition: reIn2p3SysRule.hpp:42
rsGenQuery
int rsGenQuery(rsComm_t *rsComm, genQueryInp_t *genQueryInp, genQueryOut_t **genQueryOut)
Definition: rsGenQuery.cpp:604
RESC_AUTO_UP
#define RESC_AUTO_UP
Definition: rodsDef.h:278
thrInp_t::rei
ruleExecInfo_t rei
Definition: reIn2p3SysRule.hpp:49
RESC_AUTO_DOWN
#define RESC_AUTO_DOWN
Definition: rodsDef.h:279
irods.pyparsing.line
def line(loc, strg)
Definition: pyparsing.py:728
msiFlushMonStat
int msiFlushMonStat(msParam_t *inpParam1, msParam_t *inpParam2, ruleExecInfo_t *rei)
Definition: reIn2p3SysRule.cpp:774
COL_R_VAULT_PATH
#define COL_R_VAULT_PATH
Definition: rodsGenQuery.h:149