View Single Post
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 08-14-2022 , 16:08   Re: client fps_max effect server performance?
Reply With Quote #7

Quote:
Originally Posted by loki_himself View Post
is it possible for an amxx plugin to listen to the console output, for example for those strings?
I don't think you can tho, it only reads those that are you've used on `register_srvcmd`. You can use `tail` to read X last lines and loop over them to check if line starts with `WARNING: datagram overflowed for` or `SZ_GetSpace: overflow on`.

Here's an example:
Code:
#!/bin/bash

$webhook="discord-webhook"

send_discord_message () {
    curl -X POST -H "Content-Type: application/json" -d "{\"content\":\"$1\"}" $webhook
}

while [ true ]; do
  tail -n 10 /home/user/server/screenlog.0 | while read line; do
  if [[ $line = "Segmentation faul"* ]]; then
    send_discord_message "Server died: ${line}"
  fi
 sleep 10
done
__________________
bigdaddy424 is offline