/src/ntopng/include/host_alerts/TrafficVolumeAlert.h
Line | Count | Source |
1 | | /* |
2 | | * |
3 | | * (C) 2013-24 - ntop.org |
4 | | * |
5 | | * |
6 | | * This program is free software; you can redistribute it and/or modify |
7 | | * it under the terms of the GNU General Public License as published by |
8 | | * the Free Software Foundation; either version 3 of the License, or |
9 | | * (at your option) any later version. |
10 | | * |
11 | | * This program is distributed in the hope that it will be useful, |
12 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | * GNU General Public License for more details. |
15 | | * |
16 | | * You should have received a copy of the GNU General Public License |
17 | | * along with this program; if not, write to the Free Software Foundation, |
18 | | * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | | * |
20 | | */ |
21 | | |
22 | | #ifndef _TRAFFIC_VOLUME_ALERT_ |
23 | | #define _TRAFFIC_VOLUME_ALERT_ |
24 | | |
25 | | #include "ntop_includes.h" |
26 | | |
27 | | class TrafficVolumeAlert : public HostAlert { |
28 | | private: |
29 | | std::string metric, threshold, value; |
30 | | u_int32_t frequency_sec; |
31 | | bool sign; |
32 | | |
33 | | ndpi_serializer* getAlertJSON(ndpi_serializer* serializer); |
34 | | |
35 | | public: |
36 | 0 | static HostAlertType getClassType() { |
37 | 0 | return {host_alert_traffic_volume, alert_category_network}; |
38 | 0 | } |
39 | | |
40 | | TrafficVolumeAlert(HostCheckID check_id, Host* h, risk_percentage cli_pctg, |
41 | | std::string _metric, u_int32_t _frequency_sec, |
42 | | std::string _threshold, std::string _value, bool t_sign); |
43 | 0 | ~TrafficVolumeAlert() {}; |
44 | | |
45 | 0 | HostAlertType getAlertType() const { return getClassType(); }; |
46 | 0 | u_int8_t getAlertScore() const { return SCORE_LEVEL_ERROR; }; |
47 | | |
48 | 0 | std::string getMetric() { return metric; }; |
49 | | }; |
50 | | |
51 | | #endif /* _TRAFFIC_VOLUME_ALERT_ */ |