Outils pour utilisateurs

Outils du site


blog

Notes atop

http://www.atoptool.nl/

Voir aussi :

  • systemd-cgtop
  • tload (procps)
  • btop
  • powertop
  • Réseau : vnstat, iptraf-ng, nethogs, nload, bwm-ng

Source http://ghichepcanhan.com/2014/05/03/linux-basics-monitor-system-resources-and-processes-using-atop/

atop -r -b 12:00
atop -r 20160712 -b 20:30
atopsar -A -b 13:00 -e 13:35

Hier (Yesterday)

atop -r y

Avant-hier

atop -r yy

Fichier texte avec conso CPU et commandes lancées

atop -r 20240209 -c -b 10:00 -e 10:10 | tee cpu.log

Configuration

Atop enregistre la table des process par défaut toutes les 10 minutes.

/etc/atop/atop.daily

#INTERVAL=600                            # interval 10 minutes
INTERVAL=60

A ne pas confondre avec intervalle défini pour le mode interactif, qui est de 10 seconds par défaut. Il est possible de le changer en créer un fichier atoprc.

/etc/atoprc

interval 5

Installation à partir des sources avec Netatop

Installation des dépendances pour Atop

sudo apt-get build-dep atop
sudo apt-get install linux-headers-amd64

Dépendance pour Netatop :

apt-get install zlib1g-dev
wget http://www.atoptool.nl/download/atop-2.2-3.tar.gz
tar xzvf atop-2.2-3.tar.gz
cd atop-2.2-3/
''make systemdinstall'' ou ''make sysvinstall''
wget http://www.atoptool.nl/download/netatop-0.6.tar.gz
tar xzvf netatop-0.6.tar.gz 
cd netatop-0.6/
make
make install
service netatop start

Si Init

update-rc.d netatop defaults

Si SystemD

systemctl enable netatop

Netatop sert pour monitorer la bande passante. Nous tester

atop

Puis n comme network.

Utilisation

m : memory

a : All process / Only active process U apache : Utilisateur apache uniquement u : Conso par utilisateur(s)


Autre outil monitoring

systemd-cgtop
2025/03/24 15:06

Notes ASM Assembleur

Désassembler

Source : https://fr.wikipedia.org/wiki/Portable_Executable

Les outils

  • Module pefile.py
  • Module Pydasm.py
  • Immunity Debugger
  • PEiD - Analyse des Packers
  • LordPE - Éditeur de Fichier PE
  • W32Dasm - Désassembleur [archive]
  • OllyDbg - Débogueur pour Windows
  • ImpRec - Outil de Reconstruction d'IAT
  • ResHacker - Éditeur de Ressource
  • WinHex - Éditeur Hexadécimal
  • PeStudio - Analyse de nombreuses structures PE d'une application
2025/03/24 15:06

AAP managed hosts Python requirements

Managed node requirements

Source : https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html

The managed node (the machine that Ansible is managing) does not require Ansible to be installed, but requires Python 2.7, or Python 3.5 - 3.11 to run Ansible-generated Python code


RHEL 6 utilizes Python 2.6

Source : https://access.redhat.com/articles/6977724

RHEL 6 utilizes Python 2.6, and with the release of Ansible Core 2.13, managed nodes running Python 2.6 are no longer supported

Frequently asked questions

Question: RHEL 6 and RHEL 7 include newer versions of Python in the Software Collections repositories, can I install a newer version of Python so that newer versions of Ansible Core will still support these RHEL releases? This will not work, as the Python bindings for items such as yum are contained within the yum package, and the bindings are only included for the version of Python shipped with the respective RHEL release (Python 2.6 for RHEL 6, Python 2.7 for RHEL 7).

Question: I have RHEL 6 systems I need to manage with Ansible – what options do I have? Ansible Core 2.13, planned to be included with RHEL 8.7 and 9.1, is planned to remove support for RHEL 6 clients. For the RHEL System Roles use case, one option would be to use Ansible Engine 2.9 on a RHEL 7 or RHEL 8 control node. Ansible Engine 2.9, for the RHEL System Roles use case follows the life cycle dates of Ansible Automation Platform version 1.2 as specified on the Red Hat Ansible Automation Platform Life Cycle page.


Adding Python 2.7 to RHEL6

Source : https://access.redhat.com/solutions/92933

Python 2.7 (and Python 3.3) is available through the Red Hat offering called Red Hat Software Collections (RHSCL).

Once the RHSCL repository is added to the system's repositories, then Python 2.7 can be installed with yum such as: Raw yum install python27-python


