Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: need help
Post: RE: need help
cmd1 = "tail -n 10 /home/anv/log_data/2020-01-23abc-itunesmonitor |grep -E 'guest.abc|itunes_dfvi' | awk '{print $1}' | awk -F, '{print $2'} | awk -F} '{print$1}'"
out1, err1 = subprocess.Popen(cmd1,... |
|
deepakkr3110 |
General Coding Help |
3 |
1,838 |
Jan-24-2020, 10:07 AM |
|
|
Thread: need help
Post: need help
Hello
i have ten line of results like
Count
0
0
0
0
0
0
0
0
0
0
this is the results of 10 lines and i want to run a loop to check if the value of my any line become 1 than my loop will run, so can ... |
|
deepakkr3110 |
General Coding Help |
3 |
1,838 |
Jan-24-2020, 09:59 AM |
|
|
Thread: ssh script help
Post: RE: ssh script help
any idea about code in ansible? @ndc85430 |
|
deepakkr3110 |
General Coding Help |
3 |
1,925 |
Dec-17-2019, 08:26 AM |
|
|
Thread: ssh script help
Post: ssh script help
Hello
I have more than 90+ servers and each time a new user add in our group so we have to add their SSH key to each server to give access to the server, so tell me is there any way to do this task i... |
|
deepakkr3110 |
General Coding Help |
3 |
1,925 |
Dec-17-2019, 07:48 AM |
|
|
Thread: hatop issue
Post: try and catch
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... |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-29-2019, 07:15 AM |
|
|
Thread: use of sys.argv
Post: RE: use of sys.argv
ok. my issue is i don't want to pass argument every time so i define all the arguments in my file called configuration-file.ini and i want it to read from this file, so you tell me how can i do so?
e... |
|
deepakkr3110 |
General Coding Help |
3 |
3,003 |
Nov-29-2019, 05:02 AM |
|
|
Thread: use of sys.argv
Post: use of sys.argv
hello
what is the use of
if __name__ == "__main__":
main(sys.argv[1:])can i pass my file name in this? |
|
deepakkr3110 |
General Coding Help |
3 |
3,003 |
Nov-29-2019, 04:42 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
i just want that i don't want to give full path of my sock file every time while running this program, i just want to run via my program_name.py and it will read the sock path from a file called abc.i... |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-29-2019, 04:21 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
yes its print the path
but i want output like this
https://github.com/JamesBarwell/haproxy-status.py
i just want that i don't want to give full path of my sock file every time while running this p... |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 10:28 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
for filename in sys.argv[1:]:
readfile(sockets)like this? or can you show me some example. |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 08:59 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
yeah its print the socket file path
https://github.com/JamesBarwell/haproxy-status.py
see Example output
i want this output also |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 08:38 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
ok, thank you so much for your time. |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 08:31 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
i just want that i don't want to give full path of my sock file every time while running this program, i just want to run via my program_name.py and it will read the sock path from a file called abc.i... |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 08:25 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
this is the code on github https://github.com/JamesBarwell/haproxy-status.py have a look |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 08:19 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
python hatop.py
[]this the output
python hatop.py /var/run/haproxy-main-hello.sock give me output but python hatop.py not
this is the code on github https://github.com/JamesBarwell/haproxy-status.py |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 08:13 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
nothing print after removing .split('\n') |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 07:40 AM |
|
|
Thread: hatop issue
Post: RE: hatop issue
getting error
Traceback (most recent call last):
File "hatop.py", line 9, in <module>
sockets = config.read('spam', 'sockets').split('\n')
AttributeError: 'list' object has no attribute '... |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 07:18 AM |
|
|
Thread: hatop issue
Post: hatop issue
i have a code for hatop in python
#!/usr/bin/python
import socket
import csv
import sys
sys.stdout = open('output.txt','wt')
RECV_SIZE = 1024
PRINT_COLS = {
'pxname': 0,
'svname': 1,
... |
|
deepakkr3110 |
General Coding Help |
22 |
7,264 |
Nov-28-2019, 06:12 AM |
|
|
Thread: want same code in python
Post: want same code in python
date_default_timezone_set('UTC');
while(1){
$seconds=date('s');
if($seconds ==' 00'){
while(1){
echo date("d/M/Y:H:i:s")." Current Time\n";
$seconds=date('s');
... |
|
deepakkr3110 |
General Coding Help |
1 |
1,811 |
Nov-22-2019, 06:08 AM |
|
|
Thread: time issue
Post: time issue
this is my python code
dateTimeObj = datetime.now()
timestampStr = dateTimeObj.strftime("%d/%b/%Y:%H:%M:%S")
print'Today Current Timestamp : ', timestampStr
and i want to print last 10 second
like c... |
|
deepakkr3110 |
General Coding Help |
1 |
1,591 |
Nov-21-2019, 10:26 AM |