[ZBXNEXT-739] Add ping to agent capabilities Created: 2011 Apr 12 Updated: 2024 Nov 20 |
|
Status: | Open |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Agent (G) |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature Request | Priority: | Minor |
Reporter: | Raymond Kuiper | Assignee: | Unassigned |
Resolution: | Unresolved | Votes: | 75 |
Labels: | ICMP, fping, item | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
Description |
I would like to see the zabbix agent to be able to ping hosts on it's own. |
Comments |
Comment by Alexei Vladishev [ 2011 Apr 12 ] |
Note that the agent would require super-user privileges to do that. |
Comment by Raymond Kuiper [ 2011 Apr 12 ] |
Maybe we could use the same approach as with the server, fping installed with setuid? |
Comment by Raymond Kuiper [ 2012 Aug 30 ] |
Sooo, any progress on this? |
Comment by tagwolf [ 2014 Oct 22 ] |
I have a workaround for this. UserParameter=chk.fping[*],fping -c 3 $1 2>&1 | tail -n 1 | awk '{print $$8}' | cut -d/ -f2 But the fact that stuff like this needs to be worked around means these guys need more help and community code support as they cannot implement new features fast enough. This should not be a 3 year old ticket. Nor is it a minor feature I'm considering forking the code and making some changes in my personal feature request queue. In particular in the UI and in expression handling and item storage flexibility, item and string comparison evaluations, easier construction and better testing of triggers, inventory support, using zabbix as a ENC for puppet / chef, Server-Agent SSL, etc. Jira is messing up my UserParameter line.... it's all one line, and no spaces in between the single quotes in awk. |
Comment by Marc [ 2014 Oct 22 ] |
tagwolf, instead to go for a fork may I encourage you to collaborate by providing small patches? Btw, you might possibly want to add youre one-liner here. Another awesome event to collaborate are Bugsquash days. For further arrangements or discussions look in at IRC or forums. |
Comment by tagwolf [ 2014 Oct 22 ] |
I'd love to do some patches according and have no problem following your coding standards. If though I have a larger modification, who would I talk to about user stories, testing and possible integration with the main codebase? Also I think it's awesome you guys are doing bugsquash days! I'll check them out. |
Comment by richlv [ 2014 Oct 22 ] |
it's probably best to start with really small patches and push those through the bugsquash days, otherwise large patches are unlikely to get any attention (unfortunately) - but the best place for such discussions is irc |
Comment by Michael P [ 2014 Oct 29 ] |
Hi I improved the Userparameter a bit for those of you who want to know: Instead of defining a fixed column ($$8) I use the last column with $NF. and as the middle value of every output is either avg latency, or received packets, it will always be a value can measure stuff. UserParameter=chk.fping[*],/usr/bin/fping -c 3 $1 2>&1 | tail -n 1 | awk '{print $NF}' | cut -d '/' -f2 PS: on my FreeBSD machine i had to provide the full path, so please (to all) check the correct path to fping ('type fling') and always provide it. Best regards |
Comment by Marc [ 2014 Oct 30 ] |
Daywalker, you might want to take a look at User parameter one-liners too. |
Comment by Arnis Rukis [ 2016 Mar 14 ] |
Looking for simple way to mesure ping response times from host to host, for example from remote machine to zabbix server. To monitor situations where ping goes >100 ms for example. |
Comment by John Smith [ 2018 Oct 26 ] |
Yes, ping. Of course. Absolutely needed. Very basic. Low hanging fruit. Please do it already. I have never seen any network monitoring setup that does not use ping - it is the first thing every experienced admin will implement across networks / host groups / etc. So with Zabbix you have currently this experience: ok, lets implement ping for all the things - oh, Zabbix does not support that out of the box, I need to fiddle around with manually editing config parameters and such, o my god. Please implement that. Thanks. Or at least implement something similar that zabix-agent will do out of the box by default. |
Comment by Glebs Ivanovskis [ 2019 May 12 ] |
This request can be implemented as a loadable module (i.e. outside of Zabbix code base) if there is enough interest. ZBXNEXT-2735 mentions liboping, module can simply wrap it. Or to avoid granting capabilities to Zabbix binaries there can be a standalone daemon to do the pinging and the module will simply query that daemon. |
Comment by Nicola Mauri [ 2020 Mar 10 ] |
This feature is indispensable, for example, to check if a remote server is reachable from the intended client (not from zabbix server). In the meanwhile, here's a similar workaround for Windows agents: UserParameter=ping.host[*],ping -n 1 $1 > nul && echo 1 || echo 0 |
Comment by Victor Sudakov [ 2020 May 22 ] |
For Unix you can use something as simple as UserParameter=ping.host[*],/usr/bin/fping -q -r 3 $1 ; echo $? Eliminates the need for screen-scraping fping output, "0" means host is reachable and "1" means not reachable. But I agree it's high time to implement this in the agent. |
Comment by dimir [ 2021 Jun 09 ] |
FYI there is a patch for agent2 from one of community members, klimenko.andrei: |
Comment by Raul Chiarella [ 2021 Sep 22 ] |
It would be useful if we could use icmpping like we use net.tcp.service... |
Comment by Raul Chiarella [ 2021 Sep 22 ] |
@Nicola Mauri Hello. So i tried your UserParameter for Windows but it didnt work... ping -n 1 192.168.1.1 > nul && echo 1 || echo 0 always returns 1 even when its disconnected. |
Comment by Scott Jalbert [ 2021 Dec 07 ] |
Yes I would also really like to see this implemented. I'm also struggling with getting the userparameter working successfully, works when connected but when timeout occurs item goes to Not Supported with info Timeout while executing shell script. Agent log contains below, and of course the trigger won't work. 7760:20211207:070606.891 Failed to execute command "ping 10.10.0.11 -n 1 |find "TTL=">NUL && echo 1 || echo 0": Timeout while executing a shell script. |
Comment by richlv [ 2022 Sep 22 ] |
Try to set the ping timeout lower than the agent/server timeout - if the ping timeout is longer, the agent/server communication times out first. |
Comment by Gary Herbstman [ 2023 May 23 ] |
This simple common function should not be so difficult and inconsistent to implement. The agent should be able to run ping just like the server simple check. |
Comment by Mickael Martin [ 2024 Oct 18 ] |
another way, native : wmi.getallroot\cimv2,"SELECT PrimaryAddressResolutionStatus, StatusCode, ResponseTime FROM Win32_PingStatus WHERE Address='{#ADDR}' AND Timeout=2000"
|
Comment by Aleksey Volodin [ 2024 Oct 28 ] |
Maybe this will help someone. icmppingsec for Zabbix Agent on Windows.
UserParameter=icmppingsec[*], powershell -NoProfile -ExecutionPolicy bypass -Command "Test-Connection -ComputerName $1 -Count 4 | Measure-Object ResponseTime -Average | ForEach-Object { '{0:N5}' -f ($_.Average / 1000) -replace ',', '.'}"
|