Re: snmpd failed to start when agentx is enabled

Pushpa Thimmaiah <[email protected]> Thu, 3 Oct 2024 19:31:26 +0530
Newsgroups gmane.network.net-snmp.devel
Message-ID <CAASqVJXgyEGD91=4qNHW3cix6c4Xm1=zNq2WkufE8ZLvqkiEoQ@mail.gmail.com>
--===============7740491067786900968==
Content-Type: multipart/alternative; boundary="000000000000243186062392dd42"

--000000000000243186062392dd42
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Bill Fenner,

Issue resolved. I have rebooted the device and started snmpd .  socket file
/var/agentx/master got created and example code is working.

Thanks,
Pushpa.T

On Thu, Oct 3, 2024 at 5:09=E2=80=AFPM Pushpa Thimmaiah <pushpa.thimmaiah@g=
mail.com>
wrote:

> Hi Bill Fenner,
>
> Thank you. I enabled Unix transport and added 'agentXSocket
> /var/agentx/master' in /etc/snmp/snmpd.conf, and I was able to execute
> snmpd. There was no /var/agentx/master created after starting snmpd, and
> AgentX was unable to connect to snmpd.
> I am following the AgentX tutorial at
> http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/. Kindly guide.
>
> *example_daemon log*
>
> tdomain: Found domain "unix" from specifier "unix"
> trace: netsnmp_lookup_default_target(): snmp_service.c, 413:
> defaults: netsnmp_lookup_default_target("agentx", "unix") ->
> "/var/agentx/master"
> trace: netsnmp_tdomain_transport_tspec(): snmp_transport.c, 794:
> tdomain: trying domain "unix" address "[NIL]" default address
> "/var/agentx/master"
> trace: netsnmp_unix_transport(): transports/snmpUnixDomain.c, 322:
> netsnmp_unix: open remote Local IPC: /var/agentx/master
> trace: netsnmp_unix_transport(): transports/snmpUnixDomain.c, 432:
> netsnmp_unix_transport: *couldn't connect to "/var/agentx/master"*, errno
> 2 (No such file or directory)
>
> *Snmpd.log*
> trace: read_config(): read_config.c, 843:
> 9:read_config:line: /etc/snmp/snmpd.conf:214 examining: agentXSocket
> /var/agentx/master
> trace: read_config(): read_config.c, 971:
> read_config:line: /etc/snmp/snmpd.conf:214 examining: agentXSocket
> /var/agentx/master
> trace: run_config_handler(): read_config.c, 536:
> read_config:parser: Found a parser.  Calling it: agentXSocket /
> /var/agentx/master
> trace: agentx_parse_agentx_socket(): mibgroup/agentx/agentx_config.c, 34:
> agentx/config: port spec: /var/agentx/master
> trace: netsnmp_ds_set_string(): default_store.c, 285:
> *netsnmp_ds_set_string: Setting APP:1 =3D "/var/agentx/master"*
> trace: read_config(): read_config.c, 843:
>
>
> *Details:-*
>
> Both snmpd , agentx example 'example-daemon'  and folder /var/agentx  has
> same permission
> root@SyncServer:/var/log# ls -la /var/agentx
> total 8
> drwxr-xr-x  2 root root 4096 Oct  2 11:46 .
> drwxr-xr-x 13 root root 4096 Oct  2 11:46 ..
> root@SyncServer:/var/log# ls -la /usr/sbin/snmpd
> -rwxr-xr-x 1 root root 64488 Oct  2 09:59 /usr/sbin/snmpd
> root@SyncServer:/var/log# ls -la /tmp/example-demon
> -rwxr-xr-x 1 root root 37664 Oct  2 09:52 /tmp/example-demon
>
>
> *net-snmp-5.9 config summary*
>
>  SNMP Versions Supported:    1 2c 3
>   Building for:               linux
>   Net-SNMP Version:           5.9
>   Network transport support:  Unix Alias UDP UDPIPv6 Callback UDPIPv4Base
> UDPBase IPv4Base IPBase SocketBase IPv6Base
>   SNMPv3 Security Modules:     usm
>   Agent MIB code:            clock default_modules gnss host mibII
> notification ntpSystem snmpv3mibs system target utilities =3D>  snmpv3mib=
s
> mibII notification notification-log-mib target* agentx* disman/event
> disman/schedule utilities host host/hrh_storage host/hrh_filesys
> host/hrSWInstalledTable host/hrSWRunTable host/hr_system host/hr_device
> host/hr_other host/hr_proc host/hr_network host/hr_print host/hr_disk
> host/hr_partition mibII/system_mib mibII/sysORTable mibII/snmp_mib
> mibII/vacm_vars mibII/setSerialNo mibII/at mibII/ifTable mibII/ip mibII/t=
cp
> mibII/udp mibII/ipv6 mibII/icmp if-mib ip-mib ip-forward-mib tcp-mib
> udp-mib notification/snmpNotifyTable
> snmp-notification-mib/snmpNotifyFilterTable
> notification/snmpNotifyFilterProfileTable ntpSystem/ntpSystem
> snmpv3/snmpEngine snmpv3/snmpMPDStats snmpv3/usmStats snmpv3/usmConf
> snmpv3/usmUser system/system target/snmpTargetAddrEntry
> target/snmpTargetParamsEntry target/target target/target_counters
> utilities/override utilities/execute utilities/iquery
>   MYSQL Trap Logging:         unavailable
>   Embedded Perl support:      disabled
>   SNMP Perl modules:          disabled
>   SNMP Python modules:        disabled
>   Crypto support from:        crypto
>   Authentication support:     MD5 SHA1 SHA224 SHA256 SHA384 SHA512
>   Encryption support:         DES AES AES128 AES192 AES192C AES256 AES256=
C
>   Local DNSSEC validation:    disabled
>
> Thanks,
> Pushpa.T
>
> On Fri, Sep 27, 2024 at 12:14=E2=80=AFAM Bill Fenner <[email protected]> w=
rote:
>
>> Hi Pushpa,
>>
>> You are not enabling UNIX domain support, so net-snmp can't open the UNI=
X
>> domain socket for agentx. You can either use the TCP socket by configuri=
ng
>> with something like
>>
>> agentXSocket tcp:127.0.0.1:705
>>
>> and then configuring clients similarly, e.g., "snmptrap -X tcp:705"
>>
>> Or adding the UNIX domain transport, e.g., add "Unix" to your
>> "--with-transports" configure argument.
>>
>>   Bill
>>
>>
>> On Thu, Sep 26, 2024 at 9:20=E2=80=AFAM Pushpa Thimmaiah <
>> [email protected]> wrote:
>>
>>> Hi All,
>>>
>>> I am getting following error while starting snmpd in net-snmp-5.9. I
>>> have enabled  agentx and compiled the source. Kindly guide me to resolv=
e
>>> the same.
>>> I have created directory /var/agentx
>>> ---------------
>>>
>>> agentx/master: initializing...
>>> trace: netsnmp_tdomain_transport_tspec(): snmp_transport.c, 655:
>>> tdomain: tdomain_transport_spec("agentx", "/var/agentx/master", 1,
>>> "[NIL]", "[NIL]", "[NIL]")
>>> trace: netsnmp_tdomain_transport_tspec(): snmp_transport.c, 736:
>>> tdomain: Address starts with '/', so assume "unix" domain
>>> trace: find_tdomain(): snmp_transport.c, 610:
>>> tdomain: Found no domain from specifier "unix"
>>> No support for any checked transport domain
>>> Error: Couldn't open a master agentx socket to listen on
>>> (/var/agentx/master):
>>> ---------------------------------------------------
>>>
>>>
>>> Thanks,
>>> Pushpa.T
>>> _______________________________________________
>>> Net-snmp-coders mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
>>>
>>

