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

Add OPNarplog #4322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add OPNarplog #4322

wants to merge 1 commit into from

Conversation

mr-manuel
Copy link

@mr-manuel mr-manuel commented Oct 25, 2024

Hello,

I wrote a new plugin that has similar features as arpwatch. I would like to share it with the community so that everyone can use it.

This is my first plugin and I still not fully understand how everything interacts with the OPNsense UI/API. Could you help me with a few questions?

  1. How to troubleshoot API errors? When the GUI tries to call https://192.168.133.1/api/opnarplog/service/stop then it returns {"response":"Error (127)"}. Before I renamed my plugin everything worked. Now I'm clueless where the error could be. Same for https://192.168.133.1/api/opnarplog/service/status where I get {"status":"unknown","widget":{"caption_stop":"stop service","caption_start":"start service","caption_restart":"restart service"}}.
    SOLVED: I made a call to /usr/local/bin/bash which does not exist on a plain installation. It was replaced with a service call.

  2. How does the logging work in OPNsense? Currently I'm writing to a logfile under /var/log/opnarplog.log and rotate it with my script. The logformat is not recognized, but somehow the logfile is recognized on the logpage.

To test the plugin :

  1. Copy the content of the repository folder net-mgmt/opnarplog/src to the firewall folder /usr/local
  2. Set the permission for two files:
    chmod 755 /usr/local/bin/openarplog.py
    chmod 755 /usr/local/etc/rc.d/opnarplog
  3. Restart configd
    service configd restart

@mr-manuel
Copy link
Author

@Monviech @fichtner the PR is now ready for merge. Let me know, if I should change anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants