40 lines
772 B
C
40 lines
772 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <string.h>
|
|
#include "ic.h"
|
|
|
|
int main(int argc, char *argv[], char *argp[]){
|
|
char buf[300];
|
|
char host[64];
|
|
char account[64];
|
|
char pwd[64];
|
|
|
|
if (argc < 3){
|
|
printf("Usage: ./main <host> <user> <passwd>");
|
|
return 0;
|
|
}
|
|
|
|
memcpy(host, argv[1], 64);
|
|
memcpy(account, argv[2], 64);
|
|
memcpy(pwd, argv[3], 64);
|
|
printf("Host: %s\n", host);
|
|
printf("Account: %s\n", account);
|
|
printf("Pwd: %s\n", pwd);
|
|
|
|
ic_influx_database(host, 8086, "tcp");
|
|
ic_influx_userpw(account, pwd);
|
|
ic_debug(2);
|
|
|
|
snprintf(buf, 300, "host=%s", host);
|
|
ic_tags(buf);
|
|
|
|
ic_measure("tcp_reset");
|
|
|
|
ic_string("ipsrc", "192.168.1.1");
|
|
|
|
ic_measureend();
|
|
ic_push();
|
|
|
|
return 0;
|
|
}
|