Skip to content

Add -N args, but script not work, how to fix it? #323

@axiaoxin

Description

@axiaoxin
8月 06 05:17:09  earlyoom[1668157]: mem avail:  1506 of  6888 MiB (21.86%), swap free:    0 of    0 MiB ( 0.00%)
8月 06 05:23:41  earlyoom[1668157]: mem avail:   692 of  6947 MiB ( 9.96%), swap free:    0 of    0 MiB ( 0.00%)
8月 06 05:23:41  earlyoom[1668157]: low memory! at or below SIGTERM limits: mem 10.00%, swap 10.00%
8月 06 05:23:41 earlyoom[1668157]: sending SIGTERM to process 1965702 uid 0 "Isolated Web Co": oom_score 850, VmRSS 1308 MiB, cmdline "/root/.cache/selenium/firefox/linux64/128.0.3/firefox-bin -contentproc -childI>
8月 06 05:23:41 earlyoom[1668157]: kill_release: pid=1965702: process_mrelease pidfd=4 success
8月 06 05:23:41 earlyoom[1668157]: process 1965702 exited after 0.000 seconds

no logs for scripts.

the script code:

#!/bin/bash

WEBHOOK_URL='https://qyapi.weixin.qq.com/cgi-bin/webhook/send'

CONTENT="earlyoom killed\n\n"
CONTENT+="PID: $EARLYOOM_PID\n"
CONTENT+="NAME: $EARLYOOM_NAME\n"
CONTENT+="CMD: $EARLYOOM_CMDLINE\n"
CONTENT+="UID: $EARLYOOM_UID"

curl -X POST "$WEBHOOK_URL" \
     -H "Content-Type: application/json" \
     -d "{
           \"msgtype\": \"text\",
           \"text\": {
               \"content\": \"$CONTENT\"
           }
     }"

config:

EARLYOOM_ARGS="-r 600 -m 10 -s 10 -N /etc/notifer/script.sh --avoid '(^|/)(init|sshd)$'"

May I ask if this is correct for me? How to check if a script runs when a process is killed, how to view script run logs or check error messages?Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions