Project

General

Profile

Creating a more advanced plugin

Added by hacen bani almost 8 years ago

Bonjour,

lorsque j'ai suivi le lien suivant: https://www.prelude-siem.org/projects/prelude/wiki/How_to_create_a_plugin_-_Part_2_Inventory
pour développer un module d'inventaire sur l'interface Prewikka, j'ai eu l'erreur suivant :

File "build/bdist.linux-x86_64/egg/inventory/__init__.py", line 6, in <module>
NameError: name 'view' is not defined

j'ai suivi la documentation de site plusieurs fois, normalement "View" est prés défini par les api de prelude

mais toujours le même erreur et pas de bouton Inventory au niveau de l'interface prewikka
voila le fichier init.py

Merci,
Cordialement

__init__.py View (2.42 KB)


Replies (9)

RE: Creating a more advanced plugin - Added by Thomas ANDREJAK almost 8 years ago

Hello

This is a english board, thank you to write in english.

Regards

RE: Creating a more advanced plugin - Added by hacen bani almost 8 years ago

Hello,

when I followed the link : https://www.prelude-siem.org/projects/prelude/wiki/How_to_create_a_plugin_-_Part_2_Inventory
to develop an inventory module on Prewikka interface, I got the following error:

File "build / bdist.linux-x86_64 / egg / inventory / _ init_.py", line 6, in <module>
NameError: name 'view' is not defined

I followed the documentation site several times

but still the same error and no Inventory button at the prewikka interface
here is the file init.py

thank you,
cordially

__init__.py View (2.42 KB)

RE: Creating a more advanced plugin - Added by Antoine LUONG almost 8 years ago

Hello,

We can't reproduce your problem. Can you check if the installed init file is the same as the one you attached?

Regards

RE: Creating a more advanced plugin - Added by hacen bani almost 8 years ago

Hello,
thank you for your reply

I review the init file installed, yes it is the same file that I joined and the same error still exists.
Is what we need to create the inventory folder in a specific location or any location?
Because I created the inventory folder under the python2.7 folder of my system and I created all the files mentioned in the documentation by the same architecture.
May what I have already done be the source of the problem ?

Thank you
Cordially.

RE: Creating a more advanced plugin - Added by Antoine LUONG almost 8 years ago

You can create your inventory folder wherever you like (e.g. in your /home), and you need to install it through the "python setup.py install" command.

Regards

RE: Creating a more advanced plugin - Added by hacen bani almost 8 years ago

Hello,
I repeated the same approach, I put the inventory folder under / home and I run the command "python setup.py install"
but when I boot the prewikka service command "Service prewikka restart" to get the Inventory Module I got the following error:

Stop Prewikka ...- e [OK]
Starting Prewikka ...- e [OK]
root @ ubuntu: / home / hacen # 1:51:02 p.m. root (pid: 9736) WARNING: Asynchronous DNS resolution disabled: twisted.names and twisted.internet required: No Module named names
1:51:02 p.m. prewikka.pluginmanager (pid: 9736) ERROR: Inventory: name 'view' is not defined
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/prewikka/pluginmanager.py", line 153, in init
plugin_class i.load = ()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088 in load
import entry = _ (self.module_name, globals (), globals () [ '_name'])
File "build / bdist.linux-x86_64 / egg / inventory / _ init_.py", line 6, in <module>
NameError: name 'view' is not defined

Help me please
Thank you
Cordially.

RE: Creating a more advanced plugin - Added by Antoine LUONG almost 8 years ago

Hello,

Do you get the same behavior when using view.View in the Python console?

>>> from prewikka import view
>>> view.View

Regards

RE: Creating a more advanced plugin - Added by hacen bani almost 8 years ago

thank you for the response ,
well , when I run it from python console I get this :

>>> from prewikka import view
>>> 
>>> view.View
<class 'prewikka.view.View'>
>>> 

Regards

RE: Creating a more advanced plugin - Added by Antoine LUONG almost 8 years ago

Can we see the output of the "python setup.py install" command?

Regards

    (1-9/9)