On Sun, Dec 22, 2019 at 2:56 PM Raz Moshe <razabc...@gmail.com> wrote:
> Hello, > > Assuming I have no community string configured (and so cannot use > 'snmpwalk' and other similar binaries), when I turn the snmp daemon on, is > there a way to determine it has done initialization and ready for queries? > > I found that checking if the log file exists gives a good indication (if > it was created already, snmpd is ready), but then there's a problem when I > turn snmpd on, off and then on again. Since the log file isn't deleted when > snmpd is turned off, it's gonna be there in the second time even before I > turn snmpd on. > > A short sleep() after turning snmpd on can do the trick, but obviously > that's a bad practice. > > Anything else I can do to get a good indication? > See if it's actually running? $ pidof snmpd && echo running See if there's anything listening on the standard port? $ nmap localhost -p161 | grep -q open && echo running That said, what use is the daemon running "for queries" if there's no users configured that can actually perform queries?
_______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users