Jump to content
View in the app

A better way to browse. Learn more.

Next

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Lancement script quand un process est elevé

Featured Replies

Salut à tous,

Je vais essayer d'être un peu plus clair que dans mon titre :)

J'aimerai automatiser l'envoi d'une commande ou d'un script lorsqu'un de mes process dépasse une certaines valeurs CPU.

Je pense bien qu'avec un script c'est possible (lancer toutes les minutes un top ou ps -aux puis parser le résultat, choper la valeur et en fonction de cette valeur, exécuter une commande ou un script) mais existe t-il un moyen plus aisé pour faire ça (je suis un peu en manque de temps ; -) ?

Merci pour votre aide ;)

voilà la solution gruiiiiik à souhait :byebye:

#!/bin/bash

IFS="
"

myps=$(ps -eo cp,pid,cmd)

for i in $myps
do
	declare -i cpu=$(echo $i | cut -d " " -f2 | cut -d "." -f1)

	if [[ $cpu > 10 ]] # en dixieme de pourcent, soit 1%
	then
			echo "cpu dépassé : "$i
	fi
done

Archived

This topic is now archived and is closed to further replies.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.