CESNET / Netopeer2GUI

Web-based NETCONF management center
Apache License 2.0
25 stars 11 forks source link

How to use netopeer2 correctly #22

Open crow1814 opened 3 years ago

crow1814 commented 3 years ago

Hi, I have deployed netopeer2gui as a module following the liberouter-gui framework. Now I can open the web site by localhost:4200, but I can't add a device. The error message is "AttributeError: module 'netconf2' has no attribute 'setSearchpath' ". So can you help me solve this problem. Thank you very much!

jakubman1 commented 3 years ago

Hello, sorry for the late answer. Try installing libnetconf and libyang from the devel branch. Let me know if this fixes the issue.

Just a side note, the current GUI is unlikely to be updated since a new one is being developed. First versions should be available around February in this repository.

zhenlu-sun commented 3 years ago

@jakubman1 hi , after installing netconf with 'pip3 install netconf', i can only find folder 'netconf' under dir .../python3.7/site-packages/, not netconf2 folder. However, in the source codes, netconf2 are imported. Could you tell me how to install lib netconf2 ? I tried to change 'import netconf2 as nc' to 'import netconf as nc' in codes, but new errors comes up, like module netconf jas no attribute 'setSearchpath'.

Best regards, Zhenlu

jakubman1 commented 3 years ago

You need to install libnetconf2 from the CESNET repository https://github.com/CESNET/libnetconf2 When running CMAKE for libnetconf2, make sure to add the -DENABLE_PYTHON=ON option

zhenlu-sun commented 3 years ago

You need to install libnetconf2 from the CESNET repository https://github.com/CESNET/libnetconf2 When running CMAKE for libnetconf2, make sure to add the -DENABLE_PYTHON=ON option

@jakubman1 Thanks for your reply. The issue I mentioned above got fixed by installing libnetconf2. After I launched GUI frontend and backend, I can see what the GUI looks like now. One problem is, after I made some changes on Configuration tab of the GUI and applied the changes, the backend crashed, saying "libyang/src/tree_data.c:6212: _lyd_free_node: Assertion `0' failed". My question is , is this a known issue or I missed something during installing dependencies? The netconf server on remote host is launched with command "docker run -d -it --name sysrepo -p 830:830 --rm sysrepo/sysrepo-netopeer2:latest".

The last question is about the new release this month, will the monitoring and plugin tabs be implemented?

jakubman1 commented 3 years ago

@zhenlusu Did you install libyang from the /CESNET/libyang repository? Make sure you are installing versions of libyang and libnetconf2 from the same branch (both master or both devel) and that you install libyang before building libnetconf. Also make sure, that you install python bindings when building libyang.

As for the new version, I am currently working on finishing the first beta. Plugin tab will be implemented as “tools”, monitoring is planned to be implemented later this year.

jakubman1 commented 3 years ago

One problem is, after I made some changes on Configuration tab of the GUI and applied the changes, the backend crashed, saying "libyang/src/tree_data.c:6212: _lyd_free_node: Assertion `0' failed". My question is , is this a known issue or I missed something during installing dependencies? The netconf server on remote host is launched with command "docker run -d -it --name sysrepo -p 830:830 --rm sysrepo/sysrepo-netopeer2:latest".

@zhenlusu I've just ran into the same issue, so its probably caused by libyang. Sorry for the misleading answer earlier, I did not have my computer with me, so I could not test it.

EDIT: I am looking into the issue, I will let you know as soon as I find a solution.

jakubman1 commented 3 years ago

One problem is, after I made some changes on Configuration tab of the GUI and applied the changes, the backend crashed, saying "libyang/src/tree_data.c:6212: _lyd_free_node: Assertion `0' failed". My question is , is this a known issue or I missed something during installing dependencies?

@zhenlusu It turned out to be a problem with libnetconf2. Pull the newest version from the devel branch of the libnetconf2 repository and compile and install it again. You may need to run python binding installation manually: After running make install, go to the libnetconf2/build/python directory and run sudo python3 setup.py install

Please let me know if you encounter any other issues.

zhenlu-sun commented 3 years ago

@jakubman1 thanks a ton! The issue got fixed by installing the latest libnetconf2. Now, I can edit the parameters of some ietf models and apply the changes with root user. Seems that non-root user only has access to read the networking configurations on a specific device, not has access to write.

Do you have a plan to containerize this GUI app, since I encountered many errors when installing it and its dependencies? It is better to deploy it with docker command, from my perspective. As for the new version, do you have a estimated time in your mind and will it be merged into master branch or it'll be a separate feature branch?

jakubman1 commented 3 years ago

@jakubman1 thanks a ton! The issue got fixed by installing the latest libnetconf2. Now, I can edit the parameters of some ietf models and apply the changes with root user. Seems that non-root user only has access to read the networking configurations on a specific device, not has access to write.

Do you have a plan to containerize this GUI app, since I encountered many errors when installing it and its dependencies? It is better to deploy it with docker command, from my perspective. As for the new version, do you have a estimated time in your mind and will it be merged into master branch or it'll be a separate feature branch?

It will start as a separate branch (you can already try the work in progress version in the v2 branch, but I don't recommend it yet) after a few beta releases, it will be merged to the master branch. The new version already contains a Dockerfile. You can use docker to run it as a demo version. A production version of Dockerfile is coming soon too.

As for the time frame, the first beta will be available by the end of this month, but there will still be some features missing compared to the current version. As for merging into master, I can not give you a time frame right now. I am currently the only person working on this project, and I am working only part-time, so it is hard to estimate the time.