diff --git a/src/dbshow.c b/src/dbshow.c index 7b5e451..78cb4cb 100644 --- a/src/dbshow.c +++ b/src/dbshow.c @@ -869,7 +869,6 @@ void showhours(const interfaceinfo *interface) timeused_debug(__func__, 0); } -// TODO: alert needs new function due to different format // TODO: image? output below doesn't have much graphics potential, line in 5 minute graph could be one alternative // TODO: tests void show95thpercentile(const interfaceinfo *interface) diff --git a/src/percentile.c b/src/percentile.c index dcc6063..fa360b3 100644 --- a/src/percentile.c +++ b/src/percentile.c @@ -2,6 +2,7 @@ #include "dbsql.h" #include "percentile.h" +// TODO: tests int getpercentiledata(percentiledata *pdata, const char *iface) { uint32_t entry = 0, entrylimit; diff --git a/src/vnstat_func.c b/src/vnstat_func.c index e14cb56..7b0487e 100644 --- a/src/vnstat_func.c +++ b/src/vnstat_func.c @@ -685,7 +685,7 @@ int parsealertargs(PARAMS *p, char **argv) currentarg++; if (p->alerttype == AT_Percentile && (p->alertoutput == 2 || p->alertexit == 2)) { - printf("Error: Estimate conditions cannot be used in combination with selected alert type.\n"); + printf("Error: Estimate output and exit conditions cannot be used in combination with selected alert type.\n"); showalerthelp(); return 0; } @@ -721,6 +721,12 @@ int parsealertargs(PARAMS *p, char **argv) return 0; } + if (p->alerttype == AT_Percentile && (p->alertcondition == AC_RX_Estimate || p->alertcondition == AC_TX_Estimate || p->alertcondition == AC_Total_Estimate)) { + printf("Error: Estimate conditions cannot be used in combination with selected alert type.\n"); + showalerthelp(); + return 0; + } + // limit if (!isnumeric(argv[currentarg])) { printf("Error: Limit parameter for %s must be a greater than zero integer without decimals.\n", argv[0]);