Ad Widget

Collapse

Displaying the ICMP status of a hosts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #1

    Displaying the ICMP status of a hosts

    A modification that adds a simple ICMP check status to frontend 5.2 with an icon next to the standard ones.

    Click image for larger version  Name:	icmp_aval_1.png Views:	0 Size:	20.8 KB ID:	413764
    Click image for larger version  Name:	icmp_aval_2.png Views:	0 Size:	8.8 KB ID:	413765


    It consists of 3 components:
    1) Modification of the zabbix database db_update.sql (adding fields to the hosts table. Does not affect the rest of the work and updates. checked for updates 4.0 > 4.2 > 4.4 > 5.0 > 5.2)
    2) Changing php files in the frontend directory. (presented in the form of diff files. inside there is a path to the file being modified)
    3) Script icmp_avaliable.php and the icmp_avaliable.sh wrapper to run through the scheduler. Retrieves the status of all active icmpping keys via the API and updates the corresponding state in the database.

    How to configure:
    1) create a zabbix user with api request execution rights. To register it in the file icmp_avaliable.php.
    2) make changes to the database according db_update.sql. you can use the entire sql file or you can make changes line by line with monitoring of what is happening (recommended)
    3) change the php files in the frontend directory (4 files). Make sure to create a backup first!
    4) Attention! Script icmp_avaliable.php written to connect to the Postgresql database! To work with other databases, make changes to the ACCESS_CONNECTION_STRING database connection string and call the appropriate functions instead of pg_ )
    5) configure script execution in the scheduler icmp_avaliable.php (or icmp_avaliable.sh) with the frequency you need. First, try running it manually to control how it works.

    Модификация добавляющая во frontend 5.2 состояние простой проверки ICMP иконкой рядом со стандартными.

    Состоит из 3х компонентов
    1) Модификация базы данных zabbix - db_update.sql (добавление полей в таблицу hosts. Не влияет на остальную работу и обновлени. проверено при обновлениях 4.0 > 4.2 > 4.4 > 5.0 > 5.2)
    2) Изменение php файлов в каталоге с frontend. (представлены в виде diff файлов. внутри есть путь к изменяемому файлу)
    3) Скрипт icmp_avaliable.php и обертка icmp_avaliable.sh для запуска через планировщик. Получает через API состояние всех активных ключей icmpping и обновляет соответствующее состояние в базе данных.

    Как настроить:
    1) создать пользователя zabbix с правами выполнения запросов api. Прописать его в файле icmp_avaliable.php.
    2) внести изменения в базу данных. можно целиком использовать файл sql или вносить построчно с контролем происходящего (рекомендуется)
    3) изменить файлы php в каталоге с frontend (4 штуки). Обязательно создайте резервную копию!
    4) Внимание! Скрипт icmp_avaliable.php написан для подключения к базе Postgresql! Для работы с другими базами данных внесите изменения в строку подключения к базе данных CCS_CONNECTION_STRING и вызов соотвествующих функций вмест
    5) настроить в планировщике выполнение скрипта icmp_avaliable.php (или icmp_avaliable.sh) с нужной вам частотой. Предварительно попробуйте запустить его вручную для контроля работы.
    Attached Files
    Last edited by Hamardaban; 24-11-2020, 10:10.
  • yurtesen
    Senior Member
    • Aug 2008
    • 130

    #2
    Interesting work, but why? that area is used by "Interfaces", ICMP is NOT an interface, why would you put it there?

    I tnink tihngs work better the other way around, I know ICMP is working for a host unless I find it in problems list

    Comment

    • Hamardaban
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • May 2019
      • 2713

      #3
      First, it is placed here, because I think the lack of an INTERFACE for simple checks is an architectural flaw of the developers. Secondly, most of the questions that zabbix users (who do not read the documentation) have : why does the host work and the ICON is gray? Now green! :-)

      Comment

      • yurtesen
        Senior Member
        • Aug 2008
        • 130

        #4
        Originally posted by Hamardaban
        First, it is placed here, because I think the lack of an INTERFACE for simple checks is an architectural flaw of the developers. Secondly, most of the questions that zabbix users (who do not read the documentation) have : why does the host work and the ICON is gray? Now green! :-)
        But Zabbix does not really talk to host using ICMP, so not a flaw that it is not an interface.. Shouldn't you put HTTP/S, SSH, SMTP, POP3, IMAP etc. also? they are not much different than ICMP. Well..., I have hosts where ICMP is disabled but HTTPS or SSH works. So the next popular question that users will have will be why it works if ICMP icon gray? I even have hosts which can't be reached, only active agent works...

        Comment

        • Hamardaban
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2019
          • 2713

          #5
          As I already wrote, the "interface" is not only for icmp (as a Protocol), but for simple checks.
          And the fact that Zabbix uses fping for icmp requests does not change anything in fact. Zabbix also uses libcurl for pop3 imap snmp - but who cares?
          PS If you don't agree with the concept, just don't use the suggested solution.

          Comment

          • velaar
            Junior Member
            • May 2021
            • 2

            #6
            Hamardaban It looks like files are no longer available. (Or I can't find the link). Can you re-post them please

            Comment

            • Hamardaban
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • May 2019
              • 2713

              #7
              link below “Attached Files” at the end of first post
              Attached Files
              Last edited by Hamardaban; 08-05-2021, 19:19.

              Comment

              • velaar
                Junior Member
                • May 2021
                • 2

                #8
                Originally posted by Hamardaban
                link below “Attached Files” at the end of first post
                Interesting. I don't see it in the first port but was able to download it from your attachment here. Thanks a lot!

                Comment

                • Hamardaban
                  Senior Member
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • May 2019
                  • 2713

                  #9
                  This is some kind of error in the forum engine

                  Comment

                  • NE1Scott
                    Member
                    • Jan 2021
                    • 49

                    #10
                    This is exactly what i was looking for. I never looked at those icons as "interfaces" since ZBX is just software, not an interface.

                    I looked at the icons as "Methods of testing". ICMP for those that don't support a zabbix agent that are being monitored by ICMP (fping) and ZBX for those that are running the agent.
                    SNMP, HTTP, HTTPS also seem like they could be valid icons.JMX and IPMI I am not familiar with.

                    Of ALL of the possible Icons I would think that an ICMP icon is most needed since in my first thousand machine those are the only 2 types I have used thus far.
                    Please include it in the default Zabbix versions going forward for the sanity of the rest of us. otherwise we have to click on each one if we want to verify icmp is working.
                    My problems screen is clustered with hundreds of false negatives per day so it is not my go-to resource.

                    Not having an exclusion syntax in search / filter makes it almost unusable since I can't clear the noise to see the problems I care about.

                    Comment

                    • Hamardaban
                      Senior Member
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • May 2019
                      • 2713

                      #11
                      How to interpret the meaning of icons is repeatedly written in the documentation - the system is delivered "as is" and if it is done so, then we use it.
                      Interface icons are a secondary thing! The main thing is triggers and problems. If you have a lot of false, noisy triggers, it means that something needs to be changed in the approach to monitoring.

                      For your information-in version 5.4, there is a possibility of exclusive filtering by tags.
                      PS
                      I am not a system developer. If you want something to be included in the main assembly, please contact the company directly.

                      Comment

                      • carnevale
                        Junior Member
                        • Jul 2021
                        • 2

                        #12
                        I'm trying to implement this solution in 5.4 , but looks like the files are different now. Any update of php files for 5.4 ?

                        Comment

                        • Hamardaban
                          Senior Member
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • May 2019
                          • 2713

                          #13
                          In version 5.4, working with host’s interfaces has changed a lot. This patch is no longer supported.

                          Comment

                          • NE1Scott
                            Member
                            • Jan 2021
                            • 49

                            #14
                            For v5.2 and newer there are always things we just want to use ICMP Ping template on and we'd like to have a Green or Red icon for EVERY host entry in Zabbix.
                            I would expect RED icons mean we need to check out the host as there is a connectivity or configuration problem based on the templates chosen.
                            I would expect GREEN icons mean communication witht he host is fine and the template configuration is working fine for the host.

                            The Problems page to me is just a way to catch my attention if there is a problem but there are so many i-don't-care-about-it alerts popping off all the time that any true problems get lost in the noise.
                            The hosts page Availability icons are what I use to judge whether zabbix monitoring is working or not for a host so when it isn't GREEN or RED it bothers me because I then have to look at the latest data to see if it is working at all.
                            And why can't we sort that column so I can see ONLY the red ones at the top to troubleshoot.

                            With 786 hosts currently and more being added daily I'm obviously trying to figure out how to efficiently evaluate host Problems from monitoring alerts as well as problems with the configuration of hosts as they are added (multiple people are adding them).

                            Comment

                            • Hamardaban
                              Senior Member
                              Zabbix Certified SpecialistZabbix Certified Professional
                              • May 2019
                              • 2713

                              #15
                              Please request for development on the official website

                              Comment

                              Working...