Open LordWurstebrot opened 2 years ago
Can you send me output json from API ? https://my.nextcloud.com/ocs/v2.php/apps/serverinfo/api/v1/info Im interest version section. For example:
`
Hi, thanks for your help.
I noticed the following error, when viewing the api output:
`Parse error on line 1:
Im see error on first message with "system version" and second is with "status" ? You use latest version of plugins ? If you can try run check plugin manualy:
/omd/sites/h12/local/share/check_mk/agents/special/agent_nextcloud_data -u admin -p pass --no-cert-check data.mhasin.sk
you use RAW or enterprice version ?
Version of plugin
CMK (free / enterprice) version
Output of your comand
Hope this helps.
Yes im see you dont have installed python module requests. Can you try install this via pip and run special agent again? command: pip3 install requests
Now I get the following output:
<<<check_mk>>> Traceback (most recent call last): File "/omd/sites/monitoring/local/share/check_mk/agents/special/agent_nextcloud_data", line 129, in <module> print ("Version: %s" % data['ocs']['data']['nextcloud']['system']['version']) KeyError: 'nextcloud'
Interesting bug. If you open "download agent output" you see correct data from nextcloud ? Example:
Output:
Fetching 'agent'...
Failed: Failed to fetch data from sub.domain.de: Error(MKFetcherError('Agent exited with code 1: Traceback (most recent call last):\n File "/omd/sites/monitoring/local/share/check_mk/agents/special/agent_nextcloud_data", line 129, in
Job finished.
Are those setting right?
Can you run special agent manualy again ? get good output ? So im thing the problem is in username and password ? can you try this commant too: curl -u admin:"password" https://data.mhasin.sk/ocs/v2.php/apps/serverinfo/api/v1/info
Ok im know where is problem.... Can you specify URL address in DNS hostname or IP address. In the default the URL address is read from name of host and you can specify custom URL address for nextcloud.
Can you run special agent manualy again ? get good output ? So im thing the problem is in username and password ? can you try this commant too:
curl -u admin:"password" https://data.mhasin.sk/ocs/v2.php/apps/serverinfo/api/v1/info
can you specify this option. Its URL address or IP address of nexcloud server
Okay I changed it
but I get the same error:
Failed: Failed to fetch data from sub.domain.de: Error(MKFetcherError('Agent exited with code 1: Traceback (most recent call last):\n File "/omd/sites/monitoring/local/share/check_mk/agents/special/agent_nextcloud_data", line 129, in \n print("Version: %s" % data['ocs']['data']['nextcloud']['system']['version'])\nKeyError: 'nextcloud''))
ach :( So im dont know becouse im saw the variable nextcloud in you CSV you have... So can you coment the line Version: %s" % data['ocs']['data']['nextcloud']['system']['version']
in the special agent file /omd/sites/monitoring/local/share/check_mk/agents/special/agent_nextcloud_data
and then run again. In my instalation everything work. So im saw you use version 1.2.2 can you try 1.2.3 version ?
I did the update to 1.2.3 and comment line Version: ...
Now I get this error:
Failed: Failed to fetch data from cloud.domain.de: Error(MKFetcherError("Program '/omd/sites/monitoring/local/share/check_mk/agents/special/agent_nextcloud_data' not found (exit code 127)"))
Hi sorry for delay. Im try install clear version och checkmk and nextcloud plugin version 1.2.3 and everything work great. So you try detelete the plugin detele everything files from plugins from system and then install the plugins again.
Hi no problem. I will do it later today. How is you CMK setup?
I am running CMK in a Ubuntu 22.04 LXD Container on a QNAP NAS.
Dose the Plugin need any special ports open maybe?
So im try docker version, clear ubuntu virtual and plugin work. So you need:
If you can try manualy check if everything work run this command with you parameter (username, password, URL): /omd/sites/h12/local/share/check_mk/agents/special/agent_nextcloud_data -u admin -p pass --no-cert-check data.mhasin.sk
Hi, sorry for the late answer:
I think the problem is with my nextcloud setup. Because if I load up the serverinfo api in my browser I works fine and I get the values as json output. But if I use CURL (HTTPS) with user and password option I get the following error:
1) {"ocs":{"meta":{"status":"failure","statuscode":401,"message":null},"data":{"mes
2) Yes as I can see it from the browser
3) Yes I did. Its the same user I use in the browser
4) Nextcloud has a SSL certificate but CMK has none because I only access it from my internal network
5) Yes reinstall it to be sure
I have now reinstalled everything and run the command with my data
/omd/sites/h12/local/share/check_mk/agents/special/agent_nextcloud_data -u admin -p pass --no-cert-check data.mhasin.sk
Output:
/usr/bin/env: ‘python1’: No such file or directory
I tried to install python-is-python3
but I get the same Error
interesting because the plugin use python3 no python1 or python2.... Its define in header of file #!/usr/bin/env python3
Im develop version 1.2.4 where is bug for RAW version of checkmk... Can you try it ? The problem report @nate386
I updated the plugin to 1.2.4. Now I get the following error:
Error shown on terminal:
<<<check_mk>>> Traceback (most recent call last): File "/omd/sites/monitoring/local/share/check_mk/agents/special/agent_nextclou d_data", line 133, in <module> print("Version: %s" % data['ocs']['data']['nextcloud']['system']['version']) KeyError: 'nextcloud'
Error shown on CMK:
Error(MKFetcherError('Agent exited with code 1: Traceback (most recent call last):\n File "/omd/sites/monitoring/local/share/check_mk/agents/special/agent_nextcloud_data", line 133, in <module>\n print("Version: %s" % data[\'ocs\'][\'data\'][\'nextcloud\'][\'system\'][\'version\'])\nTypeError: list indices must be integers or slices, not str'))
I got 2FA enabled for my nextcloud instance. Coud this be a Problem?
Yes the 2FA is not support but in new version im add support for TOKEN authorization. Install version https://github.com/matoH12/checkmk-nextcloud/blob/main/nextcloud-1.3.mkp and set token on nextcloud server occ config:app:set serverinfo token --value yourtoken
Hi, sorry for the late answer. I did as you said but I only get the ping status:
I use this config:
Job status:
Hi, interesting what you see after click download output data ? You see nextcloud data plugin output
No, it's just a empty .txt file.
Hi @matoH12
first of all thanks for providing this plugin!
When I try to use the special agent I get the following error:
Fetching 'agent'... Failed: Failed to fetch data from subdomain.domain.de: Error(MKFetcherError('Agent exited with code 1: Traceback (most recent call last):\n File "/omd/sites/monitoring/local/share/check_mk/agents/special/agent_nextcloud_data", line 129, in <module>\n print("Version: %s" % data[\'ocs\'][\'data\'][\'nextcloud\'][\'system\'][\'version\'])\nTypeError: list indices must be integers or slices, not str'))
Would be awesome when you could help me fix this error.