Ah thanks, i copied this from another service check and this seems to have worked:
check_xi_ncpa!-t 'password' -M 'processes' -w 4: -c 3: -q 'cmd=artisan,match=search' !!!!!!!
I wanted to tweak this alert a bit more by adding different checks for different artisan process types.
Code: Select all
root 603 0.0 0.0 113284 1380 pts/0 Ss+ Jul05 0:00 bash -c cd /var/www/html/api/; while true; do php artisan queue:listen ; sleep 1 ; done; exec sh
root 9309 5.0 0.1 416284 36004 pts/0 S+ 03:35 0:00 /usr/bin/php artisan queue:work --once --name=default --queue=default --backoff=0 --memory=128 --sleep=3 --tries=1
nginx 9316 11.0 0.1 416284 36012 ? S 03:36 0:00 /usr/bin/php artisan queue:work --once --name=default --queue=default --backoff=0 --memory=128 --sleep=3 --tries=3
nginx 9317 11.0 0.1 416284 36016 ? S 03:36 0:00 /usr/bin/php artisan queue:work --once --name=default --queue=default --backoff=0 --memory=128 --sleep=3 --tries=3
root 9362 0.0 0.0 112816 972 pts/1 S+ 03:36 0:00 grep --color=auto artisan
nginx 22394 0.0 0.1 416280 35928 ? S Jul05 1:54 php /var/www/html/api/[b]artisan queue:listen[/b] --sleep=3 --tries=3
root 22409 0.0 0.1 416280 35924 pts/0 S+ Jul05 1:53 php artisan queue:listen
nginx 22410 0.0 0.1 416280 35928 ? S Jul05 1:52 php /var/www/html/api/artisan queue:listen --sleep=3 --tries=3
For example, this has the different types in bold above, artisan queue:listen and artisan queue:work
Could I do something like the below?
Thanks
check_xi_ncpa!-t 'password' -M 'processes' -w 4: -c 3: -q 'cmd=artisan queue:listen,match=search' !!!!!!!
check_xi_ncpa!-t 'password' -M 'processes' -w 4: -c 3: -q 'cmd=artisan queue:work,match=search' !!!!!!!
UPDATE:
I tried the above method but I can't tell if it's working properly or not. The output of on NagiosXI looks like below:
Code: Select all
Processes Matched
PID: Name: Username: Exe: Memory: CPU
-----------------------------------
695: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
1050: php: root: 0.12 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
2935: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
4096: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
4383: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
4756: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
5604: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
5862: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
7006: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
7023: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
28587: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
42730: php: root: 0.11 % (VMS 0.45 GB, RSS 0.03 GB): 0.00 %
So it doesn't really show the full process. Any ideas?