Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N/A status #2

Open
afreisinger opened this issue Jul 25, 2023 · 6 comments
Open

N/A status #2

afreisinger opened this issue Jul 25, 2023 · 6 comments

Comments

@afreisinger
Copy link

Hi !
I don't understand what's going on. I get N/A status every time. The process is running. The output tail -f /tmp/tmux_ping_result is always -1 and what catches my attention is tail -f /tmp/tmux_ping.log always empty. I don't understand what could be happening. I am running tmux on Darwin system. Any ideas ?
Thanks

@ayzenquwe
Copy link
Owner

Hi,

Thanks for reporting the issue. I'm currently in the process of relocation, so I don't have enough time to analyze the problem. But hopefully, I'll have some time during the weekend.

@afreisinger
Copy link
Author

Thank you. I'll tell you if I ping from the cli and write to the file, it works...@

@ayzenquwe
Copy link
Owner

ayzenquwe commented Aug 11, 2023

Hey,

It's quite hard to tell why it doesn't work on your system, but if you have some time, we can try to debug the problem.

First, clone the repo and add some additional logging to the main function and probably to the execute_ping function. Something like that, just to understand where it fails:

if ping_not_running; then
    echo "ping is not running"
    ....

Also, just before the ping command you can add this:
echo "ping $number_pings_flag $ping_count $timeout_flag $ping_wait_time $ping_host > $ping_log_file &"

Then, run the script and see what happens: ./ping_status.sh
Try to run it multiple times.

Copy-paste the outputs here.

@ayzenquwe
Copy link
Owner

ayzenquwe commented Aug 11, 2023

By the way, what value have you set for status-interval in tmux config?

@afreisinger
Copy link
Author

Hey,

It's quite hard to tell why it doesn't work on your system, but if you have some time, we can try to debug the problem.

First, clone the repo and add some additional logging to the main function and probably to the execute_ping function. Something like that, just to understand where it fails:

if ping_not_running; then
    echo "ping is not running"
    ....

Also, just before the ping command you can add this: echo "ping $number_pings_flag $ping_count $timeout_flag $ping_wait_time $ping_host > $ping_log_file &"

Then, run the script and see what happens: ./ping_status.sh Try to run it multiple times.

Copy-paste the outputs here.

tmux-ping/scripts on  master [!]
➜ ./ping_status.sh
ping is not running
ping -c 3 -t 10 8.8.8.8 > /tmp/tmux_ping.log &
#[fg=red]N/A

tmux-ping/scripts on  master [!]
➜ ./ping_status.sh
ping is not running
ping -c 3 -t 10 8.8.8.8 > /tmp/tmux_ping.log &
#[fg=green] 24

tmux-ping/scripts on  master [!]
➜ ./ping_status.sh
#[fg=green] 24

In this case the status bar change from N/A to round-trip time value, this work fine.

@afreisinger
Copy link
Author

afreisinger commented Aug 12, 2023

By the way, what value have you set for status-interval in tmux config?

➜ tmux show-options -g | grep status-interval
status-interval 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants