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

refactoring: freeradius app metrics #8002

Merged
merged 73 commits into from Jan 5, 2018

Conversation

Projects
None yet
3 participants
@slashdoom
Copy link
Contributor

slashdoom commented Jan 2, 2018

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

slashdoom added some commits May 4, 2017

Merge pull request #8 from librenms/master
update local from master

slashdoom added some commits Dec 10, 2017

Merge pull request #9 from librenms/master
update from master
@slashdoom

This comment has been minimized.

Copy link
Contributor Author

slashdoom commented Jan 2, 2018

I think my app was pulled in in between PR #7828 and #7853 so it didn't get application metrics. I've attempted to add them.

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Jan 3, 2018

Looks correct to me.

Would you be willing to try adding test data? It is a little experimental.

./scripts/save-test-data.php -m applications -v freeradius -h HOSTNAME

@slashdoom

This comment has been minimized.

Copy link
Contributor Author

slashdoom commented Jan 3, 2018

I'm not having much luck with save-test-data.php. It won't run snmpsim. When I try to do it manually I get...

[librenms@SERVERNAME /opt/librenms]$ snmpsimd.py --data-dir=/opt/librenms/tests/snmpsim/ --agent-udpv4-endpoint=127.1.6.1:1161 --logging-method=file:/tmp/snmpsimd.log
Traceback (most recent call last):
File "/bin/snmpsimd.py", line 1224, in
snmpContext
File "/bin/snmpsimd.py", line 866, in configureManagedObjects
dataFile = DataFile(fullPath, textParser).indexText(forceIndexBuild)
File "/bin/snmpsimd.py", line 237, in indexText
self.__recordIndex.create(forceIndexBuild, validateData)
File "/usr/lib/python2.7/site-packages/snmpsim/record/search/database.py", line 121, in create
raise error.SnmpsimError('Data error at %s:%d: %s' % (self.__textFile, lineNo, exc))
snmpsim.error.SnmpsimError: Data error at /opt/librenms/tests/snmpsim//linux_freeradius.snmprec:23: broken record <FreeRADIUS-Total-Access-Accepts||>

Here's the FreeRADIUS data in linux_freeradius.snmprec...
FreeRADIUS-Queue-Len-Acct|4|
FreeRADIUS-Queue-Len-Auth|4|
FreeRADIUS-Queue-Len-Detail|4|
FreeRADIUS-Queue-Len-Internal|4|
FreeRADIUS-Queue-Len-Proxy|4|
FreeRADIUS-Queue-PPS-In|4|
FreeRADIUS-Queue-PPS-Out|4|
FreeRADIUS-Total-Access-Accepts||
FreeRADIUS-Total-Access-Challenges||
FreeRADIUS-Total-Access-Rejects||
FreeRADIUS-Total-Accounting-Requests||
FreeRADIUS-Total-Accounting-Responses||
FreeRADIUS-Total-Acct-Dropped-Requests|4|
FreeRADIUS-Total-Acct-Duplicate-Requests|4|
FreeRADIUS-Total-Acct-Invalid-Requests|4|
FreeRADIUS-Total-Acct-Malformed-Requests|4|
FreeRADIUS-Total-Acct-Unknown-Types|4|
FreeRADIUS-Total-Auth-Dropped-Requests||
FreeRADIUS-Total-Auth-Duplicate-Requests||
FreeRADIUS-Total-Auth-Invalid-Requests|4|
FreeRADIUS-Total-Auth-Malformed-Requests|4|
FreeRADIUS-Total-Auth-Responses||
FreeRADIUS-Total-Auth-Unknown-Types|4|
FreeRADIUS-Total-Proxy-Access-Accepts|4|
FreeRADIUS-Total-Proxy-Access-Challenges|4|
FreeRADIUS-Total-Proxy-Access-Rejects|4|
FreeRADIUS-Total-Proxy-Access-Requests|4|
FreeRADIUS-Total-Proxy-Accounting-Requests|4|
FreeRADIUS-Total-Proxy-Accounting-Responses|4|
FreeRADIUS-Total-Proxy-Acct-Dropped-Requests|4|
FreeRADIUS-Total-Proxy-Acct-Duplicate-Requests|4|
FreeRADIUS-Total-Proxy-Acct-Invalid-Requests|4|
FreeRADIUS-Total-Proxy-Acct-Malformed-Requests|4|
FreeRADIUS-Total-Proxy-Acct-Unknown-Types|4|
FreeRADIUS-Total-Proxy-Auth-Dropped-Requests|4|
FreeRADIUS-Total-Proxy-Auth-Duplicate-Requests|4|
FreeRADIUS-Total-Proxy-Auth-Invalid-Requests|4|
FreeRADIUS-Total-Proxy-Auth-Malformed-Requests|4|
FreeRADIUS-Total-Proxy-Auth-Responses|4|
FreeRADIUS-Total-Proxy-Auth-Unknown-Types|4|

