Ad Widget

Collapse

Proc.num issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kksan
    Junior Member
    • Jul 2018
    • 14

    #1

    Proc.num issue

    Hi all,

    I'm having an issue with this trigger
    {HOST: proc.num[process,,run].last()}<1
    I configured the item and the trigger via Web.
    The problem is that Zabbix gets a 0 as a result even if the process is running or stopped.
    I attached the item configuration.
    How can I solve this one?
    Thank you in advance.
    Attached Files
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Need to check that the process status is run?
    For example, do you want to execute the following command and check that the STAT part is R?

    Code:
    # ps aux
    The run option is not necessary if you only check if the process is started.

    Comment

    • kksan
      Junior Member
      • Jul 2018
      • 14

      #3
      Originally posted by Atsushi
      Need to check that the process status is run?
      For example, do you want to execute the following command and check that the STAT part is R?

      Code:
      # ps aux
      The run option is not necessary if you only check if the process is started.

      This is the result

      # ps aux | grep dsclient
      dsclient 12677 0.0 0.0 168644 2344 ? S Mar11 0:04 /opt/CloudBackup/DS-Client/db/pgsql/bin/postgres -D /opt/CloudBackup/DS-Client/db/pgsql/data
      root 12687 22.6 34.1 6697324 2046804 ? Ssl Mar11 903:03 ./bin/unixdsclient --lang en -d
      dsclient 12689 0.0 0.5 168876 35784 ? Ss Mar11 1:39 postgres: writer process
      dsclient 12690 0.0 0.0 168644 1576 ? Ss Mar11 0:38 postgres: wal writer process
      dsclient 12691 0.0 0.1 170032 11680 ? Ss Mar11 0:15 postgres: autovacuum launcher process
      dsclient 12692 0.0 0.0 128908 784 ? Ss Mar11 0:43 postgres: stats collector process
      dsclient 12694 14.0 4.5 432172 273612 ? Ss Mar11 560:23 postgres: dsclient dsclient [local] idle
      dsclient 12695 14.0 3.1 327200 185868 ? Ss Mar11 561:10 postgres: dsclient dsclient [local] idle
      dsclient 12696 14.3 4.6 436300 277456 ? Rs Mar11 571:02 postgres: dsclient dsclient [local] SELECT
      dsclient 12697 14.9 6.5 552604 394740 ? Ss Mar11 594:04 postgres: dsclient dsclient [local] idle
      dsclient 12698 14.4 6.5 536972 390240 ? Ss Mar11 574:19 postgres: dsclient dsclient [local] idle
      dsclient 12699 0.0 0.0 170016 2840 ? Ss Mar11 0:00 postgres: dsclient dslanfiles [local] idle
      dsclient 12700 0.0 0.0 170068 2208 ? Ss Mar11 0:00 postgres: dsclient dslanfiles [local] idle
      dsclient 12701 0.0 0.0 170068 2212 ? Ss Mar11 0:00 postgres: dsclient dslanfiles [local] idle
      root 21244 0.0 0.0 103256 832 pts/0 S+ 09:56 0:00 grep dsclient

      Can you give me an hint?

      Comment


      • Atsushi
        Atsushi commented
        Editing a comment
        What kind of state do you want to judge as failure?
        Do you want to monitor postgres processes?
        According to the result of ps command posted, it seems that the process which is in the run state is only the process which is processing the SELECT, and the other processes are not in the run state.

        If the condition you initially posted is that the run state is less than 1, do you always want to monitor that database access processing such as SELECT is being executed?
        If the postgres process is up and functioning as a DBMS, I think that you should just check the number of processes instead of checking the number of processes in the run state, as described above.

        ex.
        {HOST: proc.num[process].last()}<1

      • kksan
        kksan commented
        Editing a comment
        {HOST: proc.num[process].last()}<1 still gives me a 0, it was the first try I did when I saw there were sleeping processes.
        If the process is running or sleeping to me is ok.
    • kksan
      Junior Member
      • Jul 2018
      • 14

      #4
      Also tried the "solution" found here

      Comment

      • kksan
        Junior Member
        • Jul 2018
        • 14

        #5
        With the command
        Code:
        zabbix_get -s 10.200.19.4 -k "proc.num[postgres: dsclient dsclient [local] idle]"
        I got result 5. This would be ok, and would let me monitor the process, but if I use this code, Zabbix says that synthax is wrong. May I try via CLI? I dont know how

        Comment

        • kksan
          Junior Member
          • Jul 2018
          • 14

          #6
          "Solved" with
          Code:
          {HOST: proc.num[,dsclient].last()}<1
          If the process is running, the query:
          Code:
          zabbix_get -s 10.200.19.4 -k "proc.num[postgres: dsclient dsclient [local] idle]"
          Gives a result with every process. If the process is stopped, it gives me 0. Probably not the best solution, but it's working.
          Last edited by kksan; 14-03-2019, 13:06.

          Comment

          Working...