Ad Widget

Collapse

File system monitoring

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deepaks
    Junior Member
    • Nov 2015
    • 12

    #1

    File system monitoring

    Hi Friends,

    As we all know we have option of auto discovery of file system and monitoring, but I want to monitor specific drive/disk of linux/windows.

    Please suggest how can I configure items for this and if file system name changes from host to host, so can I configure MACROS at host level to specify the disk/drive name.

    Thanks in advance.
  • geniepage
    Member
    • Sep 2015
    • 34

    #2
    Hello Deepaks,
    you wanna to discovery specific disk etc. You can do it very simple. Do script which produce JSON format with all drives/disk. After that you can do item prototype for it with SimbolicName for it. Example from me in AIX:

    Discovery:
    ========
    #!/bin/ksh
    hdiskname=""
    cntr=0
    echo "{\n"
    echo "\t\"data\":[\n\n"
    hdiskcount=`lsdev |awk '{print $1}' | grep -E "^hdisk"|wc -l`
    for i in `lsdev |awk '{print $1}' | grep -E "^hdisk"`
    do
    hdiskname="$i"
    echo "\t{\n"
    echo "\t\t\"{#HDISKNAME}\":\"$hdiskname\"\n"
    echo "\t}\n"
    (( cntr+=1 ))
    if [ $cntr -lt $hdiskcount ]
    then
    echo "\t,\n"
    fi
    done
    echo "\n\t]\n"
    echo "}\n"

    Item:
    ====
    ...
    type: Zabbix trapper #due to better performance of zabbix
    ...
    aixvios.disk.bps[{#HDISKNAME}]
    ...

    Getting value:
    ===========
    function SendData
    {
    ...
    $zabsend -z $zabsrv -s $hostnm -k cpx.aixvios.disk.${params[$arrayindex]}[$hdiskname] -o $numfinal 2>&1 > /dev/null
    if [ $? != "0" ]
    then
    (( errcount+=1 ))
    fi
    done
    }


    for i in $hdisklist
    do
    SendData $i
    done
    if [[ $errcount -gt 0 ]]
    then
    echo "1"
    else
    echo "0"
    fi

    It is all what you need to discovery all object from OS and getting values from it.

    I hope that it will help you

    Reagrds
    Genie

    Comment

    • deepaks
      Junior Member
      • Nov 2015
      • 12

      #3
      Hi geniepage,

      I appreciated your effort but this is not what I want.
      Just like in auto discovery we have {$FSNAME} which have specific value at template level. I want to change this value at host level something like this
      {$FSNAME1} : /
      {$FSNAME2} : /home

      Can you help me with this.

      Comment

      • geniepage
        Member
        • Sep 2015
        • 34

        #4
        Hello,
        you can do own FS discovery and you can use it in script and it will work as you expect. It is not so difficult to write it. You can do own LLD where you can use these variables.

        Regards
        Genie

        Comment

        Working...