42 main(
int argc,
char **argv)
44 const char *args =
"hpgatdcfvqxl:m:n:";
52 bool newformat =
FALSE;
65 memset(host, 0,
sizeof (host));
67 while ((c = getopt(argc, argv, args)) != -1)
113 if (strcmp(
"s", optarg) == 0)
118 if (strcmp(
"e", optarg) == 0)
123 if (strcmp(
"re", optarg) == 0)
128 if (strcmp(
"rg", optarg) == 0)
133 if (strcmp(
"b", optarg) == 0)
138 if (strcmp(
"rb", optarg) == 0)
143 if (strcmp(
"rm", optarg) == 0)
148 if (strcmp(
"ro", optarg) == 0)
153 if (strcmp(
"t", optarg) == 0)
158 if (strcmp(
"rt", optarg) == 0)
163 if (strcmp(
"r", optarg) == 0)
168 if (strcmp(
"rr", optarg) == 0)
173 if (strcmp(
"c", optarg) == 0)
178 if (strcmp(
"x", optarg) == 0)
183 if (strcmp(
"st", optarg) == 0)
198 nbRecs = atoi(optarg);
201 printf(
"Error ... \n");
205 if (optind < argc && strlen(argv[optind]) > 0)
206 snprintf(host,
sizeof (host),
"%s", argv[optind]);
208 if (!(jp || jt || jg || jq || jx))
221 if (jp > 0 || jg > 0)
223 if (
dump_state(STDOUT_FILENO, jp, jg, verbose, newformat) > 0)
230 char *dbenv = getenv(
"DBENV");
238 memset(dbdir, 0,
sizeof (dbdir));
239 if (dir != NULL && strlen(dir) > 0)
240 snprintf(dbdir,
sizeof (dbdir),
"%s/%s", dir,
"db");
266 char *p = NULL, *name = NULL;
270 if (strlen(host) > 0)
280 printf(
"%-30s : %s\n",
"Version",
PACKAGE);
288 if (!(jp || jt || jg || jq || jx))
301 printf(
"Usage : ze-printstats options\n" 302 " ze-printstats -c conf_file\n" 303 " ze-printstats -a | -p | -g\n" 304 " -p : print running process ze-filter counters\n" 305 " -g : print ze-filter counters from last reset\n" 306 " -a : print both counters\n" 307 " ze-printstats -t[td]\n" 308 " -t : throttle data (summary)\n" 309 " -tt : throttle data (detail)\n" 310 " -d : resolve IP addresses\n" 312 " all,conn,rcpt,bounce,msgs,vol,svc\n" 313 " -l : period of interest - default value : 10m\n" 314 " period shall be smaller than 20m - default unit : s\n" 315 " -n N : max number of records to print\n" 316 " ze-printstats -q [-l dt [s|m|h|d]] [[-v | ip | hostname] | [-m x]]\n" 317 " -q : query gateway activity\n" 318 " -l : period of interest - default unit : secs\n" 319 " -v : verbose - meaninful only if gateway not specified\n" 320 " prints summary for each client gateway\n" 321 " -m x : select type of summary\n" 322 " x = s : Connection summary\n" 323 " x = e : Client doing empty connections\n" 324 " x = re : Client doing empty connections - reject\n" 325 " x = ro : Too much open connections - reject\n" 326 " x = rt : Connection rate too high - reject\n" 327 " x = rb : Too many bad recipients - reject\n" 328 " x = rg : Clients with messages rejected by greylisting\n" 329 " x = r : Clients with bad DNS resolution\n" 330 " x = rr : Clients with bad DNS resolution - reject\n" 331 " x = c : Clients being rejected by content checking\n" 332 " x = x : Clients sending X-Files or Virus\n" 333 " x = rm : Messages with BAD MX for sender domain\n" 334 " x = st : Clients sending messages to SpamTraps\n" 335 " -n N : max number of records to print\n\n"
int smtprate_update_table(time_t)
void res_history_summary(History_T *, char *, time_t, time_t, bool, bool, int, int)
uint32_t smtprate_str2flags(char *)
int main(int argc, char **argv)
bool resolve_cache_init(char *dbdir, int rwmode)
bool res_history_update(History_T *, char *, time_t, time_t, bool)
int dump_state(int, int, int, int, int)
void zeLog_SetOutput(bool, bool)
bool open_work_db_env(char *defdir, char *cfdir, bool rdonly)
bool raw_history_open(bool)
int smtprate_read_table(char *)
void init_default_file_extensions()
char * cf_get_str(int id)
int configure(char *, char *, bool)
#define STRCASEEQUAL(a, b)
bool get_hostbyname(char *name, char *ip, int len)
time_t zeStr2time(char *s, int *error, time_t dval)
void smtprate_print_table(int, int, int, int, time_t, uint32_t, int)