~ubuntu-branches/ubuntu/oneiric/collectd/oneiric

« back to all changes in this revision

Viewing changes to src/snmp.c

  • Committer: Bazaar Package Importer
  • Author(s): Morten Kjeldgaard
  • Date: 2008-11-18 15:54:20 UTC
  • mfrom: (1.1.5 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20081118155420-sc2mxv2pebafkmon
Tags: 4.4.2-2ubuntu1
* Merge from Debian unstable (LP: #298828). Remaining Ubuntu changes:
* Add ubuntu_in6-glibc28.dpatch patch, fix FTBFS.
* Add ubuntu_hardening.dpatch patch, fix FTBFS.
* Add ubuntu_perl.c.dpatch, fix FTBFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
707
707
      || (vl->type == ASN_GAUGE))
708
708
  {
709
709
    temp = (uint32_t) *vl->val.integer;
710
 
    DEBUG ("snmp plugin: Parsed int32 value is %llu.", temp);
 
710
    DEBUG ("snmp plugin: Parsed int32 value is %"PRIu64".", temp);
711
711
  }
712
712
  else if (vl->type == ASN_COUNTER64)
713
713
  {
714
714
    temp = (uint32_t) vl->val.counter64->high;
715
715
    temp = temp << 32;
716
716
    temp += (uint32_t) vl->val.counter64->low;
717
 
    DEBUG ("snmp plugin: Parsed int64 value is %llu.", temp);
 
717
    DEBUG ("snmp plugin: Parsed int64 value is %"PRIu64".", temp);
718
718
  }
719
719
  else
720
720
  {
779
779
    if (vb == NULL)
780
780
    {
781
781
      ERROR ("snmp plugin: host %s: Expected one more variable for "
782
 
          "the instance..");
 
782
          "the instance..", host->name);
783
783
      return (-1);
784
784
    }
785
785
 
909
909
 
910
910
  strncpy (vl.host, host->name, sizeof (vl.host));
911
911
  vl.host[sizeof (vl.host) - 1] = '\0';
912
 
  strcpy (vl.plugin, "snmp");
 
912
  sstrncpy (vl.plugin, "snmp", sizeof (vl.plugin));
913
913
 
914
914
  vl.interval = host->interval;
915
915
  vl.time = time (NULL);
1301
1301
 
1302
1302
  strncpy (vl.host, host->name, sizeof (vl.host));
1303
1303
  vl.host[sizeof (vl.host) - 1] = '\0';
1304
 
  strcpy (vl.plugin, "snmp");
 
1304
  sstrncpy (vl.plugin, "snmp", sizeof (vl.plugin));
1305
1305
  strncpy (vl.type_instance, data->instance.string, sizeof (vl.type_instance));
1306
1306
  vl.type_instance[sizeof (vl.type_instance) - 1] = '\0';
1307
1307
 
1400
1400
  if ((time_end - time_start) > host->interval)
1401
1401
  {
1402
1402
    WARNING ("snmp plugin: Host `%s' should be queried every %i seconds, "
1403
 
        "but reading all values takes %i seconds.",
1404
 
        host->name, host->interval, time_end - time_start);
 
1403
        "but reading all values takes %u seconds.",
 
1404
        host->name, host->interval, (unsigned int) (time_end - time_start));
1405
1405
  }
1406
1406
 
1407
1407
  return (0);