Ad Widget

Collapse

Monitoring Mirth channels with Mirth REST API

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DaLoZ
    Junior Member
    • Aug 2022
    • 25

    #1

    Monitoring Mirth channels with Mirth REST API

    I'm trying to monitor mirth channels with the help of their API but having a hard time to wrap my head around discovery rules.

    I've created a template with an item and some simple preprocessing that retrieves and converts XML to the json data we need.
    Click image for larger version

Name:	image.png
Views:	1539
Size:	14.0 KB
ID:	449569

    Example of the JSON:

    Click image for larger version

Name:	image.png
Views:	1420
Size:	46.5 KB
ID:	449570

    We'd like to monitor the 'queued' count and 'state' of every channel.

    How to create a discovery rule to discovery every channel in the JSON?

    I tried the following but am getting nowhere.

    Click image for larger version

Name:	image.png
Views:	1415
Size:	19.8 KB
ID:	449571
    Click image for larger version

Name:	image.png
Views:	1379
Size:	14.0 KB
ID:	449572

    Click image for larger version

Name:	image.png
Views:	1406
Size:	36.2 KB
ID:	449573
  • Answer selected by DaLoZ at 12-08-2022, 14:48.
    DaLoZ
    Junior Member
    • Aug 2022
    • 25

    I got it working and will post a "guide" in the cookbook section and link it here.

    Comment

    • DaLoZ
      Junior Member
      • Aug 2022
      • 25

      #2
      I did not realize how close I am getting to what we want.

      The Mirth Channel discovery items are being created on the host, but get an error "unknow metric http.mirth.api.channels.discovery"
      Attached Files

      Comment

      • DaLoZ
        Junior Member
        • Aug 2022
        • 25

        #3
        I think I have to use 'dependent item' instead of 'zabbix agent' in the 'Item prototypes'.

        It is unclear to me what I need to user as 'Key':
        Click image for larger version

Name:	image.png
Views:	1384
Size:	45.2 KB
ID:	449591

        Comment

        • DaLoZ
          Junior Member
          • Aug 2022
          • 25

          #4
          This key is not unique to I changed it to:
          [CODE]http.mirth.api.channels["{#CHANNEL.QUEUE}"][\CODE]

          But this gives the result below:
          Click image for larger version

Name:	image.png
Views:	1410
Size:	27.7 KB
ID:	449595
          The queue of the channel is 0, so it can retrieve the data but I dont know where to put it

          Comment

          • DaLoZ
            Junior Member
            • Aug 2022
            • 25

            #5
            Do I need to provide additional info?

            I assumed this would be a simple use case and someone who has done this before would see immediately see this issue.

            Comment

            • DaLoZ
              Junior Member
              • Aug 2022
              • 25

              #6
              Right now a new item get created for every channel with the channel name on the host, but the value contains all the JSON data the API returns instead of just the values I need.

              Comment

            • DaLoZ
              Junior Member
              • Aug 2022
              • 25

              #7
              I already am... And can use the LLD macro's (see the first post), but how do I get the data to be filled in as a value?

              Comment

              • DaLoZ
                Junior Member
                • Aug 2022
                • 25

                #8
                I got it working and will post a "guide" in the cookbook section and link it here.

                Comment

                • simonl
                  Junior Member
                  • Apr 2021
                  • 11

                  #9
                  I've got to start monitoring mirth (with Zabbix6.2) so I'm eager to know how you got this working DaLoz. Is it possible to download your template?

                  Comment

                  • Gasci
                    Junior Member
                    • Feb 2023
                    • 1

                    #10
                    Originally posted by DaLoZ
                    I got it working and will post a "guide" in the cookbook section and link it here.
                    Hi! Where can I find a guide? Thank you very much

                    Comment

                    Working...