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

Result code is not set correctly with ping and method = "native" #6521

Closed
priyankamondalairtel opened this issue Oct 14, 2019 · 8 comments · Fixed by #6563
Closed

Result code is not set correctly with ping and method = "native" #6521

priyankamondalairtel opened this issue Oct 14, 2019 · 8 comments · Fixed by #6563
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@priyankamondalairtel
Copy link

Hi,
telegraf version: telegraf-1.12.2

I am monitoring 3000 IPs from a single telegraf config file, using method "native". PFB telegraf configuration for ping:
[agent]
interval = "120s"

[[inputs.ping]]
urls = ["**********","*****", "10.10.10.10"]
method = "native"
count = 3
timeout = 10.0

below is the output of this configuration:
[root@N1VL-PA-INFL01 ~]# telegraf --config /etc/telegraf/telegraf.conf --test | grep -i 10.10.10.10
2019-10-14T08:00:23Z I! Starting Telegraf 1.12.2

ping,IP=10.14.124.23,host=N1VL-PA-INFL01,url=10.10.10.10 average_response_ms=1.437718,maximum_response_ms=2.466695,minimum_response_ms=0.660697,packets_received=3i,packets_transmitted=3i,percent_packet_loss=0,result_code=0i,standard_deviation_ms=0.758515,ttl=63i 1571040027000000000

where this IP does not exist, and result_code should not be 0:

[root@N1VL-PA-INFL01 ~]# ping -c 3 -W 10 10.10.10.10
PING 10.10.10.10 (10.10.10.10) 56(84) bytes of data.

--- 10.10.10.10 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms

[root@N1VL-PA-INFL01 ~]#

there is few IPs which are individually getting pinged from source server but in telegraf result_code is showing '2'.
Can you please help to rectify this error?

@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Oct 14, 2019
@danielnelson danielnelson changed the title error in [[inputs.ping]] Result code is not set correctly with ping and method = "native" Oct 14, 2019
@glinton
Copy link
Contributor

glinton commented Oct 14, 2019

@priyankamondalairtel
Copy link
Author

priyankamondalairtel commented Oct 15, 2019 via email

@priyankamondalairtel
Copy link
Author

can you please suggest if [[inputs.ping]] will work for 3000 IPs from a single config file using method 'exec'?

@danielnelson
Copy link
Contributor

Still getting same error that getting result_code as 0, where this IP is actually not exist.

Does this happen only when running with many IPs, or can you reproduce it with only the single address listed?

3000 IPs from a single config file using method 'exec'?

I think that would be too much, since it needs to fork a process for each IP.

@rguptarg
Copy link

For Native method, it is giving same result (result_code=0) either I am using single url/IP.

But for exe method , it is working properly but I can't use multiple url /IP under exe method.

@danielnelson
Copy link
Contributor

@glinton Can you check the output below, I think we shouldn't emit any errors and only the last summary metric but with result_code=2i.

[[inputs.ping]]
  urls = ["10.10.10.10"]
  count = 3
  timeout = 1.0
  method = "native"
2019-10-17T19:44:13Z E! [inputs.ping] Error in plugin: context deadline exceeded
> ping,url=10.10.10.10 result_code=2i 1571341454000000000
2019-10-17T19:44:14Z E! [inputs.ping] Error in plugin: context deadline exceeded
> ping,url=10.10.10.10 result_code=2i 1571341455000000000
2019-10-17T19:44:15Z E! [inputs.ping] Error in plugin: context deadline exceeded
> ping,url=10.10.10.10 result_code=2i 1571341456000000000
> ping,url=10.10.10.10 packets_received=0i,packets_transmitted=3i,percent_packet_loss=100,result_code=0i 1571341456000000000

@danielnelson danielnelson added this to the 1.12.4 milestone Oct 17, 2019
@sjwang90 sjwang90 added the ready label Oct 18, 2019
@goller
Copy link
Contributor

goller commented Oct 21, 2019

  • Check what the result_code of ping exe is when the IP address is not reachable.
  • Check what the result_code of ping exe is when the executable is not available.

ping,IP=10.14.124.23,host=N1VL-PA-INFL01,url=10.10.10.10 average_response_ms=1.437718,maximum_response_ms=2.466695,minimum_response_ms=0.660697,packets_received=3i,packets_transmitted=3i,percent_packet_loss=0,result_code=0i,standard_deviation_ms=0.758515,ttl=63i 1571040027000000000

Find root cause of ^^

@rguptarg
Copy link

Hi

Please let me know if any output required from my end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants