How does a node send entries to Syslog on a Pi?

One hacky way would be to stop the logging... You should be able to find a file in your .node-red/node_modules/node-red-node-snmp directory called snmp.js.
In there I am going to guess that it may be line 248

 247                   if (error) {
 248                       node.error(error.toString(), msg);

so comment out just line 248 by adding // to the start of the line. Save and restart Node-RED.
Hopefully that is the line that the errors are being reported from - but if it comes from deeper within the library it may be harder. This also assumes that is is just the simple GET you are using.
It does of course block all errors from the log so is not really an ideal way to fix it as you may actually want to log some failures.

Another way would be to use a catch node to report the error in the flow - and then based on the error reported to back off your request rate until the situation is resolved, so the log doesn't fill so fast. Ie if error detected - drop to once every minute. And likewise when you get a good response go back to the high polling rate.

Other things you could do are to look at the logrotate options in /etc/logrotate.conf that control how often the system log is truncated and compressed etc...and so could clean up the disk more quickly to prevent filling up, but that is a general linux topic not Node-RED.

Thanks for that, kind of exactly what I was looking for...though I don't think it worked. I commented the line and did a full reboot, but it still drops errors in the syslog (simulated errors by having it Get to a non-existent IP).

I'm going to work on a rate-adjustment flow as you suggested. Thanks.

Weird, but after a second reboot (hard power cycle by PDU), it looks like the SNMP node is no longer erroring in the Syslog.

Thanks!

Update for more accurate info:

Commenting the line on the snmp.js file actually did NOT work.
BUT, using the "Catch" node did work. Or, both solutions worked together, not sure.

I'm prepping to replace the Pi anyway to add relays and sensors (easier to wire up to a new Pi at home than wire add-ons to existing unit on site).

I copied the old flows to a new Rpi, which errors because it's on a different lan right now and can't reach those IP addresses.
Then I noticed it was logging a different SNMP node than the noisier one on site. The only difference was that I had added the noisy node to the catch node. At the time, I had thought they stopped because I did a hard reboot on the Pi.
So I added the second noisy node to the catch node, and all the syslog entries ceased.

So the ultimate solution is that the "Catch" node seems to have been a way to pipe the errors somewhere else.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.