command to check DB size

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

command to check DB size

Post by DOkuwa »

I want to know the command to check database size in Nagios as the database is integrated in Nagios
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: command to check DB size

Post by tacolover101 »

you should just be able to du / df the data directory that SQL lives in.

i don't have an XI machine handy so i can't tell you the exact path. hopefully that helps point you in the right direction.
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: command to check DB size

Post by DOkuwa »

Thanks
I can't seems to find the DB as it is embedded in the Nagios application and operating system
My file structure does not tell me where the DB is
or it is not mounted on a separate filesystem
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: command to check DB size

Post by npolovenko »

@DOkuwa, By default, Nagios Core is not using any database. So unless you are using something like NDOUtils, chances are you might not even have MYSQL. You can try the commandservice mysqld status or which mysql to see if you have some kind of output indicating that you have one installed.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
DOkuwa
Posts: 114
Joined: Tue Aug 15, 2017 3:54 pm

Re: command to check DB size

Post by DOkuwa »

thanks
but how does it store its data
is in a flat file
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: command to check DB size

Post by mcapra »

Nagios Core stores it's live data in memory. What objects it should be checking, what the status of those objects is, what checks should be executed when, etc; All in memory.
DOkuwa wrote:but how does it store its data
If you really want to get more granular than "in-memory", I'd recommend looking at the source. Here's the core structures:
https://github.com/NagiosEnterprises/na ... /objects.h

When Nagios Core starts up, it reads from the configuration files which are flat-files stored on disk. It parses those configuration files and builds the appropriate object which is then stuffed into memory. However, once the daemon is started, I don't believe it references those files for the duration of it's run time.

Did you have a particular use case you wanted some insights on? Specific advice could probably be offered.
Former Nagios employee
https://www.mcapra.com/
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: command to check DB size

Post by dwhitfield »

mcapra wrote: Did you have a particular use case you wanted some insights on? Specific advice could probably be offered.
Yes, that would be very helpful. Thanks @mcapra!
Locked