Ad Widget

Collapse

Item Created to display TEXT -- No TEXT displayed on Dashboard

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lslamp
    Member
    • Jan 2020
    • 33

    #1

    Item Created to display TEXT -- No TEXT displayed on Dashboard

    Greetings All,

    I am a newbie to Zabbix, have been working with linux for a while.
    I have a script that when it is run, generates a text file /var/log/CertResult.txt

    The content of the script is below.

    22-02-2021 = atlantic-kids-academy.com (80 days)
    23-02-2021 = dawnsdays.com (81 days)
    22-02-2021 = dunnsland.com (80 days)
    23-02-2021 = e2snail.com (81 days)
    23-02-2021 = hockeysticks4clubs.com (81 days)
    24-02-2021 = icanevents.net (82 days)

    So then I created an item as shown below.
    Click image for larger version

Name:	display_text_item.png
Views:	1123
Size:	56.7 KB
ID:	414547

    I also created a trigger as follows.
    Click image for larger version

Name:	item_trigger.png
Views:	1092
Size:	43.0 KB
ID:	414548

    In the item config, if I run a test I get the needed content of the text file.

    Click image for larger version

Name:	item_test_results.png
Views:	1068
Size:	55.8 KB
ID:	414549

    So as far as I understand things. this all works as expected.

    I now create Dashboard Widget to display the results, but when I add the display, no data is displayed on the dashboard and I have no idea why.

    Click image for larger version

Name:	add_text_widget.png
Views:	1075
Size:	26.3 KB
ID:	414550
    Below is the Dashboard result.
    Click image for larger version

Name:	dashboard_results.png
Views:	1057
Size:	6.6 KB
ID:	414551

    Does anyone have any idea why the dashboard is not being populated with the text file results?

    Thanks in advance for any advice.
    Regards
    Lawrence
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    check the latest data to see if you are getting values for item? (not check now, but the latest data).
    uncheck Show text as HTML in widget.

    Comment

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

      #3
      In my opinion, you need to do it in a different way!
      After getting the contents of the text file in items (and converting it to json using JS preprocessing), you need to make LLD dependent items based on it, each of which will contain the value of the number of days for one certificate (an integer). Then, based on this data, you can build triggers normally and display values and build graphs normally.
      Perhaps you should create a normal json file on the server instead of a text file?

      links
      https://www.zabbix.com/documentation.../preprocessing
      https://www.zabbix.com/documentation...evel_discovery
      https://www.zabbix.com/documentation...ependent_items
      Last edited by Hamardaban; 04-12-2020, 07:15.

      Comment

      • lslamp
        Member
        • Jan 2020
        • 33

        #4
        Hamardaban Thanks for your input but looking at the links that you posted, this seems a little outside of my knowledge and experience with zabbix.

        I also took a look at last data, I see the failures but have no clue why this is happening. See screenshot below.

        Click image for larger version

Name:	last_data.png
Views:	1033
Size:	146.4 KB
ID:	414595

        Now just to clarify, I have created 2 monitors manually. 1. Web Site Monitoring.

        Click image for larger version