--000000000000243186062392dd42
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Bill Fenner,</div><div><br></div><div>Issue resolv=
ed. I have rebooted the device and started snmpd .=C2=A0 socket file /var/a=
gentx/master got created and example code is working.</div><div><br></div><=
div>Thanks,</div><div>Pushpa.T<br></div></div><br><div class=3D"gmail_quote=
"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Oct 3, 2024 at 5:09=E2=80=
=AFPM Pushpa Thimmaiah &lt;<a href=3D"mailto:[email protected]">pu=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex"><div dir=3D"ltr"><div>Hi Bill Fenner,</div><div><br=
></div><div>Thank you. I enabled Unix transport and added &#39;agentXSocket=
=20
/var/agentx/master&#39; in /etc/snmp/snmpd.conf, and I was able to execute=
=20
snmpd. There was no
 /var/agentx/master created after starting snmpd, and AgentX was unable=20
to connect to snmpd.</div><div> I am following the AgentX tutorial at=20
<a href=3D"http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/" targ=
et=3D"_blank">http://www.net-snmp.org/tutorial/tutorial-5/toolkit/demon/</a=
>. Kindly guide.<br></div><div><br></div><div><b>example_daemon log</b></di=
v><div><b><br></b></div><div>tdomain: Found domain &quot;unix&quot; from sp=
ecifier &quot;unix&quot;<br>trace: netsnmp_lookup_default_target(): snmp_se=
rvice.c, 413:<br>defaults: netsnmp_lookup_default_target(&quot;agentx&quot;=
, &quot;unix&quot;) -&gt; &quot;/var/agentx/master&quot;<br>trace: netsnmp_=
tdomain_transport_tspec(): snmp_transport.c, 794:<br>tdomain: trying domain=
 &quot;unix&quot; address &quot;[NIL]&quot; default address &quot;/var/agen=
