Skip to content

Commit

Permalink
Merge branch 'develop' of ssh://stash.voipmonitor.org:7999/VS/sniffer…
Browse files Browse the repository at this point in the history
… into develop
  • Loading branch information
rbucek committed Jul 31, 2015
2 parents 6b59099 + 1142361 commit 3e507e1
Show file tree
Hide file tree
Showing 5 changed files with 155 additions and 132 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
11.10 30.07.2015
================
- fix memory leak when doing reindex files - all versions (around 40MB per reindex)
- fraud SIP flood rule can now count SIP request distribution
- fraud SIP REGISTER can now filter user agent


11.9.4 24.07.2015
=================
- fix saverfc2833=yes option in case savertp=no or savertp=header - DTMF were still truncated despite the saverfc2833 was enabled.
Expand Down
18 changes: 9 additions & 9 deletions manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -550,31 +550,31 @@ int parse_command(char *buf, int size, int client, int eof, const char *buf_long
sprintf(filename, "%s/rrd/2db-PS.rrd", opt_chdir);
rrd_vm_create_graph_PS_command(filename, fromat, toat, color, resx, resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else if (!strncmp(manager_args[1], "SQLq", 5)) {
sprintf(filename, "%s/rrd/db-SQL.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-SQL.rrd", opt_chdir);
rrd_vm_create_graph_SQLq_command(filename, fromat, toat, color, resx, resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else if (!strncmp(manager_args[1], "SQLf", 5)) {
sprintf(filename, "%s/rrd/db-SQL.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-SQL.rrd", opt_chdir);
rrd_vm_create_graph_SQLf_command(filename, fromat, toat, color, resx, resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else if (!strncmp(manager_args[1], "tCPU", 5)) {
sprintf(filename, "%s/rrd/db-tCPU.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-tCPU.rrd", opt_chdir);
rrd_vm_create_graph_tCPU_command(filename, fromat, toat, color, resx, resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else if (!strncmp(manager_args[1], "drop", 5)) {
sprintf(filename, "%s/rrd/db-drop.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-drop.rrd", opt_chdir);
rrd_vm_create_graph_drop_command(filename, fromat, toat, color, resx, resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else if (!strncmp(manager_args[1], "speed", 5)) {
sprintf(filename, "%s/rrd/db-speedmbs.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-speedmbs.rrd", opt_chdir);
rrd_vm_create_graph_speed_command(filename, fromat, toat, color, resx, resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else if (!strncmp(manager_args[1], "heap", 5)) {
sprintf(filename, "%s/rrd/db-heap.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-heap.rrd", opt_chdir);
rrd_vm_create_graph_heap_command(filename, fromat, toat, color, resx, resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else if (!strncmp(manager_args[1], "calls", 6)) {
sprintf(filename, "%s/rrd/db-callscounter.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-callscounter.rrd", opt_chdir);
rrd_vm_create_graph_calls_command(filename, fromat, toat, color, resx ,resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else if (!strncmp(manager_args[1], "tacCPU", 7)) {
sprintf(filename, "%s/rrd/db-tacCPU.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-tacCPU.rrd", opt_chdir);
rrd_vm_create_graph_tacCPU_command(filename, fromat, toat, color, resx, resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else if (!strncmp(manager_args[1], "RSSVSZ", 7)) {
sprintf(filename, "%s/rrd/db-RSSVSZ.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-RSSVSZ.rrd", opt_chdir);
rrd_vm_create_graph_RSSVSZ_command(filename, fromat, toat, color, resx, resy, slope, icon, dstfile, sendcommand, sizeof(sendcommand));
} else {
snprintf(sendbuf, BUFSIZE, "Error: Graph type %s isn't known\n\tGraph types: PS PSC PSS PSSM PSSR PSR PSA SQLq SQLf tCPU drop speed heap calls tacCPU RSSVSZ\n", manager_args[1]);
Expand Down
49 changes: 26 additions & 23 deletions pcap_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,8 +1064,8 @@ void PcapQueue::pcapStat(int statPeriod, bool statCalls) {
double rrdtCPU_t1 = 0.0;
double rrdtCPU_t2 = 0.0;
//rrd tacCPU consumption file db-tacCPU.rrd
int rrdtacCPU_nmt = 0; //number of threads
double rrdtacCPU_lastt = 0.0; //last thread load
double rrdtacCPU_zip = 0.0; //number of threads
double rrdtacCPU_tar = 0.0; //last thread load
//rrd mem consumption file db-RSSVSZ.rrd
double rrdRSSVSZ_rss = 0;
double rrdRSSVSZ_vsize = 0;
Expand Down Expand Up @@ -1449,6 +1449,9 @@ void PcapQueue::pcapStat(int statPeriod, bool statCalls) {
okPercTarCpu = true;
}
outStr << setprecision(1) << tar_cpu;
if (opt_rrd) {
rrdtacCPU_tar += tar_cpu;
}
}
}
if(okPercTarCpu) {
Expand Down Expand Up @@ -1544,12 +1547,11 @@ void PcapQueue::pcapStat(int statPeriod, bool statCalls) {
outStrStat << '|';
}
outStrStat << setprecision(1) << v_tac_cpu[i];
if (opt_rrd) {
rrdtacCPU_zip += v_tac_cpu[i];
}
}
outStrStat << "%] ";
if (opt_rrd) {
rrdtacCPU_nmt = v_tac_cpu.size();
rrdtacCPU_lastt = last_tac_cpu;
}
}
extern int opt_pcap_dump_asyncwrite_limit_new_thread;
if(last_tac_cpu > opt_pcap_dump_asyncwrite_limit_new_thread) {
Expand Down Expand Up @@ -1642,23 +1644,23 @@ void PcapQueue::pcapStat(int statPeriod, bool statCalls) {
char filename[1000];
sprintf(filename, "%s/rrd/" ,opt_chdir);
mkdir_r(filename, 0777);
sprintf(filename, "%s/rrd/db-drop.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-drop.rrd", opt_chdir);
vm_rrd_create_rrddrop(filename);
sprintf(filename, "%s/rrd/db-heap.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-heap.rrd", opt_chdir);
vm_rrd_create_rrdheap(filename);
sprintf(filename, "%s/rrd/2db-PS.rrd", opt_chdir);
vm_rrd_create_rrdPS(filename);
sprintf(filename, "%s/rrd/db-SQL.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-SQL.rrd", opt_chdir);
vm_rrd_create_rrdSQL(filename);
sprintf(filename, "%s/rrd/db-tCPU.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-tCPU.rrd", opt_chdir);
vm_rrd_create_rrdtCPU(filename);
sprintf(filename, "%s/rrd/db-tacCPU.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-tacCPU.rrd", opt_chdir);
vm_rrd_create_rrdtacCPU(filename);
sprintf(filename, "%s/rrd/db-RSSVSZ.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-RSSVSZ.rrd", opt_chdir);
vm_rrd_create_rrdRSSVSZ(filename);
sprintf(filename, "%s/rrd/db-speedmbs.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-speedmbs.rrd", opt_chdir);
vm_rrd_create_rrdspeedmbs(filename);
sprintf(filename, "%s/rrd/db-callscounter.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-callscounter.rrd", opt_chdir);
vm_rrd_create_rrdcallscounter(filename);
opt_rrd ++;
} else {
Expand All @@ -1668,14 +1670,14 @@ void PcapQueue::pcapStat(int statPeriod, bool statCalls) {
//update rrddrop
cmdUpdate << "N:" << rrddrop_exceeded;
cmdUpdate << ":" << rrddrop_packets;
sprintf(filename, "%s/rrd/db-drop.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-drop.rrd", opt_chdir);
vm_rrd_update(filename, cmdUpdate.str().c_str());

//update rrdheap;
cmdUpdate.str(std::string());
cmdUpdate << "N:" << rrdheap_buffer;
cmdUpdate << ":" << rrdheap_ratio;
sprintf(filename, "%s/rrd/db-heap.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-heap.rrd", opt_chdir);
vm_rrd_update(filename, cmdUpdate.str().c_str());

//update rrdPS;
Expand Down Expand Up @@ -1704,40 +1706,41 @@ void PcapQueue::pcapStat(int statPeriod, bool statCalls) {
else cmdUpdate << ":" << rrdSQLq_Cl;
if (rrdSQLq_H < 0) cmdUpdate << ":U";
else cmdUpdate << ":" << rrdSQLq_H;
sprintf(filename, "%s/rrd/db-SQL.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-SQL.rrd", opt_chdir);
vm_rrd_update(filename, cmdUpdate.str().c_str());

//update rrdtCPU;
cmdUpdate.str(std::string());
cmdUpdate << "N:" << rrdtCPU_t0;
cmdUpdate << ":" << rrdtCPU_t1;
cmdUpdate << ":" << rrdtCPU_t2;
sprintf(filename, "%s/rrd/db-tCPU.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-tCPU.rrd", opt_chdir);
vm_rrd_update(filename, cmdUpdate.str().c_str());

//update rrdtacCPU;
cmdUpdate.str(std::string());
cmdUpdate << "N:" << ((double) (rrdtacCPU_nmt) + (double)((double) rrdtacCPU_lastt / 150.0));
sprintf(filename, "%s/rrd/db-tacCPU.rrd", opt_chdir);
cmdUpdate << "N:" << rrdtacCPU_zip;
cmdUpdate << ":" << rrdtacCPU_tar;
sprintf(filename, "%s/rrd/2db-tacCPU.rrd", opt_chdir);
vm_rrd_update(filename, cmdUpdate.str().c_str());

//update rrdRSSVSZ;
cmdUpdate.str(std::string());
cmdUpdate << "N:" << rrdRSSVSZ_rss;
cmdUpdate << ":" << rrdRSSVSZ_vsize;
sprintf(filename, "%s/rrd/db-RSSVSZ.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-RSSVSZ.rrd", opt_chdir);
vm_rrd_update(filename, cmdUpdate.str().c_str());

//update rrdspeedmbs;
cmdUpdate.str(std::string());
cmdUpdate << "N:" << rrdspeedmbs;
sprintf(filename, "%s/rrd/db-speedmbs.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-speedmbs.rrd", opt_chdir);
vm_rrd_update(filename, cmdUpdate.str().c_str());

//update rrdcallscounter;
cmdUpdate.str(std::string());
cmdUpdate << "N:" << rrdcallscounter;
sprintf(filename, "%s/rrd/db-callscounter.rrd", opt_chdir);
sprintf(filename, "%s/rrd/2db-callscounter.rrd", opt_chdir);
vm_rrd_update(filename, cmdUpdate.str().c_str());
}
}
Expand Down
Loading

0 comments on commit 3e507e1

Please sign in to comment.