Ad Widget

Collapse

Add #FSTYPE to vfs.fs.discovery for linux and hpux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bcrowder
    Junior Member
    • Sep 2011
    • 10

    #1

    Add #FSTYPE to vfs.fs.discovery for linux and hpux

    Code:
    --- linux/diskspace.c.orig      2011-09-28 14:06:45.000000000 -0400
    +++ linux/diskspace.c   2011-09-28 14:09:21.000000000 -0400
    @@ -102,7 +102,7 @@
     int    VFS_FS_DISCOVERY(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)
     {
            int             ret = SYSINFO_RET_FAIL;
    -       char            line[MAX_STRING_LEN], *p, *mpoint;
    +       char            line[MAX_STRING_LEN], *p, *mpoint,*mtype;
            FILE            *f;
            struct zbx_json j;
    
    @@ -124,8 +124,16 @@
    
                            *p = '\0';
    
    +                       mtype = ++p;
    +
    +                       if (NULL == (p = strstr(mtype, " ")))
    +                               continue;
    +
    +                       *p = '\0';
    +
                            zbx_json_addobject(&j, NULL);
                            zbx_json_addstring(&j, "{#FSNAME}", mpoint, ZBX_JSON_TYPE_STRING);
    +                       zbx_json_addstring(&j, "{#FSTYPE}", mtype, ZBX_JSON_TYPE_STRING);
                            zbx_json_close(&j);
                    }
    
    --- hpux/diskspace.c.orig       2011-09-10 00:10:56 -0700
    +++ hpux/diskspace.c    2011-09-28 11:14:57 -0700
    @@ -179,6 +179,7 @@
                    {
                            zbx_json_addobject(&j, NULL);
                            zbx_json_addstring(&j, "{#FSNAME}", mt->mnt_dir, ZBX_JSON_TYPE_STRING);
    +                       zbx_json_addstring(&j, "{#FSTYPE}", mt->mnt_type, ZBX_JSON_TYPE_STRING);
                            zbx_json_close(&j);
                    }
Working...