diff -Naur ganglia-monitor-core-2.5.7/gmond/gmond.conf ganglia-monitor-core-2.5.7-mod/gmond/gmond.conf --- ganglia-monitor-core-2.5.7/gmond/gmond.conf 2004-01-20 17:15:23.000000000 -0200 +++ ganglia-monitor-core-2.5.7-mod/gmond/gmond.conf 2005-02-09 04:04:26.000000000 -0200 @@ -117,3 +117,7 @@ # number of seconds. # default: 0 (immortal) # host_dmax 108000 +# +# If you want to change the listening interval, then specify a value.(gappmon) +# default: 0 (gmond uses a random number between 10 and 20) +# heartbeat 0 diff -Naur ganglia-monitor-core-2.5.7/gmond/monitor.c ganglia-monitor-core-2.5.7-mod/gmond/monitor.c --- ganglia-monitor-core-2.5.7/gmond/monitor.c 2003-04-16 18:46:44.000000000 -0300 +++ ganglia-monitor-core-2.5.7-mod/gmond/monitor.c 2005-02-09 04:04:37.000000000 -0200 @@ -2,6 +2,7 @@ #include "ganglia.h" #include "metric_typedefs.h" #include "key_metrics.h" +#include extern metric_t metric[]; @@ -9,6 +10,7 @@ extern g_mcast_socket * mcast_socket; extern pthread_mutex_t mcast_socket_mutex; +extern gmond_config_t gmond_config; void set_check_threshold ( uint32_t key ); void set_mcast_threshold ( uint32_t key ); @@ -113,7 +115,15 @@ metric[i].mcast_threshold = 0; } } - + + /* Set the value for heartbeat, by Marcelo veiga Neves (to support gappmon)*/ + if(gmond_config.heartbeat != 0) { + metric[heartbeat].mcast_max = gmond_config.heartbeat + (gmond_config.heartbeat/4); + metric[heartbeat].mcast_min = gmond_config.heartbeat - (gmond_config.heartbeat/4); + if(gmond_config.heartbeat/4 == 0) + metric[heartbeat].mcast_min = -1; + } + for (;;) { for (i = 1 ; i < num_key_metrics; i++ ) diff -Naur ganglia-monitor-core-2.5.7/lib/ganglia/gmond_config.h ganglia-monitor-core-2.5.7-mod/lib/ganglia/gmond_config.h --- ganglia-monitor-core-2.5.7/lib/ganglia/gmond_config.h 2004-01-20 17:15:40.000000000 -0200 +++ ganglia-monitor-core-2.5.7-mod/lib/ganglia/gmond_config.h 2005-02-09 04:04:26.000000000 -0200 @@ -33,6 +33,7 @@ long int no_gexec; long int all_trusted; long int host_dmax; + int heartbeat; } gmond_config_t; int get_gmond_config( char *conffile); diff -Naur ganglia-monitor-core-2.5.7/lib/gmond_config.c ganglia-monitor-core-2.5.7-mod/lib/gmond_config.c --- ganglia-monitor-core-2.5.7/lib/gmond_config.c 2004-01-20 17:15:40.000000000 -0200 +++ ganglia-monitor-core-2.5.7-mod/lib/gmond_config.c 2005-02-09 04:04:26.000000000 -0200 @@ -208,6 +208,13 @@ return NULL; } +static DOTCONF_CB(cb_heartbeat) +{ + gmond_config_t *c = (gmond_config_t *)cmd->option->info; + c->heartbeat = cmd->data.value; + return NULL; +} + static int set_defaults(gmond_config_t *config ) { @@ -235,7 +242,7 @@ config->no_gexec = 0; config->all_trusted = 0; config->host_dmax = 0; - + config->heartbeat = 0; return 0; } @@ -270,6 +277,7 @@ printf("no_gexec is %ld\n", config->no_gexec); printf("all_trusted is %ld\n", config->all_trusted); printf("host_dmax is %ld\n", config->host_dmax); + printf("heartbeat is %d\n", config->heartbeat); } int @@ -304,6 +312,7 @@ {"no_gexec", ARG_TOGGLE, cb_no_gexec, &gmond_config, 0}, {"all_trusted", ARG_TOGGLE, cb_all_trusted, &gmond_config, 0}, {"host_dmax", ARG_INT, cb_host_dmax, &gmond_config, 0}, + {"heartbeat", ARG_INT, cb_heartbeat, &gmond_config, 0}, LAST_OPTION };