snmp_save_persistent()

Mark Ellison <[email protected]>
Newsgroups gmane.network.net-snmp.devel,gmane.network.net-snmp.user
Message-ID <CABfCB8ojiChCZ-1Ky-xiNbt0kJzp0CmqEkap295f5mRvv79soQ@mail.gmail.com>
Hi,

I want to update a line in an application configuration file during the
commit phase of an SNMP SET operation.  I am noticing the read_config_store
appends a new line to the configuration file when I want to replace a line.
This config file lives in the net-snmp persistent directory.

I've had no problems using the register_config_handler() routine and am
getting the callback when my token is read during snmpd startup.

As of now, I am searching for a way to do essentially what
snmp_save_persistent() does, short of adding the warning banner to the top
of the file.

Looking at the Net-SNMP implemented code base, it appears the preferred
method for updating configuration from the daemon is to move the
configuration off to the side and write a new configuration file with the
changed values.

If anyone can suggest a method for either:
(a) overwriting the given token line with the new value, or
(b) short of re-writting snmp_save_persistent, achieve the desired behavior
without the banner.
(c) using other means to achieve same goal

Any follow-ups are appreciated!

Regards,



Mark Ellison

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.