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

[apps::nsclient::restapi::plugin]: Use of uninitialized value in sprintf #825

Closed
Crash-Fox opened this issue Dec 13, 2017 · 14 comments
Closed
Labels

Comments

@Crash-Fox
Copy link

Hello,

When I'm executing a remote custom Powershell script from Centreon to a Windows Server (where NSClient is installed) using the new centreon plugin (NSClient REST API plugin).

I'm getting 4 lines of this warning before seeing the output of my script:
Use of uninitialized value in sprintf at /usr/lib/nagios/plugins/centreon-plugins/apps/nsclient/restapi/mode/query.pm line 108.

@garnier-quentin
Copy link
Contributor

Could you give me the result with curl command ?

@Crash-Fox
Copy link
Author

What is the URL to query to do the thing ?

@garnier-quentin
Copy link
Contributor

curl -k -H 'password: centreon' 'https://nsclientip:8443/query/commandname?arg1&arg2'

@Crash-Fox
Copy link
Author

thanks

@Crash-Fox
Copy link
Author

Here is the result with the curl command:
{"header":{"source_id":""},"payload":[{"command":"checkdfsreplication","lines":[{"message":"UNKNOWN - Bad DFS link"}],"result":"UNKNOWN"}]}

@garnier-quentin
Copy link
Contributor

Could you give the command you execute and the output ? because it should be in that method.

@Crash-Fox
Copy link
Author

curl -k -H 'password: Pa$$word' 'https://@ip:8443/query/checkDfsReplication?linkDfsName=\\emea.dsi.corp.sopra\FS-DTP\FS-TP-FORGE\alfresco\alf_data\contentstore\2017'

@Crash-Fox
Copy link
Author

and the output sorry:
{"header":{"source_id":""},"payload":[{"command":"checkdfsreplication","lines":[{"message":"UNKNOWN - Bad DFS link"}],"result":"UNKNOWN"}]}

@garnier-quentin
Copy link
Contributor

I have no error. Could you get the last version (i have done a patch) and use option --debug ? After that, i need the command output.

@Crash-Fox
Copy link
Author

Hello, i've updated my version of the centreon plugin (contaning the debug display for the nsclient plugin). I tried it :
./centreon_plugins.pl --plugin=apps::nsclient::restapi::plugin --mode=query --hostname="NOM FQDN ou IP" --legacy-password='Mot de passe du NSClient Web Server' --ssl=tlsv1 --command="Nom commande distante" --arg="Arguments de la commande" --debug

It keeps displaying the same outputs:
Use of uninitialized value in sprintf at /usr/lib/nagios/plugins/centreon-plugins/apps/nsclient/restapi/mode/query.pm line 108.

I tried executing others scripts that requires arguments to be passed and none of the previous outputs are to be seen. Weird

@garnier-quentin
Copy link
Contributor

Yes the warning should stay. But i'd like to get the total output.

@Crash-Fox
Copy link
Author

La commande utilisé :
./centreon_plugins.pl --plugin=apps::nsclient::restapi::plugin --mode=query --hostname="@ip" --legacy-password='Mot de passe' --ssl=tlsv1 --command="checkDfsReplication" --arg="arguments" --debug

Voici la sortie de la commande :
Use of uninitialized value in sprintf at /usr/lib/nagios/plugins/centreon-plugins/apps/nsclient/restapi/mode/query.pm line 108.
Use of uninitialized value in sprintf at /usr/lib/nagios/plugins/centreon-plugins/apps/nsclient/restapi/mode/query.pm line 108.
Use of uninitialized value in sprintf at /usr/lib/nagios/plugins/centreon-plugins/apps/nsclient/restapi/mode/query.pm line 108.
Use of uninitialized value in sprintf at /usr/lib/nagios/plugins/centreon-plugins/apps/nsclient/restapi/mode/query.pm line 108.
OK - DFS Replication | 'DFSR'=1.000;;;0.000;0.000

@garnier-quentin
Copy link
Contributor

You use the last version ? You're sure ? Because i should display the json from NSClient.

@Crash-Fox
Copy link
Author

Yes i dit it this morning

Sims24 pushed a commit that referenced this issue Jul 21, 2021
* Update secure-platform.md

extra «yum» in the cmd

* Remove extra yum (EN)

Co-authored-by: Benoit Poulet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants