summaryrefslogtreecommitdiffstats
path: root/collectors/apps.plugin
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/apps.plugin')
-rw-r--r--collectors/apps.plugin/README.md2
-rw-r--r--collectors/apps.plugin/apps_groups.conf20
-rw-r--r--collectors/apps.plugin/apps_plugin.c25
3 files changed, 32 insertions, 15 deletions
diff --git a/collectors/apps.plugin/README.md b/collectors/apps.plugin/README.md
index 76821695..150889d4 100644
--- a/collectors/apps.plugin/README.md
+++ b/collectors/apps.plugin/README.md
@@ -160,7 +160,7 @@ There are a few command line options you can pass to `apps.plugin`. The list of
### Integration with eBPF
If you don't see charts under the **eBPF syscall** or **eBPF net** sections, you should edit your
-[`ebpf.d.conf`](/collectors/ebpf.plugin/README.md#ebpf-programs) file to ensure the eBPF program is enabled.
+[`ebpf.d.conf`](/collectors/ebpf.plugin/README.md#configure-the-ebpf-collector) file to ensure the eBPF program is enabled.
Also see our [guide on troubleshooting apps with eBPF
metrics](/docs/guides/troubleshoot/monitor-debug-applications-ebpf.md) for ideas on how to interpret these charts in a
diff --git a/collectors/apps.plugin/apps_groups.conf b/collectors/apps.plugin/apps_groups.conf
index f4824cd9..1d1af4b7 100644
--- a/collectors/apps.plugin/apps_groups.conf
+++ b/collectors/apps.plugin/apps_groups.conf
@@ -82,7 +82,6 @@ cups.plugin: cups.plugin
xenstat.plugin: xenstat.plugin
perf.plugin: perf.plugin
charts.d.plugin: *charts.d.plugin*
-node.d.plugin: *node.d.plugin*
python.d.plugin: *python.d.plugin*
tc-qos-helper: *tc-qos-helper.sh*
fping: fping
@@ -103,7 +102,7 @@ fail2ban: fail2ban*
# -----------------------------------------------------------------------------
# web/ftp servers
-httpd: apache* httpd nginx* lighttpd hiawatha
+httpd: apache* httpd nginx* lighttpd hiawatha caddy
proxy: squid* c-icap squidGuard varnish*
php: php* lsphp*
ftpd: proftpd in.tftpd vsftpd
@@ -128,10 +127,11 @@ email: dovecot imapd pop3d amavis* zmstat* zmmailboxdmgr saslauthd opendkim post
# network, routing, VPN
ppp: ppp*
-vpn: openvpn pptp* cjdroute gvpe tincd wireguard
-wifi: hostapd wpa_supplicant NetworkManager
+vpn: openvpn pptp* cjdroute gvpe tincd wireguard tailscaled
+wifi: hostapd wpa_supplicant
routing: ospfd* ospf6d* bgpd bfdd fabricd isisd eigrpd sharpd staticd ripd ripngd pimd pbrd nhrpd ldpd zebra vrrpd vtysh bird*
modem: ModemManager
+netmanager: NetworkManager nm* systemd-networkd networkctl netplan
tor: tor
# -----------------------------------------------------------------------------
@@ -139,7 +139,7 @@ tor: tor
camo: *camo*
balancer: ipvs_* haproxy
-ha: corosync hs_logd ha_logd stonithd pacemakerd lrmd crmd
+ha: corosync hs_logd ha_logd stonithd pacemakerd lrmd crmd keepalived
# -----------------------------------------------------------------------------
# telephony
@@ -183,14 +183,19 @@ heapster: heapster
# -----------------------------------------------------------------------------
# AWS
-aws-s3: '*aws s3*'
+aws-s3: '*aws s3*' s3cmd s5cmd
aws: aws
# -----------------------------------------------------------------------------
+# virtualization platform
+
+proxmox-ve: pve*
+
+# -----------------------------------------------------------------------------
# containers & virtual machines
containers: lxc* docker* balena*
-VMs: vbox* VBox* qemu*
+VMs: vbox* VBox* qemu* kvm
# -----------------------------------------------------------------------------
# ssh servers and clients
@@ -350,4 +355,3 @@ gremlin: gremlin*
# load testing tools
locust: locust
-
diff --git a/collectors/apps.plugin/apps_plugin.c b/collectors/apps.plugin/apps_plugin.c
index 6924b2bf..8a115d06 100644
--- a/collectors/apps.plugin/apps_plugin.c
+++ b/collectors/apps.plugin/apps_plugin.c
@@ -118,6 +118,7 @@ typedef enum {
PROC_STATUS_END, //place holder for ending enum fields
} proc_state;
+#ifndef __FreeBSD__
static proc_state proc_state_count[PROC_STATUS_END];
static const char *proc_states[] = {
[PROC_STATUS_RUNNING] = "running",
@@ -126,6 +127,7 @@ static const char *proc_states[] = {
[PROC_STATUS_ZOMBIE] = "zombie",
[PROC_STATUS_STOPPED] = "stopped",
};
+#endif
// ----------------------------------------------------------------------------
// internal flags
@@ -1252,7 +1254,6 @@ void arl_callback_status_rssshmem(const char *name, uint32_t hash, const char *v
aptr->p->status_rssshmem = str2kernel_uint_t(procfile_lineword(aptr->ff, aptr->line, 1));
}
-#endif // !__FreeBSD__
static void update_proc_state_count(char proc_state) {
switch (proc_state) {
@@ -1275,6 +1276,7 @@ static void update_proc_state_count(char proc_state) {
break;
}
}
+#endif // !__FreeBSD__
static inline int read_proc_pid_status(struct pid_stat *p, void *ptr) {
p->status_vmsize = 0;
@@ -1495,7 +1497,9 @@ static inline int read_proc_pid_stat(struct pid_stat *p, void *ptr) {
p->cstime = 0;
p->cgtime = 0;
}
+#ifndef __FreeBSD__
update_proc_state_count(p->state);
+#endif
return 1;
cleanup:
@@ -1640,7 +1644,7 @@ cleanup:
}
#else
static inline int read_global_time() {
- static kernel_uint_t utime_raw = 0, stime_raw = 0, gtime_raw = 0, ntime_raw = 0;
+ static kernel_uint_t utime_raw = 0, stime_raw = 0, ntime_raw = 0;
static usec_t collected_usec = 0, last_collected_usec = 0;
long cp_time[CPUSTATES];
@@ -1958,6 +1962,8 @@ static inline int read_pid_file_descriptors(struct pid_stat *p, void *ptr) {
static char *fdsbuf;
char *bfdsbuf, *efdsbuf;
char fdsname[FILENAME_MAX + 1];
+#define SHM_FORMAT_LEN 31 // format: 21 + size: 10
+ char shm_name[FILENAME_MAX - SHM_FORMAT_LEN + 1];
// we make all pid fds negative, so that
// we can detect unused file descriptors
@@ -1995,7 +2001,7 @@ static inline int read_pid_file_descriptors(struct pid_stat *p, void *ptr) {
}
// get file descriptors array index
- int fdid = fds->kf_fd;
+ size_t fdid = fds->kf_fd;
// check if the fds array is small
if (unlikely(fdid >= p->fds_size)) {
@@ -2055,7 +2061,8 @@ static inline int read_pid_file_descriptors(struct pid_stat *p, void *ptr) {
#endif
break;
case KF_TYPE_SHM:
- sprintf(fdsname, "other: shm: %s size: %lu", fds->kf_path, fds->kf_un.kf_file.kf_file_size);
+ strncpyz(shm_name, fds->kf_path, FILENAME_MAX - SHM_FORMAT_LEN);
+ sprintf(fdsname, "other: shm: %s size: %lu", shm_name, fds->kf_un.kf_file.kf_file_size);
break;
case KF_TYPE_SEM:
sprintf(fdsname, "other: sem: %u", fds->kf_un.kf_sem.kf_sem_value);
@@ -2575,9 +2582,10 @@ static inline int collect_data_for_pid(pid_t pid, void *ptr) {
static int collect_data_for_all_processes(void) {
struct pid_stat *p = NULL;
+#ifndef __FreeBSD__
// clear process state counter
memset(proc_state_count, 0, sizeof proc_state_count);
-#ifdef __FreeBSD__
+#else
int i, procnum;
static size_t procbase_size = 0;
@@ -3760,7 +3768,7 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type
}
if(show_guest_time) {
- fprintf(stdout, "CHART %s.cpu_guest '' '%s CPU Guest Time (100%% = 1 core)' 'percentage' cpu %s.cpu_system stacked 20022 %d\n", type, title, type, update_every);
+ fprintf(stdout, "CHART %s.cpu_guest '' '%s CPU Guest Time (100%% = 1 core)' 'percentage' cpu %s.cpu_guest stacked 20022 %d\n", type, title, type, update_every);
for (w = root; w; w = w->next) {
if(unlikely(w->exposed))
fprintf(stdout, "DIMENSION %s '' absolute 1 %llu\n", w->name, time_factor * RATES_DETAIL / 100LLU);
@@ -3849,6 +3857,8 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type
}
}
+
+#ifndef __FreeBSD__
static void send_proc_states_count(usec_t dt)
{
static bool chart_added = false;
@@ -3872,6 +3882,7 @@ static void send_proc_states_count(usec_t dt)
}
send_END();
}
+#endif
// ----------------------------------------------------------------------------
// parse command line arguments
@@ -4124,6 +4135,8 @@ static int check_capabilities() {
int main(int argc, char **argv) {
// debug_flags = D_PROCFILE;
+ clocks_init();
+
pagesize = (size_t)sysconf(_SC_PAGESIZE);
// set the name for logging