Name:	website_monitoring.png
Views:	1025
Size:	37.1 KB
ID:	414596

        and then I have the tracking of the SSL Certificates.

        So when I look at the latest data, I do not understand why and where the failed scenarios come from and why the names cannot be resolved.
        Also what error is given for teh text data not being presented.

        I have no idea?

        Lawrence

        Comment

        • lslamp
          Member
          • Jan 2020
          • 33

          #5
          I have also tried to make some changes ...

          Instead of using only the name of the domain I changed it all to reflect the whole URL.

          I still do not see any errors related to the text not displaying on the dashboard.

          Sorry for being cheeky but looking at the list below, I see two items that are confusing.
          1. the error "Failed step of scenario" what is this referring to?
          2. the error "Couldn't connect to server: Failed to connect to ${DOMAIN} port 443: Connection refused" - is this a config issue because all teh sites have valid certificates and do open with https.

          ICANWeb HTTPS service (31 Items)
          Download speed for scenario "https://www.atlantic-kids-academy.com". 2020-12-04 13:15:33 159.72 KBps +36.61 KBps Graph
          Download speed for scenario "https://www.dawnsdays.com". 2020-12-04 13:15:33 64.79 KBps +16.74 KBps Graph
          Download speed for scenario "https://www.dunnsland.com". 2020-12-04 13:15:26 28.41 KBps Graph
          Download speed for scenario "https://www.e2snail.com". 2020-12-04 13:14:46 4.92 KBps -5.75 KBps Graph
          Download speed for scenario "https://www.icanevents.net". 2020-12-04 13:15:33 801 Bps -1.42 KBps Graph
          Download speed for step "https://www.atlantic-kids-academy.com" of scenario "https://www.atlantic-kids-academy.com". 2020-12-04 13:15:33 159.72 KBps +36.61 KBps Graph
          Download speed for step "https://www.dawnsdays.com" of scenario "https://www.dawnsdays.com". 2020-12-04 13:15:33 64.79 KBps +16.74 KBps Graph
          Download speed for step "https://www.dunnsland.com" of scenario "https://www.dunnsland.com". 2020-12-04 13:15:26 28.41 KBps Graph
          Download speed for step "https://www.e2snail.com" of scenario "https://www.e2snail.com". 2020-12-04 13:14:46 4.92 KBps -5.75 KBps Graph
          Download speed for step "https://www.icanevents.net" of scenario "https://www.icanevents.net". 2020-12-04 13:15:33 801 Bps -1.42 KBps Graph
          Failed step of scenario "https://www.atlantic-kids-academy.com". 2020-12-04 13:15:33 0 Graph
          Failed step of scenario "https://www.dawnsdays.com". 2020-12-04 13:15:33 0 Graph
          Failed step of scenario "https://www.dunnsland.com". 2020-12-04 13:15:26 0 Graph
          Failed step of scenario "https://www.e2snail.com". 2020-12-04 13:14:46 0 Graph
          Failed step of scenario "https://www.icanevents.net". 2020-12-04 13:15:33 0 Graph
          HTTPS service is running 2020-12-04 13:15:32 Up (1) Graph
          Last error message of scenario "https://www.atlantic-kids-academy.com". 2020-12-04 12:34:14 Couldn't connect to server: Failed to connect to www.atlantic-kids-academy.com port 443: Connection refused History
          Last error message of scenario "https://www.dawnsdays.com". 2020-12-04 12:34:18 Couldn't connect to server: Failed to connect to www.dawnsdays.com port 443: Connection refused History
          Last error message of scenario "https://www.dunnsland.com". 2020-12-04 12:34:20 Couldn't connect to server: Failed to connect to www.dunnsland.com port 443: Connection refused History
          Last error message of scenario "https://www.e2snail.com". 2020-12-04 12:34:41 Couldn't connect to server: Failed to connect to www.e2snail.com port 443: Connection refused History
          Last error message of scenario "https://www.icanevents.net". 2020-12-04 12:47:25 response code "404" did not match any of the required status codes "200" History
          Response code for step "https://www.atlantic-kids-academy.com" of scenario "https://www.atlantic-kids-academy.com". 2020-12-04 13:15:33 200 Graph
          Response code for step "https://www.dawnsdays.com" of scenario "https://www.dawnsdays.com". 2020-12-04 13:15:33 200 Graph
          Response code for step "https://www.dunnsland.com" of scenario "https://www.dunnsland.com". 2020-12-04 13:15:26 200 Graph
          Response code for step "https://www.e2snail.com" of scenario "https://www.e2snail.com". 2020-12-04 13:14:46 200 Graph
          Response code for step "https://www.icanevents.net" of scenario "https://www.icanevents.net". 2020-12-04 13:15:33 200 Graph
          Response time for step "https://www.atlantic-kids-academy.com" of scenario "https://www.atlantic-kids-academy.com". 2020-12-04 13:15:33 454.89ms -134.97ms Graph
          Response time for step "https://www.dawnsdays.com" of scenario "https://www.dawnsdays.com". 2020-12-04 13:15:33 66.24ms -23.06ms Graph
          Response time for step "https://www.dunnsland.com" of scenario "https://www.dunnsland.com". 2020-12-04 13:15:26 67.4ms +0.053ms Graph
          Response time for step "https://www.e2snail.com" of scenario "https://www.e2snail.com". 2020-12-04 13:14:46 193.17ms +103.66ms Graph
          Response time for step "https://www.icanevents.net" of scenario "https://www.icanevents.net". 2020-12-04 13:15:33 202.87ms +130.22ms Graph
          Thanks in advance
          Lawrence

          Comment

          • lslamp
            Member
            • Jan 2020
            • 33

            #6
            I am sorry, I do see that I have screwed up and mixed errors. Please ignore the https errors, I will open a second question with regards to this.

            Lawrence

            Comment

            • lslamp
              Member
              • Jan 2020
              • 33

              #7
              cyber Thanks for your reply. I did a check and I only have 1 step and as far as I can gather that is successful, according to what you say if there is a "0" then failure should not be present.

              Click image for larger version  Name:	step1_scenario.png Views:	0 Size:	77.4 KB ID:	414628

              Step #1
              Click image for larger version  Name:	step1.png Views:	0 Size:	30.5 KB ID:	414629

              and yet I still see the failure. Also looking at what you said about the value being a "0", looking at the latest data it is showing a "0" so why is it showing as a failure?

              Click image for larger version  Name:	last_data_failed.png Views:	0 Size:	24.7 KB ID:	414630

              A little confusing.
              Thanks
              Lawrence
              Last edited by lslamp; 04-12-2020, 19:53.

              Comment

              • lslamp
                Member
                • Jan 2020
                • 33

                #8
                cyber Thanks a million for the help and advice. I will read and see if I can get my head around it.

                Do you have any advice about the text file not being presented on the dashboard?

                Lawrence

                Comment

                • lslamp
                  Member
                  • Jan 2020
                  • 33

                  #9
                  cyber
                  I have now read the page and it seems that there is nothing wrong. I read it as a false positive, but what I see there is the correct response. It is supposed to show the number of previous failures, and if there are non then the return is a 0 and that is what I see. So all good. It was me not understanding the alert.

                  Thanks for the followup.
                  Lawrence

                  Comment

                  • lslamp
                    Member
                    • Jan 2020
                    • 33

                    #10
                    I don't know what I am missing here but no matter what I do I cannot seem to figure out why the contents of a text file will not be displayed on the zabbix dashboard.

                    I have now reverted to deleting the trigger I created and now only have an item called Check SSL Certs. I have used the following key to read the file contents. "vfs.file.contents[/var/log/CertResult.txt,ANSI]". Looking at the zabbix_server.log file I see the follwoing

                    extract from log file.

                    570077:20201208:003500.096 itemid:34282 hostid:10084 key:'vfs.file.contents[/var/log/CertResult.txt,ANSI]'
                    570109:20201208:003522.852 In substitute_key_macros_impl() data:'vfs.file.contents[/var/log/CertResult.txt,ANSI]'
                    570109:20201208:003522.852 End of substitute_key_macros_impl():SUCCEED data:'vfs.file.contents[/var/log/CertResult.txt,ANSI]'
                    570109:20201208:003522.852 In get_value() key:'vfs.file.contents[/var/log/CertResult.txt,ANSI]'
                    570109:20201208:003522.852 In get_value_agent() host:'Zabbix server' addr:'127.0.0.1' key:'vfs.file.contents[/var/log/CertResult.txt,ANSI]' conn:'unencrypted'
                    570109:20201208:003522.852 Sending [vfs.file.contents[/var/log/CertResult.txt,ANSI]]
                    570077:20201208:003600.673 itemid:34282 hostid:10084 key:'vfs.file.contents[/var/log/CertResult.txt,ANSI]'
                    570109:20201208:003622.111 In substitute_key_macros_impl() data:'vfs.file.contents[/var/log/CertResult.txt,ANSI]'
                    570109:20201208:003622.111 End of substitute_key_macros_impl():SUCCEED data:'vfs.file.contents[/var/log/CertResult.txt,ANSI]'
                    570109:20201208:003622.111 In get_value() key:'vfs.file.contents[/var/log/CertResult.txt,ANSI]'
                    570109:20201208:003622.111 In get_value_agent() host:'Zabbix server' addr:'127.0.0.1' key:'vfs.file.contents[/var/log/CertResult.txt,ANSI]' conn:'unencrypted'
                    570109:20201208:003622.111 Sending [vfs.file.contents[/var/log/CertResult.txt,ANSI]]

                    So I assume that the file isbeing read, but I cannot figure out how to display the contents on the dashboard.

                    I have tried to add a Plain Text Widget, but no data is presented to the dashboard.
                    Is it possible that I have to have a trigger associated to teh item before data can be presented on the dashboard?

                    Any suggestions are very much appreciated.
                    Thanks
                    Lawrence

                    Comment

                    • lslamp
                      Member
                      • Jan 2020
                      • 33

                      #11
                      cyber Thanks for the feedback. I am happy with this now, but am still having an issue creating the text display on the dashboard.

                      do you have any ideas?

                      Lawrence

                      Comment

                      • Matgou
                        Junior Member
                        • Nov 2020
                        • 4

                        #12
                        Hi cyber and lslamp,

                        I'm not sure but data can't be displayed if you select : "do not keep history" in item definition.
                        You know with this configuration, dependents items are evaluated, but history table doesn't have any data about this item. In the "Latest data", you don't see this item because you must check "Show items without data" to see it but it will be empty.

                        So, define a storage period and you will see your data. If you don't want many data for this item, add a preprocessor step with : "discard unchanged".

                        Regards,

                        Click image for larger version

