Ad Widget

Collapse

Creating items with data from userparameters?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dissect
    Junior Member
    • Nov 2012
    • 8

    #1

    Creating items with data from userparameters?

    Hi everyone

    I think I over engineered something to such an extend that I can not get something done.

    I would like to monitor the performance of our storage using iostat. I got that part working using the sample to discover Linux partitions and have the following output.
    {
    "data":[
    {
    "{#Device}":"sda”,
    "{#DevTPS }":"1.2”,
    "{#DevRPS}":"10.3”,
    "{#DevWPS}":"0.02” }]}

    So now I am stuck not being able to use the io data, which I am getting in zabbix?
    For testing purposes I have created a normal text item and the data is coming through. Please help me see the light
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    I believe you mixed a bit UserParameter with Low-Level-Discovery-Rules.

    One way to achieve what I think you want to could be...
    Create UserParameter like these:
    Code:
    # Key: custom.dev.discovery
    # Result: [s|{"data":[{"{#DEVNAME}":"sda"}]}]
    UserParameter=custom.dev.discovery,awk 'BEGIN{printf "{\"data\":["}$1~/[0-9]/{printf c"{\"{#DEVNAME}\":\""$NF"\"}";c=","}END{printf "]}"}' /proc/partitions
    
    # Key: custom.iostat["sda",2]
    # Result: [d|3232.03]
    UserParameter=custom.iostat[*],iostat -d $1 | awk '$$1=="$1"{print $$(1+$2)}'
    Then create a Low-Level-Discovery-Rule with the item key custom.dev.discovery.
    Optionally add a regular expression to filter for the desired devices.

    Within the discovery rule create the following item prototypes:
    Item1
    Name: {#DEVNAME} transactions per second
    Key: custom.iostat["{#DEVNAME}",1]

    Item2
    Name: {#DEVNAME} blocks read per second
    Key: custom.iostat["{#DEVNAME}",2]

    Item3
    Name: {#DEVNAME} blocks written per second
    Key: custom.iostat["{#DEVNAME}",3]

    This proposal is just to show the idea and is not tested in any case neither syntactically nor logically.

    Comment

    Working...