Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Albin_Petersson
Contributor
Jump to solution

How to troubleshoot REST.py error?

Hello again.

 

So I've added 1 firewall to my prometheus server, and it worked out. Now when I try to add the 2nd one which should be identical, the python REST-script refuses the JSON-file.

Both are physical appliances running R81.10, take T81.

Error message is "error: unrecognized arguments:"

I even copied the file that enabled the telemetry from FW1 to FW2 and tried it, same problem. No TLS is used, so it's quite simple...

Any hints on where to look?

0 Kudos
1 Solution

Accepted Solutions
Vincent_Bacher
Advisor
Advisor

Isn't the correct syntax

/opt/CPotelcol/REST.py --set_open_telemetry "$(cat payload_kf101.json)"

i.e., in inverted commas (") ?

# ./REST.py --set_open_telemetry $(cat payload.json)
usage: REST.py [-h]
(--show_open_telemetry | --set_open_telemetry SET_OPEN_TELEMETRY)
REST.py: error: unrecognized arguments: "enabled": true, "export-targets": {"add": [


# ./REST.py --set_open_telemetry "$(cat payload.json)"
{"message": "Operation has finished successfully"}

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite

View solution in original post

(1)
5 Replies
the_rock
Legend
Legend

Is it a cluster or another single appliance managed by same management? That error is super generic, hard to even guess, specially considering you used same file for the first firewall. Is that the only error message you get?

0 Kudos
Albin_Petersson
Contributor

it's a cluster.

Here's the full output, i removed the ip-address. 

/opt/CPotelcol/REST.py --set_open_telemetry $(cat payload_kf101.json)
usage: REST.py [-h] (--show_open_telemetry | --set_open_telemetry SET_OPEN_TELEMETRY)
REST.py: error: unrecognized arguments: "enabled": true, "export-targets": {"add": [ { "enabled": true, "type": "prometheus-remote-write", "url": "http://<ip>:9090/api/v1/write" } ]} }

 

 

Is there any logs anyhere or some other way to troubleshoot? different parameters?

i looked a bit at the rest.py-file, but it wasn't fun for someone that doesn't have much python experience or in-depth knowledge about this project.

0 Kudos
Vincent_Bacher
Advisor
Advisor

Isn't the correct syntax

/opt/CPotelcol/REST.py --set_open_telemetry "$(cat payload_kf101.json)"

i.e., in inverted commas (") ?

# ./REST.py --set_open_telemetry $(cat payload.json)
usage: REST.py [-h]
(--show_open_telemetry | --set_open_telemetry SET_OPEN_TELEMETRY)
REST.py: error: unrecognized arguments: "enabled": true, "export-targets": {"add": [


# ./REST.py --set_open_telemetry "$(cat payload.json)"
{"message": "Operation has finished successfully"}

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
(1)
Albin_Petersson
Contributor

It was! that was easy at least. 🙂

Human error strikes again.

the_rock
Legend
Legend

Easy to overlook, glad it works, thanks to @Vincent_Bacher 💪

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events