echocat / site24x7_exporter

site24x7 exporter for prometheus.io, written in go.
https://github.com/echocat/site24x7_exporter
Other
7 stars 4 forks source link

Not working #5

Closed ghost closed 4 years ago

ghost commented 4 years ago

I'm testing this exporter and it's not working at all. This exporter only needs site24x7's access token but currently with site24x7 it requires client ID, client secret, and access token to be able to access its API. Is this exporter using site24x7 API? I get the error below using this exporter with my access token, which is valid when I access site24x7's API.

2020/06/02 10:14:21 Failed to retreive current status. Cause: Could not execute request https://www.site24x7.com/api/current_status. Got: 401 - 401

svenstaro commented 4 years ago

I noticed and am currently building a replacement using the new API and allowing more monitoring to take place. Check out https://github.com/svenstaro/site24x7_exporter. There's currently nothing there but it will be working soon! Would be great if you could try it. :)

svenstaro commented 4 years ago

Check my exporter now. It's working rather well for me and there's even a handy Docker image which you can try.

ghost commented 4 years ago

@svenstaro Thanks. I'm going to try it out.

ghost commented 4 years ago

I'm getting error below when running it using your docker image. I tried to docker exec into the container to print the env vars and etc but couldn't. I know my client ID, client secret, and refresh token are correct b/c I wrote an exporter as well using Python and it's working correct. The command I ran is below as well.

14:06:11 [ERROR] ApiUnknownError("Invalid value passed for authtoken.")

docker run \
    -p 9803:9803 \
    -e ZOHO_CLIENT_ID=1000.MASKED\
    -e ZOHO_CLIENT_SECRET=MASKED\
    -e ZOHO_REFRESH_TOKEN=1000.MASKED\
    svenstaro/site24x7_exporter --site24x7-endpoint site24x7.com
$ docker exec -it 2316b5a8a948 env
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"env\": executable file not found in $PATH": unknown

$docker exec -it 2316b5a8a948 /bin/ls
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"/bin/ls\": stat /bin/ls: no such file or directory": unknown
svenstaro commented 4 years ago

Super weird. I'll take a look at it shortly. You can't debug the docker container because it only contains a single executable and there are no other tools in there, by the way.

Pretty sure the reason is you're not providing the access data in the correct format (or at least not in the format I expect). I'll check.

On Wed, Jun 24, 2020, 16:34 Chung Tran notifications@github.com wrote:

I'm getting error below when running it using your docker image. I tried to docker exec into the container to print the env vars and etc but couldn't. I know my client ID, client secret, and refresh token are correct b/c I wrote an exporter as well using Python and it's working correct. The command I ran is below as well.

14:06:11 [ERROR] ApiUnknownError("Invalid value passed for authtoken.")

docker run \ -p 9803:9803 \ -e ZOHO_CLIENT_ID=1000.MASKED\ -e ZOHO_CLIENT_SECRET=MASKED\ -e ZOHO_REFRESH_TOKEN=1000.MASKED\ svenstaro/site24x7_exporter --site24x7-endpoint site24x7.com

$ docker exec -it 2316b5a8a948 env OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"env\": executable file not found in $PATH": unknown

$docker exec -it 2316b5a8a948 /bin/ls OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"/bin/ls\": stat /bin/ls: no such file or directory": unknown

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/echocat/site24x7_exporter/issues/5#issuecomment-648858953, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAANACC76R7UX3F3VYID4TRYIFG7ANCNFSM4NQYVU6A .

ghost commented 4 years ago

All the env vars are strings and below are the first portion of my client ID, secret, and refresh token.

    -e ZOHO_CLIENT_ID=1000.EPYFP3LOQIOLOREMOVED \
    -e ZOHO_CLIENT_SECRET=58cd08727bf19829eREMOVED \
    -e ZOHO_REFRESH_TOKEN=1000.352d73815d1245REMOVED.5c3a6105b1cREMOVED
svenstaro commented 4 years ago

Can you post an issue on my exporter? It seems wrong to talk about issues for other projects here.

ghost commented 4 years ago

Sorry about that. I'll do that.