From: Costa Tsaousis (ktsaou) Date: Tue, 1 Nov 2016 22:14:14 +0000 (+0200) Subject: converted netdata charts to area charts; added netdata to trace_flag; fixed compiler... X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4897b015b420d27337cddb0a2db50881c0ba1ce6;p=fping.git converted netdata charts to area charts; added netdata to trace_flag; fixed compiler warning about setuid --- diff --git a/ci/test-15-netdata.pl b/ci/test-15-netdata.pl index 6e820ea..7406347 100755 --- a/ci/test-15-netdata.pl +++ b/ci/test-15-netdata.pl @@ -16,12 +16,12 @@ BEGIN fping\.127_0_0_1_packets SET xmt = 1 SET rcv = 1 END -CHART fping\.127_0_0_1_quality '' 'FPing Quality for host 127\.0\.0\.1' percentage '127_0_0_1' fping\.quality line 110010 1 +CHART fping\.127_0_0_1_quality '' 'FPing Quality for host 127\.0\.0\.1' percentage '127_0_0_1' fping\.quality area 110010 1 DIMENSION returned '' absolute 1 1 BEGIN fping\.127_0_0_1_quality SET returned = 100 END -CHART fping\.127_0_0_1_latency '' 'FPing Latency for host 127\.0\.0\.1' ms '127_0_0_1' fping\.latency line 110000 1 +CHART fping\.127_0_0_1_latency '' 'FPing Latency for host 127\.0\.0\.1' ms '127_0_0_1' fping\.latency area 110000 1 DIMENSION min minimum absolute 10 1000 DIMENSION max maximum absolute 10 1000 DIMENSION avg average absolute 10 1000 diff --git a/src/fping.c b/src/fping.c index cc5d715..205638a 100644 --- a/src/fping.c +++ b/src/fping.c @@ -369,7 +369,8 @@ int main( int argc, char **argv ) if((uid = getuid())) { /* drop privileges */ - setuid( getuid() ); + if(setuid( getuid() ) == -1) + perror("cannot setuid"); } prog = argv[0]; @@ -717,6 +718,7 @@ int main( int argc, char **argv ) if( sent_times_flag ) fprintf( stderr, " sent_times_flag set\n" ); if( print_per_system_flag ) fprintf( stderr, " print_per_system_flag set\n" ); if( outage_flag ) fprintf( stderr, " outage_flag set\n" ); + if( netdata_flag ) fprintf( stderr, " netdata_flag set\n" ); }/* IF */ #endif /* DEBUG || _DEBUG */ @@ -1319,7 +1321,7 @@ void print_netdata( void ) printf("END\n"); if(!sent_charts) { - printf("CHART fping.%s_quality '' 'FPing Quality for host %s' percentage '%s' fping.quality line 110010 %d\n", h->name, h->host, h->name, report_interval / 100000); + printf("CHART fping.%s_quality '' 'FPing Quality for host %s' percentage '%s' fping.quality area 110010 %d\n", h->name, h->host, h->name, report_interval / 100000); printf("DIMENSION returned '' absolute 1 1\n"); /* printf("DIMENSION lost '' absolute 1 1\n"); */ } @@ -1346,7 +1348,7 @@ void print_netdata( void ) printf("END\n"); if(!sent_charts) { - printf("CHART fping.%s_latency '' 'FPing Latency for host %s' ms '%s' fping.latency line 110000 %d\n", h->name, h->host, h->name, report_interval / 100000); + printf("CHART fping.%s_latency '' 'FPing Latency for host %s' ms '%s' fping.latency area 110000 %d\n", h->name, h->host, h->name, report_interval / 100000); printf("DIMENSION min minimum absolute 10 1000\n"); printf("DIMENSION max maximum absolute 10 1000\n"); printf("DIMENSION avg average absolute 10 1000\n");