NagiosEnterprises / nsti

Nagios SNMP Trap Interface
GNU General Public License v2.0
15 stars 11 forks source link

NSTI: 3.0.3: Only Query Database for Traps That Are Being Viewed (very short load times even in large environments) #17

Open varnar opened 9 years ago

varnar commented 9 years ago

Hello,

It is any way before show traps having possibility to select the date/time, for example: "Last 15min", "Last 60min", "Last 4h", "Last 24h", "Today", "Last 7days" and then giving some possibility to enter date/time for loading data.

Because, if DB is already of-loaded on separate server and you have 22249 Traps Total it is going to be slow.

Thanks

lgroschen commented 9 years ago

Varnar, thanks for your interest!

I'm going to use something like the following: https://datatables.net/examples/plug-ins/api.html

Not sure if that's the exact way to go, but something similar where the jquery doesn't load more than what needs to be viewed by the page. Every time you use the pagination it reloads and draws the tds, etc. Also will inlcude the number to display at a time, sorting of all columns and those will be saved through navigation until set again and lastly it includes a search bar which I am planning on adding a regex to. If I can get a regex in there I might be able to just allow any type of query on any column against any row and include wild cards, something like this might satisfy your request.

In the mean time have you tried using the filter feature shown here? Just use the dropdown on the page to apply the filter to the table view:

nsti_020215_filter

varnar commented 9 years ago

Hello @lgroschen Yes, that filter is working and it really works when all traps is already loaded :)

lgroschen commented 9 years ago

I'm going to leave this open as a general feature request.

Hope to make NSTI only load the traps that are going to display since it should know by ID. Then you would never have to query the whole database every time you load a page or apply a filter. Using the table in my previous comment will help do this while also adjusting the backend that loads the trap table.

hedenface commented 7 years ago

Added to 3.0.3

bjornfro commented 7 years ago

When will 3.0.3 be available and was/is this fixed there? I have this problem where NSTI is extremely slow. I have many many thousands of SNMP traps in DB. Guess I need to revert to old Nagtrap if this is not planned to be implemented.

jomann09 commented 7 years ago

Are you running this in conjunction with Naigos XI or Nagios Core?

The issue is that the entire DB set is being pulled into the datatables library, from what I can understand, and is being changed in the new version.

bjornfro commented 7 years ago

No, not running either. Not sure what that matters. I'm talking about the NSTI web interface.

I know the issue is the entire DB being pulled. Question is if this is planned to be adjusted anytime soon?

jvandermeulen commented 7 years ago

@jomann09 Also curious for the answer to the question(s) of @bjornfro

jomann09 commented 7 years ago

I was only asking because we are planning on a new version of NSTI, which will not be pulling the whole database, but will be integrated with our products. We likely won't be updating this version of NSTI any time soon.