Pandora FMS community forums
Undefined value returned by plug-in - Printable Version

+- Pandora FMS community forums (http://pandorafms.org/forum)
+-- Forum: Pandora FMS (http://pandorafms.org/forum/forum-3.html)
+--- Forum: Community support (English) (http://pandorafms.org/forum/forum-7.html)
+--- Thread: Undefined value returned by plug-in (/thread-12813.html)



Undefined value returned by plug-in - Mystikal57 - 01-21-2019

Hello,
My plug-in modules doesn't work with a fresh install of pandorafms on debian 9, including buitin plugin..

I have this message in log:
2019-01-21 08:14:43 VPANDORA [V1] Pandora FMS Server 'VPANDORA' unhandled error.
2019-01-21 08:14:43 VPANDORA [V3] [ERROR] Undefined value returned by plug-in module 'ram_use' in agent whith name 'SRV-blabla' and alias 'SRV-blabla'. Is the server out of memory?
2019-01-21 08:19:49 VPANDORA [V1] [E] 'VPANDORA': JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/PluginServer.pm line 182.

Same error with all plugins.


Wmi request works fine when execute manually


[email protected]:/var/log/pandora# free

              total        used        free      shared  buff/cache   available

Mem:        4041668      513184     1981256       32276     1547228     3231176
Swap:       4192252           0     4192252


php > $cmd = "cd /usr/share/pandora_server/util/plugin ;";
php > $cmd .= "/usr/bin/perl ./wmi_remoto_v1r1.pl -H 192.168.X.X -m memuse -U u[email protected] -P pass >> /var/log/pandora/test.log";
php > exec($cmd);
php > exit
[email protected]:/usr/share/pandora_server/util/plugin# cat /var/log/pandora/test.log
64.94[email protected]:/usr/share/pandora_server/util/plugin#

Any idea ?


RE: Undefined value returned by plug-in - alberto.sanchez - 01-21-2019

(01-21-2019, 07:33 AM)Mystikal57 Wrote: Hello,
My plug-in modules doesn't work with a fresh install of pandorafms on debian 9, including buitin plugin..

I have this message in log:
2019-01-21 08:14:43 VPANDORA [V1] Pandora FMS Server 'VPANDORA' unhandled error.
2019-01-21 08:14:43 VPANDORA [V3] [ERROR] Undefined value returned by plug-in module 'ram_use' in agent whith name 'SRV-blabla' and alias 'SRV-blabla'. Is the server out of memory?
2019-01-21 08:19:49 VPANDORA [V1] [E] 'VPANDORA': JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/PluginServer.pm line 182.

Same error with all plugins.


Wmi request works fine when execute manually


[email protected]:/var/log/pandora# free

              total        used        free      shared  buff/cache   available

Mem:        4041668      513184     1981256       32276     1547228     3231176
Swap:       4192252           0     4192252


php > $cmd = "cd /usr/share/pandora_server/util/plugin ;";
php > $cmd .= "/usr/bin/perl ./wmi_remoto_v1r1.pl -H 192.168.X.X -m memuse -U u[email protected] -P pass >> /var/log/pandora/test.log";
php > exec($cmd);
php > exit
[email protected]:/usr/share/pandora_server/util/plugin# cat /var/log/pandora/test.log
64.94[email protected]:/usr/share/pandora_server/util/plugin#

Any idea ?

Good morning Mystikal57,

Can you please attach me a screenshot of the configuration of the plugin module in Pandora FMS Console.

Alberto


RE: Undefined value returned by plug-in - Mystikal57 - 01-21-2019

(01-21-2019, 09:11 AM)alberto.sanchez Wrote:
(01-21-2019, 07:33 AM)Mystikal57 Wrote: Hello,
My plug-in modules doesn't work with a fresh install of pandorafms on debian 9, including buitin plugin..

I have this message in log:
2019-01-21 08:14:43 VPANDORA [V1] Pandora FMS Server 'VPANDORA' unhandled error.
2019-01-21 08:14:43 VPANDORA [V3] [ERROR] Undefined value returned by plug-in module 'ram_use' in agent whith name 'SRV-blabla' and alias 'SRV-blabla'. Is the server out of memory?
2019-01-21 08:19:49 VPANDORA [V1] [E] 'VPANDORA': JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/PluginServer.pm line 182.

Same error with all plugins.


Wmi request works fine when execute manually


[email protected]:/var/log/pandora# free

              total        used        free      shared  buff/cache   available

Mem:        4041668      513184     1981256       32276     1547228     3231176
Swap:       4192252           0     4192252


php > $cmd = "cd /usr/share/pandora_server/util/plugin ;";
php > $cmd .= "/usr/bin/perl ./wmi_remoto_v1r1.pl -H 192.168.X.X -m memuse -U u[email protected] -P pass >> /var/log/pandora/test.log";
php > exec($cmd);
php > exit
[email protected]:/usr/share/pandora_server/util/plugin# cat /var/log/pandora/test.log
64.94[email protected]:/usr/share/pandora_server/util/plugin#

Any idea ?

Good morning Mystikal57,

Can you please attach me a screenshot of the configuration of the plugin module in Pandora FMS Console.

Alberto

Thank you, this is the configuration of the module on agent


RE: Undefined value returned by plug-in - jose.almendros - 01-21-2019

(01-21-2019, 09:55 AM)Mystikal57 Wrote:
(01-21-2019, 09:11 AM)alberto.sanchez Wrote:
(01-21-2019, 07:33 AM)Mystikal57 Wrote: Hello,
My plug-in modules doesn't work with a fresh install of pandorafms on debian 9, including buitin plugin..

I have this message in log:
2019-01-21 08:14:43 VPANDORA [V1] Pandora FMS Server 'VPANDORA' unhandled error.
2019-01-21 08:14:43 VPANDORA [V3] [ERROR] Undefined value returned by plug-in module 'ram_use' in agent whith name 'SRV-blabla' and alias 'SRV-blabla'. Is the server out of memory?
2019-01-21 08:19:49 VPANDORA [V1] [E] 'VPANDORA': JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/PluginServer.pm line 182.

Same error with all plugins.


Wmi request works fine when execute manually


[email protected]:/var/log/pandora# free

              total        used        free      shared  buff/cache   available

Mem:        4041668      513184     1981256       32276     1547228     3231176
Swap:       4192252           0     4192252


php > $cmd = "cd /usr/share/pandora_server/util/plugin ;";
php > $cmd .= "/usr/bin/perl ./wmi_remoto_v1r1.pl -H 192.168.X.X -m memuse -U u[email protected] -P pass >> /var/log/pandora/test.log";
php > exec($cmd);
php > exit
[email protected]:/usr/share/pandora_server/util/plugin# cat /var/log/pandora/test.log
64.94[email protected]:/usr/share/pandora_server/util/plugin#

Any idea ?

Good morning Mystikal57,

Can you please attach me a screenshot of the configuration of the plugin module in Pandora FMS Console.

Alberto

Thank you, this is the configuration of the module on agent

Hello Mystikal57,

How did you create the plugin? Maybe in Command section, you declared the parameters in "Plugin command" field instead in "Plugin parameters".

I tried to launch the plugin, creating it with the Command section like the screenshot that I attach and configuring the plugin module like you and it reports data without problem.

Regards


RE: Undefined value returned by plug-in - Mystikal57 - 01-21-2019

Hello,

No i declared parameters like you.
I restart the server, i have more logs:

Quote:2019-01-21 17:44:27 VPANDORA [V10] Decoding json macros from # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl'
2019-01-21 17:44:27 VPANDORA [V1] [E] 'VPANDORA': JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/PluginServer.pm line 182.

2019-01-21 17:44:27 VPANDORA [V1] Pandora FMS Server 'VPANDORA' unhandled error.
2019-01-21 17:44:27 VPANDORA [V9] Executing AM # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H _field1_ -m _field2_ -U _field3_ -P _field4_'
2019-01-21 17:44:27 VPANDORA [V3] [ERROR1] Undefined value returned by plug-in module 'ram_used' in agent whith name 'SRV-blabla.domain.local' and alias 'SRV-blabla.domain.local'. Is the server out of memory?
2019-01-21 17:44:27 VPANDORA [V10] Updating module ram_used (ID 42) on error.
i have another plugin module (pingcheck) witch is a .sh plugin, return 0, if i execute manually, it return 1... strange..

I tried to force value in plugin declaration.
If i don't use _fieldX_... it works !

Very strange...


RE: Undefined value returned by plug-in - jose.almendros - 01-22-2019

(01-21-2019, 04:38 PM)Mystikal57 Wrote: Hello,

No i declared parameters like you.
I restart the server, i have more logs:

Quote:2019-01-21 17:44:27 VPANDORA [V10] Decoding json macros from # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl'
2019-01-21 17:44:27 VPANDORA [V1] [E] 'VPANDORA': JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/PluginServer.pm line 182.

2019-01-21 17:44:27 VPANDORA [V1] Pandora FMS Server 'VPANDORA' unhandled error.
2019-01-21 17:44:27 VPANDORA [V9] Executing AM # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H _field1_ -m _field2_ -U _field3_ -P _field4_'
2019-01-21 17:44:27 VPANDORA [V3] [ERROR1] Undefined value returned by plug-in module 'ram_used' in agent whith name 'SRV-blabla.domain.local' and alias 'SRV-blabla.domain.local'. Is the server out of memory?
2019-01-21 17:44:27 VPANDORA [V10] Updating module ram_used (ID 42) on error.
i have another plugin module (pingcheck) witch is a .sh plugin, return 0, if i execute manually, it return 1... strange..

I tried to force value in plugin declaration.
If i don't use _fieldX_... it works !

Very strange...

Hello Mystikal57,

It is strange indeed, like if the macros don't work properly. We tried to force the error with special characters such us */%@... in the password and in the User and don't be able to replicate the error. We see that error only when we introduce bad parameters like a wrong password or user.

I see in the log lines that you sent this:
2019-01-21 17:44:27 VPANDORA [V9] Executing AM # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H _field1_ -m _field2_ -U _field3_ -P _field4_'

Did you change the lines to _field1_, _field2_...? If the macro is correct, the error line should be like this one (with the macro value):

2019-01-22 11:39:32 localhost.localdomain [V9] Executing AM # 37 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H 192.168.X.X -m memuse -U [email protected] -P [email protected]'

If you declare macros in the parameters and configure default values to that macros, you should see the complete command in the Command preview, with all values already filled (below Plugin parameters). Maybe you didn't add all the four macros (option "Add macro +")?


Regards.


RE: Undefined value returned by plug-in - Mystikal57 - 01-22-2019

(01-22-2019, 10:50 AM)jose.almendros Wrote:
(01-21-2019, 04:38 PM)Mystikal57 Wrote: Hello,

No i declared parameters like you.
I restart the server, i have more logs:

Quote:2019-01-21 17:44:27 VPANDORA [V10] Decoding json macros from # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl'
2019-01-21 17:44:27 VPANDORA [V1] [E] 'VPANDORA': JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/PluginServer.pm line 182.

2019-01-21 17:44:27 VPANDORA [V1] Pandora FMS Server 'VPANDORA' unhandled error.
2019-01-21 17:44:27 VPANDORA [V9] Executing AM # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H _field1_ -m _field2_ -U _field3_ -P _field4_'
2019-01-21 17:44:27 VPANDORA [V3] [ERROR1] Undefined value returned by plug-in module 'ram_used' in agent whith name 'SRV-blabla.domain.local' and alias 'SRV-blabla.domain.local'. Is the server out of memory?
2019-01-21 17:44:27 VPANDORA [V10] Updating module ram_used (ID 42) on error.
i have another plugin module (pingcheck) witch is a .sh plugin, return 0, if i execute manually, it return 1... strange..

I tried to force value in plugin declaration.
If i don't use _fieldX_... it works !

Very strange...

Hello Mystikal57,

It is strange indeed, like if the macros don't work properly. We tried to force the error with special characters such us */%@... in the password and in the User and don't be able to replicate the error. We see that error only when we introduce bad parameters like a wrong password or user.

I see in the log lines that you sent this:
2019-01-21 17:44:27 VPANDORA [V9] Executing AM # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H _field1_ -m _field2_ -U _field3_ -P _field4_'

Did you change the lines to _field1_, _field2_...? If the macro is correct, the error line should be like this one (with the macro value):

2019-01-22 11:39:32 localhost.localdomain [V9] Executing AM # 37 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H 192.168.X.X -m memuse -U [email protected] -P [email protected]'

If you declare macros in the parameters and configure default values to that macros, you should see the complete command in the Command preview, with all values already filled (below Plugin parameters). Maybe you didn't add all the four macros (option "Add macro +")?


Regards.

Yes, the command preview is good like that:
'/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H 192.168.X.X -m memuse -U [email protected] -P [email protected]'

but not in the log.
tried to edit wmi_remoto_v1r1.pl to print arguments, and it print _field1_ _fiel2_...

Same configuration works with centos Appliance but not with debian.
With centos Appliance, i can see good command in log, but it doesn't work with this message:
 [ERROR] Undefined value returned by plug-in module 'ram_used' in agent whith name 'e5f4bbb3db91eacbd9ede33b26b44c845303763dff4900d95ba72078ef544f3f' and alias 'SRV-blablaL'. Is the server out of memory?

I have only 1 agent


RE: Undefined value returned by plug-in - jose.almendros - 01-24-2019

(01-22-2019, 12:45 PM)Mystikal57 Wrote:
(01-22-2019, 10:50 AM)jose.almendros Wrote:
(01-21-2019, 04:38 PM)Mystikal57 Wrote: Hello,

No i declared parameters like you.
I restart the server, i have more logs:

Quote:2019-01-21 17:44:27 VPANDORA [V10] Decoding json macros from # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl'
2019-01-21 17:44:27 VPANDORA [V1] [E] 'VPANDORA': JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at /usr/lib/perl5/PandoraFMS/PluginServer.pm line 182.

2019-01-21 17:44:27 VPANDORA [V1] Pandora FMS Server 'VPANDORA' unhandled error.
2019-01-21 17:44:27 VPANDORA [V9] Executing AM # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H _field1_ -m _field2_ -U _field3_ -P _field4_'
2019-01-21 17:44:27 VPANDORA [V3] [ERROR1] Undefined value returned by plug-in module 'ram_used' in agent whith name 'SRV-blabla.domain.local' and alias 'SRV-blabla.domain.local'. Is the server out of memory?
2019-01-21 17:44:27 VPANDORA [V10] Updating module ram_used (ID 42) on error.
i have another plugin module (pingcheck) witch is a .sh plugin, return 0, if i execute manually, it return 1... strange..

I tried to force value in plugin declaration.
If i don't use _fieldX_... it works !

Very strange...

Hello Mystikal57,

It is strange indeed, like if the macros don't work properly. We tried to force the error with special characters such us */%@... in the password and in the User and don't be able to replicate the error. We see that error only when we introduce bad parameters like a wrong password or user.

I see in the log lines that you sent this:
2019-01-21 17:44:27 VPANDORA [V9] Executing AM # 42 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H _field1_ -m _field2_ -U _field3_ -P _field4_'

Did you change the lines to _field1_, _field2_...? If the macro is correct, the error line should be like this one (with the macro value):

2019-01-22 11:39:32 localhost.localdomain [V9] Executing AM # 37 plugin command '/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H 192.168.X.X -m memuse -U [email protected] -P [email protected]'

If you declare macros in the parameters and configure default values to that macros, you should see the complete command in the Command preview, with all values already filled (below Plugin parameters). Maybe you didn't add all the four macros (option "Add macro +")?


Regards.

Yes, the command preview is good like that:
'/usr/share/pandora_server/util/plugin/wmi_remoto_v1r1.pl -H 192.168.X.X -m memuse -U [email protected] -P [email protected]'

but not in the log.
tried to edit wmi_remoto_v1r1.pl to print arguments, and it print _field1_ _fiel2_...

Same configuration works with centos Appliance but not with debian.
With centos Appliance, i can see good command in log, but it doesn't work with this message:
 [ERROR] Undefined value returned by plug-in module 'ram_used' in agent whith name 'e5f4bbb3db91eacbd9ede33b26b44c845303763dff4900d95ba72078ef544f3f' and alias 'SRV-blablaL'. Is the server out of memory?

I have only 1 agent

Hello Mystikal57,

From develop department are informing us that exits a bug with the plugin server and macros and it is not working properly. We are working on it.

Anyway, with CentOs appliance your execution is ok. I am testing that plugin and I am unable to replicate the error, with all the parameters correctly typed. If it still not working for you, you can try to create a log file with the error at plugin execution (in parameters: H _field1_ -m _field2_ -U _field3_ -P _field4_ 2> /tmp/error.log) if it does not report any error, that file will be empty.

Regards.



RE: Undefined value returned by plug-in - [email protected] - 12-27-2019

The quick fix described here (just to let others know, spent half an hour finding the reason).
https://github.com/pandorafms/pandorafms/issues/119


RE: Undefined value returned by plug-in - jamesgil - 12-28-2019

Good Post!