Ad Widget

Collapse

TABLE widget in dashboard taken from SQL query in AS400

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kayserpc
    Junior Member
    • Mar 2026
    • 3

    #1

    TABLE widget in dashboard taken from SQL query in AS400

    Dear All

    First of all, I'm new at Zabbix and learning each day a bit more so forgive me if I say something that is not entirely correct. I have been analysing what is the best to monitor the IBM i with Zabbix, currently I have IBM i V7R6 lpars connected to a Zabbix Server V7.0 and also a Zabbix Agent.
    When we started with this, we used the two ways available that were using the traditional AS400 agent, installed on a VM with Linux and connected to Zabbix Server, and on another note also used SNMP connection.
    The problem arround this is that of course we cannot monitor all that we want to monitor, this is limited and requires maybe some coding for specifics, or to buy probably an M81 license to cover the gaps, something that probably no one wants.
    Then a friend told me we could use SQL queries to system tables or phisical files, and there ease me a bit the information take. Now we are able to start taking all the information, however I hit a roadblock on the Dashboard. Despite there are good widgets, I could not find a widget to bring the data into a sort of Table type widget using SQL. What I'm doing is this, I create a new Item, SSH Agent type and on the executed script I put:

    /QOpenSys/pkgs/bin/db2util -o json "SELECT JOB_NAME, ELAPSED_CPU_PERCENTAGE, ELAPSED_CPU_TIME FROM TABLE (QSYS2.ACTIVE_JOB_INFO(RESET_STATISTICS => 'NO', DETAILED_INFO => 'NONE')) ORDER BY ELAPSED_CPU_PERCENTAGE DESC, ELAPSED_CPU_TIME DESC LIMIT 10"

    This should give me the TOP 10 consuming CPU jobs, and it brings the data but of course on JSON format:
    {"records":[
    {"JOB_NAME":"000000/QSYS/SCPF","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_CPU_T IME":0},
    {"JOB_NAME":"995696/QSYS/QSYSARB3","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_C PU_TIME":0},
    {"JOB_NAME":"995702/QSYS/QDBSRV01","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_C PU_TIME":0},
    {"JOB_NAME":"995703/QSYS/QDBSRV02","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_C PU_TIME":0},
    {"JOB_NAME":"995704/QSYS/QDBSRV03","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_C PU_TIME":0},
    {"JOB_NAME":"995705/QSYS/QDBSRV04","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_C PU_TIME":0},
    {"JOB_NAME":"995706/QSYS/QDBSRV05","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_C PU_TIME":0},
    {"JOB_NAME":"995707/QSYS/QDCPOBJ01","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_ CPU_TIME":0},
    {"JOB_NAME":"995708/QSYS/QDCPOBJ02","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_ CPU_TIME":0},
    {"JOB_NAME":"995709/QSYS/QPFRADJ","ELAPSED_CPU_PERCENTAGE":0.00,"ELAPSED_CP U_TIME":0}
    ]}

    Now, here are two things, the first one is that on the ITEM preprpcesing I would like that each field is returned separated, using
    Click image for larger version

Name:	image.png
Views:	10
Size:	38.3 KB
ID:	511751​This works, however if I add the second field:
    Click image for larger version

Name:	image.png
Views:	8
Size:	26.2 KB
ID:	511752

    The second issue is that I would like to have a table, sort of the HOST status widget type, on which to dump this values, but could not find a good way to do this, does anyone know if its possible?
    Maybe If i could separate the fields I could bring the data like the ITEM History one.
Working...