Kubectl exec - it redismaster - 7 c4fd4b855-85 KVV/bin/bash
CD ~
Sh ma. Sh
Keys IP *
SMEMBERS ip192.167.1.103
Hget res2ip7 restypeid
Hgetall res2ip7
Smembers resId
Es:
Kubectl edit statefulset elasticsearch - data - 3
/root @ matrix2 ~ # kubectl exec - it elasticsearch - master - 1/bin/bash
Elasticsearch] [root @ elasticsearch - master - 1 # curl 'elasticsearch - HTTP - service: 9200/_cat/indices? V: '
The curl '177.177.23.194:9200/_cat/nodes? V: '
The curl - XDELETE '177.177.23.194:9200/trapdata - 2020.10.27? Pretty '
View the data
The curl 'http://elasticsearch-http-service:9200/trapdata-2020.05.31, trapdata - 2020.06.01/_search? Pretty=true '
See template
The curl 'elasticsearch - HTTP - service: 9200/_template/monitor? Pretty '
PUT apievent_20190619/_settings
{
"The index mapping. Total_fields. Limit" : 2000
}
Or
Curl - XPUT "elasticsearch - service - HTTP:/trapdata - 2020.09.25/_settings" 9200 - H 'the content-type: application/json - d'
{
"The index mapping. Total_fields. Limit" : 2000
}
'
From & lt; https://blog.csdn.net/maligebazi/article/details/103539710>
Tcpdump:
Tcpdump -i any - VNN host 177.177.202.43 the and the and udp port 162 - w trap. Pcap
Tcpdump -i any - VNN udp and port 162 - w trap. Pcap
DB:
Timestamp to standard time:
Select *, time (from_unixtime (fault_time, '% % Y - m - H: % d % % I: % s')) as the time from tbl_trap_forward_record;
SELECT *, DATEADD (S, fault_time + 8 * 3600, '1970-01-01 00:00:00) as the time from monitor_db. Imc_monitor. Tbl_trap_forward_record
Select count (*) from tbl_trap_data_alarm
Cursor:
Delimiter//
Create procedure func ()
The BEGIN
DECLARE resid BIGINT (20);
DECLARE resrestype_id BIGINT (20);
DECLARE no_more_record int the default 0;
DECLARE cur_record CURSOR FOR the select id, restype_id from permission_db. Tbl_resource where id in (select res_source_key from monitor_db. Tbl_trap_data_alarm);
DECLARE the CONTINUE HANDLER FOR the NOT FOUND SET no_more_record=1;
The OPEN cur_record;
The FETCH cur_record INTO resid resrestype_id;
WHILE no_more_record!=1 DO
The update monitor_db. Tbl_trap_data_alarm set res_source_type=resrestype_id where resid=res_source_key;
The update monitor_db. Tbl_trap_data_history_2003 set res_source_type=resrestype_id where resid=res_source_key;
The FETCH cur_record INTO resid resrestype_id;
END the WHILE;
The CLOSE cur_record;
END;
//
Delimiter.
Call func ();
Drop procedure if the exists func.
commit;
Gateway:
Gateway is a concept, is primarily used for forwarding packets on the second floor, second floor packets across the network segment since it need to be done by the gateway forwarding, reflect on the computer is the gateway address, will correspond to a physical device, can be a routing device, can be a layer 3 switches, can also be a firewall, and so on, the router can be used as a gateway, but not gateway router, for example, in the room of would have to go to go out the door, the door is the gateway, the router can be compared to real wood door, door, can do but the door is not only a wooden door, and iron door, metal door, on the edge of package, and so on,
(personal understanding: according to the information to, for example, the gateway can tell people via IP in which room, can save search time, MAC is directly corresponding to the seat number,)
Fly autumn caught analysis:
Send arp again, even though there have been other's IP and MAC information
Ping this is the first to send arp broadcast messages, find the corresponding MAC destination IP information, and then send the ping packets,
About the deep and shallow copy
Struct STrapDataStruc
{
Unsigned long m_ulSerialNo;//- alarm serial number
STD: : list
STrapDataStruc ()
{
M_ulSerialNo=0;
}
STrapDataStruc (const STrapDataStruc& The rv)
{
M_ulSerialNo=the rv. M_ulSerialNo;
STD: : list
While (it!=the rv. M_listRecoveredSer. End ())
{
M_listRecoveredSer. Push_back (* it);
It + +;
}
}
STrapDataStruc& Operator=(const STrapDataStruc& The rv)
{
If (this!=& amp; The rv)
{
M_ulSerialNo=the rv. M_ulSerialNo;
STD: : list
While (it!=the rv. M_listRecoveredSer. End ())
{
M_listRecoveredSer. Push_back (* it);
It + +;
}
}
return *this;
}
};
STrapDataStruc a;
Arjun _ulSerialNo=1;
Arjun _listRecoveredSer. Push_back (2);
Arjun _listRecoveredSer. Push_back (3);
STrapDataStruc b=a;
Sorting:
Selection sort: bai every trip from du to sort data elements selected the minimum (or maximum) zhi, an element, the order on already sorted sequence at the end of the dao to all of them all to sort the data elements,
The ranking method of selection sort is unstable,
Direct insertion sort: each table to retrieve the first element from the chaos, insert it into the right place to order list, make the order table still orderly,
Before the first trip to compare two Numbers, and then the second number according to the size is orderly inserted into the table;
The second trip to the third data with the first two Numbers scanned from the front to rear, the third number in the table according to size is inserted into the; So on, has carried on the (n - 1) scanning is completed after the sorting process,
Direct insertion sort of stable sorting, the worst time complexity is O (n ^ 2), and space complexity of O (1),
Use the main difference in the execution efficiency of the algorithm and
Snmp++ 3.4.1 track compilation:
1, download address
https://www.agentpp.com/
2, the tar - ZXVF snmp++ - 3.4.1 track. Tar. Gz
3, configuration
./configure -- with - tomcrypt=yes - with libtomcrypt -- prefix=/home/temper/newsnmp++/imcbuild/-- prefix=/home/temper/newsnmp++ newsnmpbuild341 - without - SSL - enable snmpv3 - disable - rpath, disable - namespace, enable macaddress - disable - logging
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull