Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ioctl returned -1 ??

1 view
Skip to first unread message

Paul Reilly

unread,
Nov 18, 2006, 2:51:43 PM11/18/06
to

Hello,

I'm running debian etch on x86_64 with net-snmp version
5.2.3 from debian packages.

# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.100.2.0
UCD-SNMP-MIB::versionTag.0 = STRING: 5.2.3

It works fine, except every minute I get an error to syslog:

Nov 18 19:47:38 box8 snmpd[9057]: NET-SNMP version 5.2.3
Nov 18 19:47:47 box8 snmpd[9057]: Connection from UDP: [127.0.0.1]:32772
Nov 18 19:47:47 box8 snmpd[9057]: Connection from UDP: [127.0.0.1]:32772
Nov 18 19:48:38 box8 snmpd[9057]: ioctl 35123 returned -1
Nov 18 19:48:38 box8 snmpd[9057]: ioctl 35123 returned -1

I have searched google and the archives for this ioctl error, but can't
find any more about it. Any ideas on what this is and how to fix it?

Thanks
Paul

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-users mailing list
Net-snm...@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Thomas Anders

unread,
Nov 18, 2006, 4:53:28 PM11/18/06
to
Paul Reilly wrote:
> Nov 18 19:47:38 box8 snmpd[9057]: NET-SNMP version 5.2.3
> Nov 18 19:47:47 box8 snmpd[9057]: Connection from UDP: [127.0.0.1]:32772
> Nov 18 19:47:47 box8 snmpd[9057]: Connection from UDP: [127.0.0.1]:32772
> Nov 18 19:48:38 box8 snmpd[9057]: ioctl 35123 returned -1
> Nov 18 19:48:38 box8 snmpd[9057]: ioctl 35123 returned -1

>From /usr/include/bits/ioctls.h:

#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */

>From agent/mibgroup/if-mib/data_access/interface_ioctl.c:_ioctl_get():

rc = ioctl(fd, which, ifrq);
if (rc < 0) {
snmp_log(LOG_ERR,"ioctl %d returned %d\n", which, rc);
rc = -3;
}

So ioctl(,SIOCGIFINDEX,) is failing for one of your interfaces.

Can you post your interface configuration ("ifconfig -a"), please?


+Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)

Paul Reilly

unread,
Nov 18, 2006, 7:40:08 PM11/18/06
to

Thanks Thomas for the good advice!
This box has 27 interfaces, of which 17 are up.

> Please "snmpwalk -v2c -c <community> localhost ifTable".
> Does it trigger the error in the log? How often?

That is difficult to tell.
Note, that even if I do not do any snmp queries, and just leave the box
alone, the error is generated twice per minute. Syslog seems to flush
the log once per minute, and there are always 2 errors.

Nov 19 23:29:30 box8 snmpd[9264]: ioctl 35123 returned -1
Nov 18 23:30:26 box8 last message repeated 2 times
Nov 18 23:31:26 box8 last message repeated 2 times
Nov 18 23:32:26 box8 last message repeated 2 times
Nov 18 23:33:26 box8 last message repeated 2 times
Nov 18 23:34:26 box8 last message repeated 2 times

If I do:

snmpwalk -v1 -c <community> localhost ifTable

it logs 593 UDP connects to snmpd in syslog, but also only two
ioctl 35123 errors (I think - it sometimes difficult to see what
the "repeated" lines refer to)

Nov 19 00:27:32 box8 snmpd[9264]: Connection from UDP: [127.0.0.1]:32772
Nov 19 00:27:45 box8 last message repeated 2 times
Nov 19 00:28:14 box8 last message repeated 595 times
Nov 19 00:28:30 box8 snmpd[9264]: ioctl 35123 returned -1
Nov 19 00:28:30 box8 snmpd[9264]: ioctl 35123 returned -1

> If there's at least one, do a manual snmpget on each of the MIB objects you
> got from the walk, watch the log and tell the list which snmpget triggers the
> error.

The snmpwalk lists the following attributes for each interface.

ifIndex
ifDescr
ifType
ifMtu
ifSpeed
ifPhysAddress
ifAdminStatus
ifOperStatus
ifLastChange
ifInOctets
ifInUcastPkts
ifInNUcastPkts
ifInDiscards
ifInErrors
ifInUnknownProtos
ifOutOctets
ifOutUcastPkts
ifOutNUcastPkts
ifOutDiscards
ifOutErrors
ifOutQLen
ifSpecific

I have done a:

snmpget -v 1 -c public localhost <attribute>.<n>

over all attributes, and a small range of my interface numbers (n).
None of the attributes seems to deterministically cause the error to
happen. It always happens twice per minute, irrespective of what snmpgets
I run.

I have also run the above snmpget on attribute ifIndex, and IfDescr for
all <n>. Similarly it is not possible to generate more than the regular
two ioctl errors per minute.

I hope that feedback helps. I would like to know what is generating the
two errors even when the box is not receiving snmp queries.

Paul

Thomas Anders

unread,
Nov 19, 2006, 2:25:07 AM11/19/06
to
Paul Reilly wrote:
> It always happens twice per minute, irrespective of what snmpgets I run.

The routine in question is netsnmp_arch_interface_index_find() in
agent/mibgroup/if-mib/data_access/interface_linux.c, I think. There's a 30sec
default update interval which explains what you're seeing.

You may want to play with the debug tokens to find out the interface in
question. Try running snmpd e.g. with "-Daccess:interface,9:access:ifcontainer"
for a minute and scan through the output to find out which interface triggers
the error.


HTH,
Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)

-------------------------------------------------------------------------

0 new messages