Install Python 2.7 with Software Collections

Source : https://docs.datastax.com/en/jdk-install/doc/jdk-install/installPython27RHEL.html

Not supported

Verify your Python version:

python -V

If Python is not version 2.7.x, install it from the Software Collections ( SCL ) Repository:

sudo yum update
sudo yum install scl-utils
sudo yum install centos-release-scl-rh
sudo yum install python27
sudo scl enable python27 bash

Verify the update:

$ python -V
Python 2.7.8

After logging out or restarting, you must enable python 2.7:

sudo scl enable python27 bash

Compiler Python

Utiliser un Execution Environment avec un Ansible Engine en 2.9

Une autre façon est d’utiliser un Exécution Environment avec un Ansible Engine en 2.9.

Par exemple : « Automation Hub Ansible Engine 2.9 execution environment », parce que Ansible 2.9 support RH6.

Avec cette approche il n’est pas nécessaire de modifier les cibles. Par contre il sera probablement nécessaire de faire évoluer l’Execution Envionment.


2025/03/24 15:06

Notes sur le protocole ARP

Voir aussi :

  • arp-scan
  • arptables
  • ebtables
  • ip neigh

/etc/rc.local

#!/bin/sh -e
arp -f /etc/ethers
 
exit 0

/etc/ethers

20:aa:4b:22:8B:4f	192.168.2.1
00:20:ed:5d:73:0b	192.168.2.100

Afficher la table ARP

arp -an
ip n

(ndp -a pour IPv6 ?)

cat /proc/net/arp

Autre moyen d'éviter une attaque MITM à son encontre par corruption du cache ARP.

arp -s "$gatewayIp" "$gatewayMac"

Vider le cache ARP

#ip neighbor flush dev bond0
ip -s -s neigh flush all

Effacer une entrée avec la commande arp

arp -d 192.168.1.1

Générer une adresse mac

printf 'DE:AD:BE:EF:%02X:%02X\n' $((RANDOM%256)) $((RANDOM%256))

52:54:00


Exemple de pb

# arping -I p1p2 -c 1 215.219.132.12
ARPING 215.219.132.12 from 215.219.132.91 p1p2
Unicast reply from 215.219.132.12 [4C:D9:8F:9A:06:74]  0.766ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)
# ping -I p1p2 215.219.132.12
PING 215.219.132.12 (215.219.132.12) from 215.219.132.91 p1p2: 56(84) bytes of data.
# ip neigh | egrep 215.219.132.12
215.219.132.12 dev p1p2  FAILED

Clearing cache with ip

# ip -s -s n flush all
215.219.132.12 dev p1p2  used 13/75/12 probes 6 FAILED
172.19.1.254 dev nm-bond lladdr d0:d0:fd:8d:a4:43 ref 1 used 45/0/45 probes 4 REACHABLE

*** Round 1, deleting 2 entries ***
*** Flush is complete after 1 round ***
# ping -I p1p2 215.219.132.12
PING 215.219.132.12 (215.219.132.12) from 215.219.132.91 p1p2: 56(84) bytes of data.
^C
--- 215.219.132.12 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

# ip n
215.219.132.12 dev p1p2  INCOMPLETE
172.19.1.254 dev nm-bond lladdr d0:d0:fd:8d:a4:43 REACHABLE

# ip n
215.219.132.12 dev p1p2  FAILED
172.19.1.254 dev nm-bond lladdr d0:d0:fd:8d:a4:43 REACHABLE

Pb doublon d'adresse IP

Erreur, un autre hôte utilise déjà l'adresse 192.168.1.20

Mais rien n'y fait :

iptables -I INPUT -i eth0
iptables -I FORWARD -i eth0
#iptables -I FORWARD -o eth0
iptables -I OUTPUT -o eth0
 
ip route del blackhole 192.168.1.20

Il s'agit d'une erreur réel. Sur une VM de test je dois tester une procédure mais sur toutes les interfaces réseaux possible de l'hyperviseur mon adresse est déjà prise.

Il est rare que l'on veux forcer ou ignorer un doublon d'adresse IP. Mais dans mon cas je suis sur un environement de laboratoire, et il est compliqué pour moi de changer d'adresse IP.

Solution :

ip link set arp off dev eth0

Voir aussi

echo 1 > /proc/sys/net/ipv4/conf/all/hidden

Autre solution :

  • Suprimer eth0 (mais comment ?)
  • le recréer avec la commande ip et faire un bgrige ou autre sur lo
2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki