Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#138 ログ化機能・ログ送信機能の分離、及びNWアクセス制御 #191

Merged
merged 7 commits into from
Jun 7, 2024

Conversation

nbhgytzheng
Copy link
Contributor

@nbhgytzheng nbhgytzheng commented Jun 6, 2024

close #138

USBポートの確認方法(ttyUSB1に確定)

  • 前田さんから抜き差しを確認。
sectu@sensor:~$ dmesg | grep -i usb
[ 1961.080274] usb 1-1: USB disconnect, device number 3
[ 1961.080708] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[ 1961.081032] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[ 1961.081392] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[ 1961.081663] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
[ 1968.842578] usb 1-1: new high-speed USB device number 4 using xhci_hcd
[ 1969.002644] usb 1-1: New USB device found, idVendor=11f6, idProduct=1035, bcdDevice= 2.32
[ 1969.002650] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1969.002653] usb 1-1: Product: NCXX UX302NC
[ 1969.002656] usb 1-1: Manufacturer: NCXX Inc.
[ 1969.002659] usb 1-1: SerialNumber: 1234567890
[ 1969.005723] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 1969.006286] scsi host4: usb-storage 1-1:1.0
[ 1974.554516] usb 1-1: USB disconnect, device number 4
[ 1975.078507] usb 1-1: new high-speed USB device number 5 using xhci_hcd
[ 1975.238731] usb 1-1: New USB device found, idVendor=11f6, idProduct=1034, bcdDevice= 2.32
[ 1975.238737] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1975.238740] usb 1-1: Product: NCXX UX302NC
[ 1975.238743] usb 1-1: Manufacturer: NCXX Inc.
[ 1975.244194] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 1975.244608] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 1975.245062] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[ 1975.245515] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
  • 村田さんからのドキュメントの確認。(1.2.2)

以下のついて確認をしました。

  • ログ分離機能が必要なくなったので、ログ送信前の確認機能だけを実装。
  • coe06とcomtest04のセンサーをデプロイしてテスト済み。(coe06のセンサーは手動で色々弄ったので、それを排除するため、comtest04のセンサーもテストしました。)
  • 送信確認の文字列をOKから他の文字に変更し、送信しないことを確認。
sectu@sensor:~/osect_sensor/Application/edge_cron/cron/management/commands$ tail -f ~/osect_sensor/logs/ottools/edge_cron.log 
...
...
2024/06/05 21:30:06 [PID: 25911][Thread ID: 140079445624640][INFO][edge_cron] move analyzed log directory [/opt/edge_cron/paper/sc_src/input/pcap/analyze/realtime-2024-06-05-21:30:06]
2024/06/05 21:30:07 [PID: 25911][Thread ID: 140079445624640][ERROR][edge_cron] can not send compressed file. Unable to connect to closed network. 
2024/06/05 21:30:07 [PID: 25911][Thread ID: 140079445624640][INFO][edge_cron] end send compressed log ---Time:1.102846622467041(sec)---
2024/06/05 21:30:07 [PID: 25911][Thread ID: 140079445624640][INFO][edge_cron] pcap to log done
...
...
  • 送信確認の文字列をOKに戻し、問題なく送信していないログをまとめて送信することを確認。
sectu@sensor:~/osect_sensor/Application/edge_cron/cron/management/commands$ tail -f ~/osect_sensor/logs/ottools/edge_cron.log 
...
...
2024/06/05 21:31:06 [PID: 26671][Thread ID: 139652222658368][INFO][edge_cron] move analyzed log directory [/opt/edge_cron/paper/sc_src/input/pcap/analyze/realtime-2024-06-05-21:31:06]
2024/06/05 21:31:08 [PID: 26671][Thread ID: 139652222658368][INFO][edge_cron] send compressed file: realtime-2024-06-05-21:30:06.tar.zst
2024/06/05 21:31:09 [PID: 26671][Thread ID: 139652222658368][INFO][edge_cron] send compressed file: realtime-2024-06-05-21:31:06.tar.zst
2024/06/05 21:31:09 [PID: 26671][Thread ID: 139652222658368][INFO][edge_cron] end send compressed log ---Time:2.3565711975097656(sec)---
2024/06/05 21:31:09 [PID: 26671][Thread ID: 139652222658368][INFO][edge_cron] pcap to log done

@nbhgytzheng nbhgytzheng requested a review from takuma0121 June 6, 2024 08:54
@nbhgytzheng
Copy link
Contributor Author

テスト痕跡。

# IS_CLOSED_NETWORK = False
2024/06/07 15:01:06 [PID: 35274][Thread ID: 140204092036928][INFO][edge_cron] TEST: not closed network
2024/06/07 15:01:06 [PID: 35274][Thread ID: 140204092036928][INFO][edge_cron] send compressed file: realtime-2024-06-07-15:01:06.tar.zst
2024/06/07 15:01:06 [PID: 35274][Thread ID: 140204092036928][INFO][edge_cron] end send compressed log ---Time:0.6429500579833984(sec)---
2024/06/07 15:01:06 [PID: 35274][Thread ID: 140204092036928][INFO][edge_cron] pcap to log done

# IS_CLOSED_NETWORK = True
2024/06/07 15:02:07 [PID: 35656][Thread ID: 140711636678464][INFO][edge_cron] move analyzed log directory [/opt/edge_cron/paper/sc_src/input/pcap/analyze/realtime-2024-06-07-15:02:07]
2024/06/07 15:02:07 [PID: 35656][Thread ID: 140711636678464][INFO][edge_cron] TEST: closed network
2024/06/07 15:02:08 [PID: 35656][Thread ID: 140711636678464][INFO][edge_cron] send compressed file: realtime-2024-06-07-15:02:07.tar.zst
2024/06/07 15:02:08 [PID: 35656][Thread ID: 140711636678464][INFO][edge_cron] end send compressed log ---Time:1.4656050205230713(sec)---
2024/06/07 15:02:08 [PID: 35656][Thread ID: 140711636678464][INFO][edge_cron] pcap to log done

@takuma0121 takuma0121 merged commit a927a8a into main Jun 7, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ログ化機能・ログ送信機能の分離、及びNWアクセス制御
3 participants