Plugin OS-linux-local : Différence entre versions

De SLM - MediaWiki
Ligne 1 : Ligne 1 :
 +
[[Plugins | Retour]]
 +
 
==Installation du plugin centreon_linux_local.pl==
 
==Installation du plugin centreon_linux_local.pl==
 
  yum install centreon-plugin-Operatingsystems-Linux-Local -y
 
  yum install centreon-plugin-Operatingsystems-Linux-Local -y

Version du 1 avril 2020 à 07:50

Retour

Installation du plugin centreon_linux_local.pl

yum install centreon-plugin-Operatingsystems-Linux-Local -y

les commandes unitaires

commande check_os_linux_local_cpu

clapi -o CMD -a ADD -v "check_os_linux_local_cpu;2;\$CENTREONPLUGINS\$/centreon_linux_local.pl --plugin=os::linux::local::plugin --mode=cpu --warning-average ='\$_SERVICEWARNING\$' --critical-average ='\$_SERVICECRITICAL\$' "
clapi -o CMD -a setparam -v "check_os_linux_local_cpu;enable_shell;0"
clapi -o CMD -a setparam -v "check_os_linux_local_cpu;command_activate;1"
clapi -o CMD -a setparam -v "check_os_linux_local_cpu;command_locked;0"

commande check_os_linux_local_load

clapi -o CMD -a ADD -v "check_os_linux_local_load;2;\$CENTREONPLUGINS\$/centreon_linux_local.pl --plugin=os::linux::local::plugin --mode=load --warning='\$_SERVICEWARNING\$'  --critical='\$_SERVICECRITICAL\$' "
clapi -o CMD -a setparam -v "check_os_linux_local_load;enable_shell;0"
clapi -o CMD -a setparam -v "check_os_linux_local_load;command_activate;1"
clapi -o CMD -a setparam -v "check_os_linux_local_load;command_locked;0"

commande check_os_linux_local_memory

clapi -o CMD -a ADD -v "check_os_linux_local_memory;2;\$CENTREONPLUGINS\$/centreon_linux_local.pl --plugin=os::linux::local::plugin --mode=memory --warning='\$_SERVICEWARNING\$'  --critical='\$_SERVICECRITICAL\$' "
clapi -o CMD -a setparam -v "check_os_linux_local_memory;enable_shell;0"
clapi -o CMD -a setparam -v "check_os_linux_local_memory;command_activate;1"
clapi -o CMD -a setparam -v "check_os_linux_local_memory;command_locked;0"

commande check_os_linux_local_swap

clapi -o CMD -a ADD -v "check_os_linux_local_swap;2;\$CENTREONPLUGINS\$/centreon_linux_local.pl --plugin=os::linux::local::plugin --mode=swap --warning-usage-prct='\$_SERVICEWARNING\$'  --critical-usage-prct='\$_SERVICECRITICAL\$' "
clapi -o CMD -a setparam -v "check_os_linux_local_swap;enable_shell;0"
clapi -o CMD -a setparam -v "check_os_linux_local_swap;command_activate;1"
clapi -o CMD -a setparam -v "check_os_linux_local_swap;command_locked;0"

commande check_os_linux_local_traffic

clapi -o CMD -a ADD -v "check_os_linux_local_traffic;2;\$CENTREONPLUGINS\$/centreon_linux_local.pl --plugin=os::linux::local::plugin --mode=traffic --speed='\$_SERVICESPEED\$' --name='\$_SERVICEINTERFACE\$' --warning-out='\$_SERVICEWARNING\$' --critical-out='\$_SERVICECRITICAL\$' --warning-in='\$_SERVICEWARNING\$' --critical-in='\$_SERVICECRITICAL\$' '\$_SERVICEOPTION\$' "
clapi -o CMD -a setparam -v "check_os_linux_local_traffic;enable_shell;0"
clapi -o CMD -a setparam -v "check_os_linux_local_traffic;command_activate;1"
clapi -o CMD -a setparam -v "check_os_linux_local_traffic;command_locked;0"

commande check_os_linux_local_storage

clapi -o CMD -a ADD -v "check_os_linux_local_storage;2;\$CENTREONPLUGINS\$/centreon_linux_local.pl --plugin=os::linux::local::plugin --mode=storage --name='\$_SERVICEDISK\$'  --regexp --warning-usage='\$_SERVICEWARNING\$'  --critical-usage='\$_SERVICECRITICAL\$' "
clapi -o CMD -a setparam -v "check_os_linux_local_storage;enable_shell;0"
clapi -o CMD -a setparam -v "check_os_linux_local_storage;command_activate;1"
clapi -o CMD -a setparam -v "check_os_linux_local_storage;command_locked;0"