tx/master&quot;<br>trace: netsnmp_unix_transport(): transports/snmpUnixDoma=
in.c, 322:<br>netsnmp_unix: open remote Local IPC: /var/agentx/master<br>tr=
ace: netsnmp_unix_transport(): transports/snmpUnixDomain.c, 432:<br>netsnmp=
_unix_transport: <i>couldn&#39;t connect to &quot;/var/agentx/master&quot;<=
/i>, errno 2 (No such file or directory)<br></div><div><b><br></b></div><di=
v><b>Snmpd.log</b><br>trace: read_config(): read_config.c, 843:<br>9:read_c=
onfig:line: /etc/snmp/snmpd.conf:214 examining: agentXSocket /var/agentx/ma=
ster<br>trace: read_config(): read_config.c, 971:<br>read_config:line: /etc=
/snmp/snmpd.conf:214 examining: agentXSocket /var/agentx/master<br>trace: r=
un_config_handler(): read_config.c, 536:<br>read_config:parser: Found a par=
ser.=C2=A0 Calling it: agentXSocket / /var/agentx/master<br>trace: agentx_p=
arse_agentx_socket(): mibgroup/agentx/agentx_config.c, 34:<br>agentx/config=
: port spec: /var/agentx/master<br>trace: netsnmp_ds_set_string(): default_=
store.c, 285:<br><b>netsnmp_ds_set_string: Setting APP:1 =3D &quot;/var/age=
ntx/master&quot;</b><br>trace: read_config(): read_config.c, 843:</div><div=
><br></div><div><br></div><div><b>Details:-</b><br></div><div><br></div><di=
v>Both snmpd , agentx example &#39;example-daemon&#39;=C2=A0 and folder /va=
r/agentx=C2=A0 has same permission <br></div><div>root@SyncServer:/var/log#=
 ls -la /var/agentx<br>total 8<br>drwxr-xr-x =C2=A02 root root 4096 Oct =C2=
=A02 11:46 .<br>drwxr-xr-x 13 root root 4096 Oct =C2=A02 11:46 ..<br>root@S=
yncServer:/var/log# ls -la /usr/sbin/snmpd<br>-rwxr-xr-x 1 root root 64488 =
Oct =C2=A02 09:59 /usr/sbin/snmpd<br>root@SyncServer:/var/log# ls -la /tmp/=
example-demon <br>-rwxr-xr-x 1 root root 37664 Oct =C2=A02 09:52 /tmp/examp=
le-demon</div><div><br></div><div><br></div><div><b>net-snmp-5.9 config sum=
mary</b></div><div><b><br></b></div><div>=C2=A0SNMP Versions Supported: =C2=
=A0 =C2=A01 2c 3<br>=C2=A0 Building for: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 linux<br>=C2=A0 Net-SNMP Version: =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 5.9<br>=C2=A0 Network transport support: =C2=A0Unix Alias UDP UD=
PIPv6 Callback UDPIPv4Base UDPBase IPv4Base IPBase SocketBase IPv6Base<br>=
=C2=A0 SNMPv3 Security Modules: =C2=A0 =C2=A0 usm<br>=C2=A0 Agent MIB code:=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0clock default_modules gnss host m=
ibII notification ntpSystem snmpv3mibs system target utilities =3D&gt; =C2=
=A0snmpv3mibs mibII notification notification-log-mib target<b> agentx</b> =
disman/event disman/schedule utilities host host/hrh_storage host/hrh_files=
ys host/hrSWInstalledTable host/hrSWRunTable host/hr_system host/hr_device =
host/hr_other host/hr_proc host/hr_network host/hr_print host/hr_disk host/=
hr_partition mibII/system_mib mibII/sysORTable mibII/snmp_mib mibII/vacm_va=
rs mibII/setSerialNo mibII/at mibII/ifTable mibII/ip mibII/tcp mibII/udp mi=
bII/ipv6 mibII/icmp if-mib ip-mib ip-forward-mib tcp-mib udp-mib notificati=
on/snmpNotifyTable snmp-notification-mib/snmpNotifyFilterTable notification=
/snmpNotifyFilterProfileTable ntpSystem/ntpSystem snmpv3/snmpEngine snmpv3/=
snmpMPDStats snmpv3/usmStats snmpv3/usmConf snmpv3/usmUser system/system ta=
rget/snmpTargetAddrEntry target/snmpTargetParamsEntry target/target target/=
target_counters utilities/override utilities/execute utilities/iquery<br>=
=C2=A0 MYSQL Trap Logging: =C2=A0 =C2=A0 =C2=A0 =C2=A0 unavailable<br>=C2=
=A0 Embedded Perl support: =C2=A0 =C2=A0 =C2=A0disabled<br>=C2=A0 SNMP Perl=
 modules: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0disabled<br>=C2=A0 SNMP Python =
