Ad Widget

Collapse

Incorrect trigger expression. Host does not exist or you have no access to this host.

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • senyapsudah
    Junior Member
    • Sep 2020
    • 7

    #1

    Incorrect trigger expression. Host does not exist or you have no access to this host.

    Hi All,

    i'm quite new here. Anyway, i have manage to install zabbix server with 5 proxy server sitting remotely on other network then zabbix server. i have one server being monitor using proxy.

    as per my topic, i receive this message when i try attached a template ready with custom trigger ready with it to the server which is monitored using proxy.
    when i attached the template to server monitor directly from zabbix server, i have no issue with it.

    i also have try to create custom trigger directly to the host, i can see that almost the same error produce when i click on the expression constructor.

    monitor-svr:zimbra.system.service.spell.last()}:Unknown host, no such host present in system


    does is related to the way it is being monitor through proxy? or is there anyway, i can create trigger to monitor the status of the server? please advise.
  • Answer selected by senyapsudah at 08-04-2022, 11:53.
    senyapsudah
    Junior Member
    • Sep 2020
    • 7

    i think we can close this already. have found parts of the issue. after enable debug on the web ui. we can see all the SQL queries that has been run. The SQL queries that relate to the error is
    Code:
    select hostid, host, status from hosts where flags in (0,4) and host="<serverhostname>";
    running the sql query directly to database shows that there is no record of it. after deleting the host and recreate it again we manage to get the correct result. this has been tested few times.

    creating triggers based on the items coming from userparameters now can also be done sucessfully.

    Comment

    • markfree
      Senior Member
      • Apr 2019
      • 868

      #2
      Sorry. I could not understand your question.
      Could you elaborate more on that?
      Maybe, post some pictures.

      Comment

      • senyapsudah
        Junior Member
        • Sep 2020
        • 7

        #3
        Hi Team,

        i would like to bring up this topic one more time.

        currently i have a mail server being monitor by zabbix through zabbix proxy.

        Zabbix server <=========>Zabbix Proxy <==========> Mail server

        i have created a custom template which contain items to monitor mail queue and also trigger when it hits more then 200. this template then being attached to the mail server that i want to monitor. However, whenever i try to attach the template, it keeps complaining that "Incorrect trigger expression. Host "mail.server1" does not exist or you have no access to this host."

        Click image for larger version

Name:	Screenshot 2022-04-04 at 10.48.32 PM.png
Views:	2111
Size:	32.3 KB
ID:	442571

        below is the sample trigger that i have created.

        min(/Template Zimbra Agent Using Proxy/zimbra.queuestat[deferred],5)>200

        Comment

        • markfree
          Senior Member
          • Apr 2019
          • 868

          #4
          Does your user have access to the group the host belongs to?
          Did you create your template trigger using the Expression constructor?

          Comment

          • senyapsudah
            Junior Member
            • Sep 2020
            • 7

            #5
            yes, i'm creating the template using admin account. i believe have all access to the host and group.

            for trigger we create using expression constructor.

            Click image for larger version  Name:	Screenshot 2022-04-05 at 11.39.32 AM.png Views:	3 Size:	146.5 KB ID:	442589

            as additional info, i receive this error only when the host is being monitored by proxy. if i remove monitor using proxy i can add the trigger without any issue. since i create a custom script and load it using userparameter to get the value for zimbra.queuestat[deferred] . do i need to add this script to proxy also?
            Last edited by senyapsudah; 06-04-2022, 05:27.

            Comment

            • senyapsudah
              Junior Member
              • Sep 2020
              • 7

              #6
              i think we can close this already. have found parts of the issue. after enable debug on the web ui. we can see all the SQL queries that has been run. The SQL queries that relate to the error is
              Code:
              select hostid, host, status from hosts where flags in (0,4) and host="<serverhostname>";
              running the sql query directly to database shows that there is no record of it. after deleting the host and recreate it again we manage to get the correct result. this has been tested few times.

              creating triggers based on the items coming from userparameters now can also be done sucessfully.

              Comment

              • bbrendon
                Senior Member
                • Sep 2005
                • 870

                #7
                Any other solutions? I'm seeing this issue with a template on 6.4.17. I'd rather not nuke the template.
                Unofficial Zabbix Expert
                Blog, Corporate Site

                Comment

                • bbrendon
                  Senior Member
                  • Sep 2005
                  • 870

                  #8
                  This also happens on Zabbix 7.0.3 . When trying to link a template to a host that has triggers in it. If you delete the triggers, it links.

                  ```
                  Incorrect trigger expression. Host "xxx" does not exist or you have no access to this host. [zabbix.php:17 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerHostUpdate->doAction() → CApiWrapper->__call() → CFrontendApiWrapper->callMethod() → CApiWrapper->callMethod() → CFrontendApiWrapper->callClientMethod() → CLocalApiClient->callMethod() → CHost->update() → CHost->updateForce() → CHostGeneral->updateTemplates() → CHostGeneral::linkTemplatesObjects() → CTriggerGeneral->syncTemplates() → CTriggerGeneral->inherit() → CTriggerGeneral->createReal() → CTriggerGeneral->implode_expressions() → CApiService::exception() in include/classes/api/services/CTriggerGeneral.php:2051]

                  ```

                  EDIT: Fixed by reindexing the database `REINDEX DATABASE zabbix;`
                  Last edited by bbrendon; 08-09-2024, 06:14.
                  Unofficial Zabbix Expert
                  Blog, Corporate Site

                  Comment

                  Working...