<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Am 05.02.2013 14:12, schrieb Patrick
      Nowak:<br>
    </div>
    <blockquote cite="mid:51110550.2060102@nordsys.de" type="cite">Am
      05.02.2013 14:01, schrieb Patrick Nowak:
      <br>
      <blockquote type="cite">Am 05.02.2013 13:25, schrieb Jens Rehsack:
        <br>
        <blockquote type="cite">On 05.02.13 12:33, Patrick Nowak wrote:
          <br>
          <blockquote type="cite">Hello,
            <br>
            <br>
            I am currently trying to use libstatgrab to read certain
            system
            <br>
            information. Reading CPU and RAM info worked perfectly. But
            when I try
            <br>
            to read file system stats using sg_get_fs_stats() I don't
            get any
            <br>
            information. The integer passed to this function returns
            zero, meaning
            <br>
            no array was created.
            <br>
            <br>
            My code:
            <br>
            <br>
            #include <iostream>
            <br>
            #include <cstlib>
            <br>
            <br>
            #include <statgrab>
            <br>
            <br>
            int main(void) {
            <br>
                 int mounted_fs;
            <br>
            <br>
                 sg_fs_stats *hd_stats =
            sg_get_fs_stats(&mounted_fs);
            <br>
            <br>
                 std::cout << "Number of mounted file systems: "
            << mounted_fs <<
            <br>
            std::endl << std::endl;
            <br>
            <br>
                 for (int i = 0; i < mounted_fs; i++) {
            <br>
                     std::cout << "Mount point: " <<
            hd_stats->mnt_point << std::endl;
            <br>
                     std::cout << "Bytes total: " <<
            hd_stats->size << std::endl;
            <br>
                     std::cout << "Bytes used: " <<
            hd_stats->used << std::endl;
            <br>
                     std::cout << "Bytes free: " <<
            hd_stats->avail << std::endl <<
            <br>
            std::endl;
            <br>
            <br>
                     hd_stats++;
            <br>
                 }
            <br>
            }
            <br>
            <br>
            I am using libstatgrab6, version 0.17-0ubuntu1 on an Ubuntu
            12.04.
            <br>
            <br>
            I hope somebody can point out my error.
            <br>
          </blockquote>
          Hi Patrick,
          <br>
          <br>
          can you try to use the version from
          <a class="moz-txt-link-freetext" href="http://www.netbsd.org/~sno/smart-snmpd/libstatgrab-0.17.20120906.01.tar.gz">http://www.netbsd.org/~sno/smart-snmpd/libstatgrab-0.17.20120906.01.tar.gz</a>
          (or the github repo tdb created:
          <a class="moz-txt-link-freetext" href="https://github.com/tdb/libstatgrab">https://github.com/tdb/libstatgrab</a>) and report whether that
          works or not?
          <br>
          <br>
          Thanks in advance,
          <br>
          Jens
          <br>
        </blockquote>
        Hi Jens,
        <br>
        <br>
        thanks for your reply. Unfortunately that didn't help. I still
        get no file systems. As far as I can tell the lib I build got
        the same version number (6.2.3) anyway then the one installed by
        Ubuntu.
        <br>
        <br>
        Best Regards,
        <br>
        Patrick
        <br>
        <br>
        <br>
        _______________________________________________
        <br>
        users mailing list
        <br>
        <a class="moz-txt-link-abbreviated" href="mailto:users@i-scream.org">users@i-scream.org</a>
        <br>
        <a class="moz-txt-link-freetext" href="https://lists.i-scream.org/mailman/listinfo/users">https://lists.i-scream.org/mailman/listinfo/users</a>
        <br>
      </blockquote>
      I stand corrected. It seems to be working now. I have no clue why
      though. Trying to verify it now in a fresh VM with either versions
      of libstatgrab.
      <br>
      <br>
      I will report. Thanks for now.
      <br>
      <br>
      Best Regards,
      <br>
      Patrick
      <br>
      <br>
      _______________________________________________
      <br>
      users mailing list
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:users@i-scream.org">users@i-scream.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="https://lists.i-scream.org/mailman/listinfo/users">https://lists.i-scream.org/mailman/listinfo/users</a>
      <br>
    </blockquote>
    Hello again,<br>
    <br>
    as I said before, it works with the newest version from the repo.
    Unfortunately the requirement is to use the version provided by
    Ubuntu 12.04 (
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    0.17-0ubuntu1) or even 10.04 (0.16-0.1).<br>
    <br>
    Can anybody tell me what changed between this versions and is there
    a way to get this working with the older version?<br>
    <br>
    Best regards,<br>
    Patrick
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <span style="color: rgb(51, 51, 51); font-family: Ubuntu, Arial,
      sans-serif; font-size: 13px; font-style: normal; font-variant:
      normal; font-weight: normal; letter-spacing: normal; line-height:
      19px; orphans: 2; text-align: left; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-size-adjust: auto;
      -webkit-text-stroke-width: 0px; background-color: rgb(255, 255,
      255); display: inline !important; float: none;"></span>
  </body>
</html>