Name:	Capture d’écran du 2020-12-09 21-45-26.png
Views:	1011
Size:	56.9 KB
ID:	414956

                        Comment

                        • lslamp
                          Member
                          • Jan 2020
                          • 33

                          #13
                          Matgou
                          Thanks for your input, but can you please clarify something. If I have created the item and set a storage period, do I need a trigger?
                          The reason I am asking is because looking at the trigger I see an error that says not enough data.

                          That makes no sense to me cause there are no other input fields where I can add any more data.

                          as a test I will remove the trigger and see what happens.

                          Thanks
                          Lawrence

                          Comment

                          • lslamp
                            Member
                            • Jan 2020
                            • 33

                            #14
                            Matgou
                            I removed the trigger and now I have the following display

                            Click image for larger version

Name:	SSLCheckVisual.png
Views:	1036
Size:	36.2 KB
ID:	414960

                            I have added an extra line in the text file to push the half cut off line away out of shot.

                            I am happy. It works now thanks.

                            Seems I was making it more complicated than was necessary.

                            Thanks for the pointer
                            Lawrence
                            Attached Files

                            Comment

                            • Matgou
                              Junior Member
                              • Nov 2020
                              • 4

                              #15
                              lslamp

                              Item collect data and trigger evaluate item's data to create problem. And If I correctly understand your issue, you don't need to perform any check on your file content, because you don't want any alert., just display.
                              So trigger wasn't need but the trigger wasn't block data displaying.

                              If trigger become "unsuported" and display an errror : "not enough data", it's not a error in your configuration but it's with item data (history). Here you build a trigger to check if the "#1" last item data are equal to "0" (so if file content equal to "0"), your item didn't have any history data, so the check couldn't be perform.

                              Take care,
                              Mathieu

                              Comment

                              Working...