Not sure why the blank entries. Looks fine in RRD.

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Jan 4, 2018

You can skip it if you want, like I said it is still in development.

However, it is very odd output you have there, why are all those strings there, they should be numeric OIDs. snmprec format is <numeric oid>|<type code>|<data>

I'll try to reproduce the issue. If you have the raw output that would help. My guess is the data contains =

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Jan 4, 2018

Actually, #8023 should fix your issue, can you test that?

@slashdoom

This comment has been minimized.

Copy link
Contributor Author

slashdoom commented Jan 4, 2018

Thanks @murrant, that looks much better.

linux_freeradius.json:
https://gist.github.com/slashdoom/3d72479eb0653e906908f9d205b6b4d7

linux_freeradius.snmprec (after #8023 patch):
https://gist.github.com/slashdoom/f61aa9528d119abd3b0a33bb7039e15a

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Jan 4, 2018

Looks good, can you remove the mysql and osupdates data (from the snmprec file) and regen the json file with ./scripts/save-test-data.php -o linux -v freeradius -m applications.

Then add them to this PR.

@slashdoom

This comment has been minimized.

Copy link
Contributor Author

slashdoom commented Jan 4, 2018

Hm, maybe save-test-data.php is doing a '-n, --prefer-new' option by default?

Even if I remove the mysql and os-update OID's from the snmprec file it re-adds them to linux_freeradius.snmprec when I run that command and they end up in the json file again.

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Jan 4, 2018

You need to not specify -h or it captures them from the device again. If you specify -o instead, it will use the existing data.

Use the exact command I posted above.

@slashdoom

This comment has been minimized.

Copy link
Contributor Author

slashdoom commented Jan 4, 2018

Okay, that seems to keep linux_freeradius.snmprec from getting overwritten but I still seem to get the other apps in my output.

Here's the edited linux_freeradius.snmprec:
https://gist.github.com/slashdoom/1cba9389e79d9c6a476f323b33909a11

And here's the process:
https://gist.github.com/slashdoom/a6af58785299ba66582f32c0c55190d0

Where am I going wrong?

@murrant

This comment has been minimized.

Copy link
Member

murrant commented Jan 4, 2018

You missed some snmp data, delete these lines too:

1.3.6.1.4.1.8072.1.3.2.2.1.21.2.112.115|2|1
1.3.6.1.4.1.8072.1.3.2.2.1.21.5.109.121.115.113.108|2|1
1.3.6.1.4.1.8072.1.3.2.2.1.21.8.111.115.117.112.100.97.116.101|2|1
@slashdoom

This comment has been minimized.

murrant added some commits Jan 5, 2018

@scrutinizer-notifier

This comment has been minimized.

Copy link

scrutinizer-notifier commented Jan 5, 2018

The inspection completed: No new issues

@murrant murrant merged commit 0c12fb6 into librenms:master Jan 5, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
@lock

This comment has been minimized.

Copy link

lock bot commented May 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 16, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.