Ad Widget

Collapse

Creating two items from one user defined script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thart
    Junior Member
    • May 2019
    • 2

    #1

    Creating two items from one user defined script

    I have a Database Status check that us set to look against MSSQL Server. I have the check outputting some string data intended for DBA use and reference, but also integer values that are intended to be representations of the state and user access descriptions for triggering and graphing.

    My question is, is there a proper method to split these outputs into their own items? Exclude information perhaps that gets passed into latest data?

    Not quite sure where to start obviously. Thanks!
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    I do not know what format the data you are taking, but if you are using Zabbix 4.0 or later, process the value of the fetched item in the save pre-processing to be the value of another item.

    Manual:

    Comment

    • thart
      Junior Member
      • May 2019
      • 2

      #3
      Thank you for the response.

      The output of my script looks like this:

      SQL Instance: SQLTest-09
      DBName: Human Resources
      DBState: ONLINE
      RecoveryModel: SIMPLE
      UserAccess: MULTI_USER
      DateCreated: Apr 24 2018 9:16AM

      StateInt: 0
      State: 1
      UserAcc: 2

      So the block that starts with "SQL Instance: and ends with DateCreated:" would be one output for just easy viewed status.

      then State and UserAcc values should be their own individual outputs as well for triggers, graphing, etc

      So to use your solution I would create dependent items on the item that puts all of this out, then preprocess the data on the dependent items to only return what I'm looking for?

      Comment

      Working...