#include <cmd.h>
#include <signal.h>
#include <afs/param.h>
+#include <afsconfig.h>
#undef IN
#include <sys/socket.h>
#include <netdb.h>
#endif
+#include <ctype.h>
#include <gtxwindows.h> /*Generic window package*/
#include <gtxobjects.h> /*Object definitions*/
char *name;
{
struct hostent *he;
+#ifdef AFS_SUN5_ENV
char ip_addr[32];
+#endif
he = gethostbyname(name);
#ifdef AFS_SUN5_ENV
int i;
int j;
int bufslot;
- int exitVal;
int code;
if (afsmon_debug) {
}
fprintf(debugFD,"\t\t-----End of List-----\n");
}
+ return(0);
} /* print_CM() */
char arg3[CFG_STR_LEN]; /* threshold value */
char arg4[CFG_STR_LEN]; /* user's handler */
struct hostent *he; /* host entry */
- int code;
- char ip_addr[32];
if (afsmon_debug) {
fprintf(debugFD,"[ %s ] Called, a_line = %s\n",rn, a_line);
char arg3[CFG_STR_LEN]; /* threshold value */
char arg4[CFG_STR_LEN]; /* user's handler */
char arg5[CFG_STR_LEN]; /* junk characters */
- struct hostent *he; /* host entry */
- int code;
if (afsmon_debug) {
fprintf(debugFD,"[ %s ] Called, a_line = %s\n",rn, a_line);
return(-1);
}
if (strlen(arg3) > THRESH_VAR_LEN-2) {
- fprintf(stderr,"[%s ] threshold value too long\n");
+ fprintf(stderr,"[%s ] threshold value too long\n", rn);
return(-1);
}
int fromIdx;
int toIdx;
int found;
- int idx; /* index to fs_categories[] */
+ int idx = 0; /* index to fs_categories[] */
int i;
int j;
struct afsmon_hostEntry *curr_host;
struct hostent *he; /* hostentry to resolve host name*/
char *handlerPtr; /* ptr to pass theresh handler string */
- int code; /* error code */
+ int code = 0; /* error code */
int linenum = 0; /* config file line number */
int threshCount; /* count of thresholds for each server */
int error_in_config; /* syntax errors in config file ?? */
arg2,arg3,handlerPtr);
else {
- fprintf(stderr,"[ %s ] Programming error 6\n");
+ fprintf(stderr,"[ %s ] Programming error 6\n", rn);
afsmon_Exit(40);
}
if (code) {
fclose(configFD);
-
+ return(0);
}
/*-----------------------------------------------------------------------
{ /* save_FS_results_inCB() */
static char rn[] = "save_FS_results_inCB"; /* routine name */
- int code; /* return status */
struct afsmon_fs_Results_list *tmp_fslist_item; /* temp fs list item */
struct xstat_fs_ProbeResults *tmp_fsPR; /* temp ptr */
int i;
static char rn[] = "save_FS_data_forDisplay"; /* routine name */
struct fs_Display_Data *curr_fsDataP; /* tmp ptr to curr_fsData*/
struct fs_Display_Data *prev_fsDataP; /* tmp ptr to prev_fsData*/
- struct afsmon_hostEntry *tmp_fsNames;
struct afsmon_hostEntry *curr_host;
static int probes_Received = 0; /* number of probes reveived in
the current cycle. If this is equal to numFS we got all
{ /* save_CM_results_inCB() */
static char rn[] = "save_CM_results_inCB"; /* routine name */
- int code; /* return status */
struct afsmon_cm_Results_list *tmp_cmlist_item; /* temp cm list item */
struct xstat_cm_ProbeResults *tmp_cmPR; /* temp ptr */
int i;
if (afsmon_debug) {
- fprintf(debugFD,"[ %s ] Called, a_newProbeCycle= %d\n",a_newProbeCycle);
+ fprintf(debugFD,"[ %s ] Called, a_newProbeCycle= %d\n",rn, a_newProbeCycle);
fflush(debugFD);
}
if (pValue > tValue) {
if (afsmon_debug) {
- fprintf(debugFD,"[ %s ] cm = %s, thresh ovf for %s, threshold= % s, probevalue= %s\n",
+ fprintf(debugFD,"[ %s ] cm = %s, thresh ovf for %s, threshold= %s, probevalue= %s\n",
rn, a_hostEntry->hostName, threshP->itemName, threshP->threshVal , a_Data->data[idx]);
fflush(debugFD);
}
static char rn[] = "save_CM_data_forDisplay"; /* routine name */
struct cm_Display_Data *curr_cmDataP;
struct cm_Display_Data *prev_cmDataP;
- struct afsmon_hostEntry *tmp_cmNames;
struct afsmon_hostEntry *curr_host;
static int probes_Received = 0; /* number of probes reveived in
the current cycle. If this is equal to numFS we got all
static char rn[] = "afsmon_CM_Handler"; /* routine name */
int code; /* return status */
int newProbeCycle; /* start of new probe cycle ? */
- int i;
if (afsmon_debug) {
fprintf(debugFD,
int CMinitFlags = 0; /* flags for xstat_cm_Init */
int code; /* function return code */
struct timeval tv; /* time structure */
- int i;
if (afsmon_debug) {
fprintf(debugFD,"[ %s ] Called\n",rn);
strncpy(fullhostname,curr_FS->hostName,sizeof(fullhostname));
he = GetHostByName(fullhostname);
if (he == (struct hostent *)0) {
- fprintf(stderr,"[ %s ] Cannot get host info for %s\n",fullhostname);
+ fprintf(stderr,"[ %s ] Cannot get host info for %s\n",rn, fullhostname);
return(-1);
}
strncpy(curr_FS->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
numCollIDs = 1;
collIDP = (afs_int32 *) malloc (sizeof (afs_int32));
if (collIDP == (afs_int32 *)0) {
- fprintf(stderr,"[ %s ] failed to allocate a measely afs_int32 word.Argh!\n");
+ fprintf(stderr,"[ %s ] failed to allocate a measely afs_int32 word.Argh!\n", rn);
return(-1);
}
*collIDP = 2; /* USE A macro for this */
strncpy(fullhostname,curr_CM->hostName,sizeof(fullhostname));
he = GetHostByName(fullhostname);
if (he == (struct hostent *)0) {
- fprintf(stderr,"[ %s ] Cannot get host info for %s\n",fullhostname);
+ fprintf(stderr,"[ %s ] Cannot get host info for %s\n",rn, fullhostname);
return(-1);
}
strncpy(curr_CM->hostName,he->h_name,HOST_NAME_LEN); /* complete name*/
numCollIDs = 1;
collIDP = (afs_int32 *) malloc (sizeof (afs_int32));
if (collIDP == (afs_int32 *)0) {
- fprintf(stderr,"[ %s ] failed to allocate a measely long word.Argh!\n");
+ fprintf(stderr,"[ %s ] failed to allocate a measely long word.Argh!\n", rn);
return(-1);
}
*collIDP = 2; /* USE A macro for this */
static char rn[] = "afsmonInit"; /* Routine name */
char *debug_filename; /* pointer to debug filename */
- char *config_filename; /* pointer to config filename */
FILE *outputFD; /* output file descriptor */
struct cmd_item *hostPtr; /* ptr to parse command line args */
char buf[256]; /* buffer for processing hostnames */
#include "AFS_component_version_number.c"
-main(argc, argv)
+int main(argc, argv)
int argc;
char **argv;
{ /* main() */
else
afsmon_Exit(2);
+ exit(0); /* redundant, but gets rid of warning */
} /*main*/