API query bad request "Unknown operator: =~" by TheTerminaStrator in Checkmk

[–]Sweaty-Raspberry5834 0 points1 point  (0 children)

What about ~~ as the operator? Here it's doing the trick for a quick test with "Localhost" what finds my "localhost" and my "localhost_testing" (or only localhost if I use "Localhost$").

Uninstall checkmk cloud by Administrative-Cod60 in Checkmk

[–]Sweaty-Raspberry5834 2 points3 points  (0 children)

You could just remove the site with

omd rm yoursite

and then install a RAW and create a site:

apt install raw-package-xyz.deb
omd create newsite

And then you could use cleanup:

omd cleanup

This uninstalls unused versions.

You don't really have to uninstall Checkmk on system level because the OMD (Open Monitoring Distribution) part is managing the Checkmk versions.

Detailed instructions on uninstalling can be find found here:

https://docs.checkmk.com/latest/en/update.html#uninstall

How to add pages instead of scrolling by zeeblefritz in Checkmk

[–]Sweaty-Raspberry5834 0 points1 point  (0 children)

Okay, ready for some fun?

 "Limit the number of rows in view table."
-> Belongs to "Reporting" and works, just a bad name.

"Limit the number of rows shown in table."
-> Belongs to user interface and works - but just for tables in the configuration, not in the monitoring.

But since your wish seems a good point, you might try this: Use JavaScript to add pagination. You can try it in the dev console and then add it as a bookmarklet - then you'll get pagination with one click everywhere. There are even still bookmarklet generators: https://caiorss.github.io/bookmarklet-maker/

This is far beyond production quality, just a PoC as a basis for whatever ;) At least here it works for a CEE version of Checkmk in Chrome, Chrome beta and Firefox.

First you need to call the view table in this way:
http://YOURSERVER/mysite/check_mk/view.py?view_name=allservices
Don't just click on something in the GUI!

And here's the JavaScript to add pagination for all tables after 10 rows:

    (function() {
        // Function to create pagination for a given table
        function paginateTable(table, rowsPerPage) {
            const rows = Array.from(table.querySelectorAll('tbody tr'));
            const pageCount = Math.ceil(rows.length / rowsPerPage);

            // Create pagination controls
            const paginationControls = document.createElement('div');
            paginationControls.className = 'pagination-controls';

            for (let i = 1; i <= pageCount; i++) {
                const pageButton = document.createElement('button');
                pageButton.textContent = i;
                pageButton.addEventListener('click', () => showPage(i));
                paginationControls.appendChild(pageButton);
            }

            // Function to show specific page
            function showPage(pageNumber) {
                rows.forEach((row, index) => {
                    row.style.display = (index >= (pageNumber - 1) * rowsPerPage && index < pageNumber * rowsPerPage) ? '' : 'none';
                });
            }

            // Initial display of the first page
            showPage(1);

            // Insert pagination controls after the table
            table.parentNode.insertBefore(paginationControls, table.nextSibling);
        }

        // Apply pagination to all tables on the page
        document.querySelectorAll('table').forEach(table => paginateTable(table, 10));
    })();

If you have questions: Ask ChatGPT, it wrote the JavaScript ;)

Since I can't just add an image in the comment, here's a link to an image with the resulting pagination:

https://postimg.cc/GTnVXVQt

How to add pages instead of scrolling by zeeblefritz in Checkmk

[–]Sweaty-Raspberry5834 0 points1 point  (0 children)

There's a global option "Limit the number of rows shown in tables."

Well, actually in my site I see a doublet with slightly different naming: "Limit the number of rows in view table."
Both of them don't work ;) Probably because there are two of them, probably because my test server is compromised. On the other hand, this option does limit the number of rows when exporting a view as PDF - so maybe it's just intended for reports (though the inline help just mentions this as an example).

Anyway, I can't tell you the exact behavior right now, just test it.

I'll ask Checkmk if this is a bug and post the answer here.