Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have more logging status codes #1169

Open
inphobia opened this issue Feb 16, 2024 · 0 comments
Open

have more logging status codes #1169

inphobia opened this issue Feb 16, 2024 · 0 comments

Comments

@inphobia
Copy link
Member

Expected Behavior

map severity of problem on status code.

Current Behavior

when netdisco returns a status it might be defaulting to error to quickly.

Possible Solution

define flowchart a bit more strict + add a few more levels, perhaps based on syslog:

  • error: fundamental issue that needs to be manually resolved
    • return Status->error('missing cmd parameter to exec Hook')
  • warning (new): errors from the perl interpreter, startup messages;
    • Use of uninitialized value $proto in numeric eq (==) at /home/netdisco/perl5/lib/perl5/SNMP/Info/LLDP.pm line 461.
    • [20421] 2024-02-14 13:23:55 warn App::Netdisco 2.072002 web
  • notification (new): transient in nature
    • [17471] 2024-02-16 18:36:42 error [10.40.254.33] interfaces - Error! Failed to get uptime from device!
  • info: unchanged
  • debug: unchanged

we could be bound to whatever Dancer::Logger::Capture provides as logging levels. moving to something like https://metacpan.org/pod/Log::Report (comes with dancer hooks) might be overkill (see context for issue i'm trying to solve)

Steps to Reproduce (for bugs)

Context

don't have log level defined so using the default log: 'warning' from config.yml

the messages i'm most interested in seem to be getting drowned out by repeated items, for example:

wc -l logs/netdisco-backend.log.x
34272 logs/netdisco-backend.log.x

grep -i uptime logs/netdisco-backend.log.x | wc -l
4740

grep -i lldp logs/netdisco-backend.log.x | wc -l
29232

uptime and lldp are from these lines:

Use of uninitialized value $proto in numeric eq (==) at /home/netdisco/perl5/lib/perl5/SNMP/Info/LLDP.pm line 461.
[18069] 2024-01-13 22:38:16 error  [10.93.13.1] interfaces - Error! Failed to get uptime from device!

since those are 98% of the logfile it's easy to overlook thinkgs as
[30544] 2024-01-16 23:14:06 error [1.1.1.1] ssh connection error [unable to establish master SSH connection: master process exited unexpectedly]

or the dbix errors from #1168

grep -v can be of assistance ofcourse, if it wouldn't choke on the control characters mentioned in above issue.

Your Environment

  • Netdisco version used: 2.072002
  • SNMP::Info version used:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants