Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
hatop issue
#21
hello

how can i add try and catch block in this python program, if the sock file exit on the server it will run and escape if sock file is not there https://github.com/JamesBarwell/haproxy-...-status.py
Reply
#22
There is no code using configuration file. Please, don't start new threads just to make someone to write the code for you. Implement what was advised in post # 2 of this thread

EDIT: I didn't realise it's not your repo at all. So basically you want someone to write/change code for you - using configuration file and creating desired output. This is not how the forum works.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#23
I'm bit not clear about your concern. In the above scenario also, we are reading the sock using .ini file only right? Till getting all the socket files, you can use above code and the output content you can modify according to the socket details you want to print. You can parse file by file and you can decide the exact output you are looking for. Hope this answers to your question.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  need code for hatop in python deepakkr3110 2 2,042 Nov-15-2019, 09:06 AM
Last Post: deepakkr3110

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020