Debian Codegraph @

madrisan-nagios-plugins-linux/nagios-plugins-linux/include/vminfo.h

raw symbols SCIP
1 // SPDX-License-Identifier: GPL-3.0-or-later
2 /* vminfo.h -- library for getting virtual memory informations
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
16
17 #ifndef _VMINFO_H_
18 #define _VMINFO_H_
19
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24
25 struct proc_vmem;
26
27 /* Return the PATH of the proc vmstat filesystem ("/proc/vmstat"), or the
28 content of the environment variable "NPL_TESTING_PATH_PROC_VMSTAT"
29 if set */
30 const char *get_path_proc_vmstat ();
31
32 /* Allocates space for a new vmem object.
33 * Returns 0 if all went ok. Errors are returned as negative values. */
34 int proc_vmem_new (struct proc_vmem **vmem);
35
36 /* Fill the proc_vmem structure pointed with the values found in the
37 * proc filesystem. */
38 void proc_vmem_read (struct proc_vmem *vmem);
39
40 /* Drop a reference of the virtual memory library context. If the refcount
41 * of reaches zero, the resources of the context will be released. */
42 struct proc_vmem *proc_vmem_unref (struct proc_vmem *vmem);
43
44 /* Accessing the values from proc_vmem */
45
46 unsigned long proc_vmem_get_pgalloc (struct proc_vmem *vmem);
47 unsigned long proc_vmem_get_pgfault (struct proc_vmem *vmem);
48 unsigned long proc_vmem_get_pgfree (struct proc_vmem *vmem);
49 unsigned long proc_vmem_get_pgmajfault (struct proc_vmem *vmem);
50 unsigned long proc_vmem_get_pgpgin (struct proc_vmem *vmem);
51 unsigned long proc_vmem_get_pgpgout (struct proc_vmem *vmem);
52 unsigned long proc_vmem_get_pgrefill (struct proc_vmem *vmem);
53 unsigned long proc_vmem_get_pgscan (struct proc_vmem *vmem);
54 unsigned long proc_vmem_get_pgscand (struct proc_vmem *vmem);
55 unsigned long proc_vmem_get_pgscank (struct proc_vmem *vmem);
56 unsigned long proc_vmem_get_pgsteal (struct proc_vmem *vmem);
57 unsigned long proc_vmem_get_pswpin (struct proc_vmem *vmem);
58 unsigned long proc_vmem_get_pswpout (struct proc_vmem *vmem);
59
60 #ifdef __cplusplus
61 }
62 #endif
63
64 #endif /* _VMINFO_H_ */