Ad Widget

Collapse

How to monitor if a unix socket exists?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ludiegu
    Junior Member
    • Oct 2020
    • 3

    #1

    How to monitor if a unix socket exists?

    Hello all, I am trying to make a custom template that checks if the unix socket:

    Code:
    /run/php/php7.2-fpm.sock
    exists. I tried the
    Code:
    vfs.file.exists
    , but it does not work as expected:

    Code:
    zabbix_agentd -t "vfs.file.exists[/run/php/php7.2-fpm.sock]"
    vfs.file.exists[/run/php/php7.2-fpm.sock] [u|0]
    but the file exists:

    Code:
    ls -l /run/php/php7.2-fpm.sock
    srw-rw---- 1 www-data www-data 0 Sep 9 08:46 /run/php/php7.2-fpm.sock
    the OS is an Ubuntu 18.04.

    seems like there is something strange with the
    Code:
    /run
    , Can someone help me understanding why it is not working and/or suggest another way to accomplish what I need?

    Thanks for your time!
  • tim.mooney
    Senior Member
    • Dec 2012
    • 1427

    #2
    Originally posted by ludiegu
    Code:
    zabbix_agentd -t "vfs.file.exists[/run/php/php7.2-fpm.sock]"
    vfs.file.exists[/run/php/php7.2-fpm.sock] [u|0]
    Read the documentation for vfs.file.exists[], including the description of the 2nd argument.

    Comment

    • ludiegu
      Junior Member
      • Oct 2020
      • 3

      #3
      Originally posted by tim.mooney

      Read the documentation for vfs.file.exists[], including the description of the 2nd argument.
      Thanks for your reply. If I am not mistaken, it does not work with unix sockets, right?

      Do you have a suggestion on how to achive what I need? I am pretty new to zabbix.
      Thanks!

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #4
        Originally posted by ludiegu

        Thanks for your reply. If I am not mistaken, it does not work with unix sockets, right?
        What version of Zabbix are you using?


        Comment

        • ludiegu
          Junior Member
          • Oct 2020
          • 3

          #5
          I am using 4.4

          Comment

          • tim.mooney
            Senior Member
            • Dec 2012
            • 1427

            #6
            The documentation I was referencing shows that the socket type is supported at Zabbix 5.0.2 and later.

            Comment

            Working...