Création des modèles

  1. CPU
clapi -o STPL -a add -v "stpl_os_linux_local_cpu;cpu;generic-active-service-custom"
clapi -o STPL -a setparam -v "stpl_os_linux_local_cpu;check_command;check_os_linux_local_cpu"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_cpu;WARNING;70"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_cpu;CRITICAL;90"
clapi -o STPL -a setparam -v "stpl_os_linux_local_cpu;graphtemplate;CPU"
  1. LOAD
clapi -o STPL -a add -v "stpl_os_linux_local_load;load;generic-active-service-custom"
clapi -o STPL -a setparam -v "stpl_os_linux_local_load;check_command;check_os_linux_local_load"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_load;WARNING;4,3,2"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_load;CRITICAL;6,5,4"
clapi -o STPL -a setparam -v "stpl_os_linux_local_load;graphtemplate;LOAD_Average"
  1. MEMORY
clapi -o STPL -a add -v "stpl_os_linux_local_memory;memory;generic-active-service-custom"
clapi -o STPL -a setparam -v "stpl_os_linux_local_memory;check_command;check_os_linux_local_memory"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_memory;WARNING;70"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_memory;CRITICAL;90"
clapi -o STPL -a setparam -v "stpl_os_linux_local_memory;graphtemplate;Memory"
  1. SWAP
clapi -o STPL -a add -v "stpl_os_linux_local_swap;swap;generic-active-service-custom"
clapi -o STPL -a setparam -v "stpl_os_linux_local_swap;check_command;check_os_linux_local_swap"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_swap;WARNING;80"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_swap;CRITICAL;90"
clapi -o STPL -a setparam -v "stpl_os_linux_local_swap;graphtemplate;Memory"
  1. NETWORK
clapi -o STPL -a add -v "stpl_os_linux_local_traffic;swap;generic-active-service-custom"
clapi -o STPL -a setparam -v "stpl_os_linux_local_traffic;check_command;check_os_linux_local_traffic"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_traffic;INTERFACE;eth0"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_traffic;SPEED;1000"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_traffic;OPTION;--units=%"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_traffic;WARNING;80"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_traffic;CRITICAL;90"
clapi -o STPL -a setparam -v "stpl_os_linux_local_traffic;graphtemplate;Traffic"
  1. DISK
  2. Model Disk global
clapi -o STPL -a add -v "stpl_os_linux_local_storage;disk-global;generic-active-service-custom"
clapi -o STPL -a setparam -v "stpl_os_linux_local_storage;check_command;check_os_linux_local_storage"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_storage;WARNING;80"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_storage;CRITICAL;90"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_storage;DISK;.*"
clapi -o STPL -a setparam -v "stpl_os_linux_local_storage;graphtemplate;Storage"
  1. DISK
  2. Disk home
clapi -o STPL -a add -v "stpl_os_linux_local_storage_home;disk-home;stpl_os_linux_local_storage"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_storage_home;DISK;^/home\$"
  1. DISK
  2. Disk root
clapi -o STPL -a add -v "stpl_os_linux_local_storage_root;disk-root;stpl_os_linux_local_storage"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_storage_root;DISK;^/\$"
  1. DISK
  2. Disk tmp
clapi -o STPL -a add -v "stpl_os_linux_local_storage_tmp;disk-tmp;stpl_os_linux_local_storage"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_storage_tmp;DISK;^/tmp\$"
  1. DISK
  2. Disk usr
clapi -o STPL -a add -v "stpl_os_linux_local_storage_usr;disk-usr;stpl_os_linux_local_storage"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_storage_usr;DISK;^/usr\$"
  1. DISK
  2. Disk var
clapi -o STPL -a add -v "stpl_os_linux_local_storage_var;disk-var;stpl_os_linux_local_storage"
clapi -o STPL -a setmacro -v "stpl_os_linux_local_storage_var;DISK;^/var\$"

Le template d’hôte

Nous regrouperons les services dans un template d'hôte nommé Os-Linux-local

  1. HOSTS MODEL GROUP
clapi -o HTPL -a add -v "OS-Linux-local;OS-Linux-local;;;;"
clapi -o HTPL -a addtemplate -v "OS-Linux-local;generic-active-host-custom"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_cpu;OS-Linux-local"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_load;OS-Linux-local"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_memory;OS-Linux-local"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_swap;OS-Linux-local"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_traffic;OS-Linux-local"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_storage_home;OS-Linux-local"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_storage_root;OS-Linux-local"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_storage_tmp;OS-Linux-local"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_storage_usr;OS-Linux-local"
clapi  -o STPL -a addhost -v "stpl_os_linux_local_storage_var;OS-Linux-local"