Ad Widget

Collapse

Zabbix widget returning item value on single line

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • pmazzarese
    Junior Member
    • Jul 2025
    • 7

    #1

    Zabbix widget returning item value on single line

    Good afternoon,

    I have successfully created a python script that will check with our Duo Admin API, pull a list of users, then filter out users who are in BYPASS, then output those users.

    While running the script natively in Visual Studio the output shows on separate lines for each result:

    Click image for larger version

Name:	image.png
Views:	84
Size:	7.2 KB
ID:	504786

    Setup as item. Testing returns the values in the way I expected.

    Click image for larger version

Name:	image.png
Views:	41
Size:	41.7 KB
ID:	504789

    Click image for larger version

Name:	image.png
Views:	40
Size:	56.6 KB
ID:	504790

    The widget in Zabbix shows them all on a single line that does not fit unless I make the text very small. I've tried adjusting the size in hopes text would flow with the window but it does not.
    Click image for larger version

Name:	image.png
Views:	40
Size:	50.5 KB
ID:	504788


    Click image for larger version

Name:	image.png
Views:	39
Size:	10.4 KB
ID:	504787​​
    My python code is configured to return each result on its own line, but Zabbix does not honor that. Maybe I am missing a setting. Is there a way that I can get each result on its own line in the widget?
  • Answer selected by pmazzarese at 07-07-2025, 17:01.
    ysus
    Senior Member
    • Mar 2016
    • 100

    Try "Item History" widget which has much more options for customization. The "As is" display option might work if your Python code returns line breaks in the output string. Or change your code to return output in HTML format



    Comment

    • ysus
      Senior Member
      • Mar 2016
      • 100

      #2
      Try "Item History" widget which has much more options for customization. The "As is" display option might work if your Python code returns line breaks in the output string. Or change your code to return output in HTML format



      Comment

      • pmazzarese
        Junior Member
        • Jul 2025
        • 7

        #3
        Just wanted to follow up that using the Item History widget got things working as expected. Thank you!

        Click image for larger version

Name:	image.png
Views:	32
Size:	5.5 KB
ID:	504952

        Comment

        Working...