modules: =C2=A0 =C2=A0 =C2=A0 =C2=A0disabled<br>=C2=A0 Crypto support from:=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0crypto<br>=C2=A0 Authentication support: =C2=A0=
 =C2=A0 MD5 SHA1 SHA224 SHA256 SHA384 SHA512<br>=C2=A0 Encryption support: =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 DES AES AES128 AES192 AES192C AES256 AES256C<br=
>=C2=A0 Local DNSSEC validation: =C2=A0 =C2=A0disabled</div><div><br></div>=
<div>Thanks,</div><div>Pushpa.T<br></div></div><br><div class=3D"gmail_quot=
e"><div dir=3D"ltr" class=3D"gmail_attr">On Fri, Sep 27, 2024 at 12:14=E2=
=80=AFAM Bill Fenner &lt;<a href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex"><div dir=3D"ltr">Hi Pushpa,<div><br></div><div>You are =
not enabling UNIX domain support, so net-snmp can&#39;t open the UNIX domai=
n socket for agentx. You can either use the TCP socket by configuring with =
something like</div><div><br></div><div>agentXSocket tcp:<a href=3D"http://=
127.0.0.1:705" target=3D"_blank">127.0.0.1:705</a></div><div><br></div><div=
>and then configuring clients similarly, e.g., &quot;snmptrap -X tcp:705&qu=
ot;</div><div><br></div><div>Or adding the UNIX domain transport, e.g., add=
 &quot;Unix&quot; to your &quot;--with-transports&quot; configure argument.=
</div><div><br></div><div>=C2=A0 Bill</div><div><br></div></div><br><div cl=
ass=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Sep 26, 2=
024 at 9:20=E2=80=AFAM Pushpa Thimmaiah &lt;<a href=3D"mailto:pushpa.thimma=
[email protected]" target=3D"_blank">[email protected]</a>&gt; wrote:<=
br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"=
><div>Hi All,</div><div><br></div><div>I am getting following error while s=
tarting snmpd in net-snmp-5.9. I have enabled=C2=A0 agentx and compiled the=
 source. Kindly guide me to resolve the same.</div><div>I have created dire=
ctory /var/agentx <br></div><div>---------------</div><div><br>agentx/maste=
r: initializing...<br>trace: netsnmp_tdomain_transport_tspec(): snmp_transp=
ort.c, 655:<br>tdomain: tdomain_transport_spec(&quot;agentx&quot;, &quot;/v=
ar/agentx/master&quot;, 1, &quot;[NIL]&quot;, &quot;[NIL]&quot;, &quot;[NIL=
]&quot;)<br>trace: netsnmp_tdomain_transport_tspec(): snmp_transport.c, 736=
:<br>tdomain: Address starts with &#39;/&#39;, so assume &quot;unix&quot; d=
omain<br>trace: find_tdomain(): snmp_transport.c, 610:<br>tdomain: Found no=
 domain from specifier &quot;unix&quot;<br>No support for any checked trans=
port domain<br>Error: Couldn&#39;t open a master agentx socket to listen on=
 (/var/agentx/master): <br></div><div>-------------------------------------=
--------------</div><div><br></div><div><br></div><div>Thanks,</div><div>Pu=
shpa.T<br></div></div>
_______________________________________________<br>
Net-snmp-coders mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank">=
[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/net-snmp-coders" re=
l=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/list=
info/net-snmp-coders</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>

--000000000000243186062392dd42--


--===============7740491067786900968==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============7740491067786900968==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

--===============7740491067786900968==--