<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nagios - Gagzen</title>
	<atom:link href="https://gagzen.net/tag/nagios/feed/" rel="self" type="application/rss+xml" />
	<link>https://gagzen.net</link>
	<description></description>
	<lastBuildDate>Sat, 01 Nov 2008 13:57:37 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://gagzen.net/wp-content/uploads/2026/06/android-chrome-512x512-1-150x150.png</url>
	<title>nagios - Gagzen</title>
	<link>https://gagzen.net</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Fichier de configuration</title>
		<link>https://gagzen.net/2008/11/01/fichier-de-configuration/</link>
		
		<dc:creator><![CDATA[Baptiste]]></dc:creator>
		<pubDate>Sat, 01 Nov 2008 13:57:37 +0000</pubDate>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[script]]></category>
		<guid isPermaLink="false">http://www.gagneux.info/index.php/?p=63</guid>

					<description><![CDATA[<p>Le fichier de configuration. Le nom du fichier correspond à l&#8217;IP de la machine concernée. ./192.168.0.129.cfg service=mailserver 1 service=vmware-hostd 1 service=privoxy 1 service=mysqld 1 service=pure-ftpd 1 service=motion 1 service=ntpd 1 service=httpd 2 service=simpserver 1 session=xfree espace_disque= temperature= machine_virtuel=vmware-vmx 3</p>
<p>The post <a href="https://gagzen.net/2008/11/01/fichier-de-configuration/">Fichier de configuration</a> first appeared on <a href="https://gagzen.net">Gagzen</a>.</p>]]></description>
										<content:encoded><![CDATA[<div>
<p>Le fichier de configuration.</p>
<p>Le nom du fichier correspond à l&rsquo;IP de la machine concernée.</p>
</div>
<div>
<p><strong>./192.168.0.129.cfg</strong><br />
<code>service=mailserver 1<br />
service=vmware-hostd 1<br />
service=privoxy 1<br />
service=mysqld 1<br />
service=pure-ftpd 1<br />
service=motion 1<br />
service=ntpd 1<br />
service=httpd 2<br />
service=simpserver 1<br />
session=xfree<br />
espace_disque=<br />
temperature=<br />
machine_virtuel=vmware-vmx 3</code></p>
</div><p>The post <a href="https://gagzen.net/2008/11/01/fichier-de-configuration/">Fichier de configuration</a> first appeared on <a href="https://gagzen.net">Gagzen</a>.</p>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Nagios &#8211; check_service.sh</title>
		<link>https://gagzen.net/2008/11/01/nagios-check_service-sh/</link>
		
		<dc:creator><![CDATA[Baptiste]]></dc:creator>
		<pubDate>Sat, 01 Nov 2008 13:52:03 +0000</pubDate>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[script]]></category>
		<guid isPermaLink="false">http://www.gagneux.info/index.php/?p=55</guid>

					<description><![CDATA[<p>Un petit script qui permet de surveiller la présence (ou non) d&#8217;un process sous Linux. Le fichier paramètre ressemble à celui-ci. check_services.sh #!/bin/sh # # Check de daemon # # utilisation : #  sh ./check_service.sh [ADRESSE_MACHINE] # # Necessaire : # fichier parametre nomme [ADRESSE_MACHINE].cfg # ####################### # VARIABLES       # ####################### ADRESSE_MACHINE=$1 CONF_FILE="/srv/scripts/$ADRESSE_MACHINE.cfg" TMP_FILE="/tmp/service_$ADRESSE_MACHINE.tmp" UTILISATEUR_LINUX=`whoami` [&#8230;]</p>
<p>The post <a href="https://gagzen.net/2008/11/01/nagios-check_service-sh/">Nagios – check_service.sh</a> first appeared on <a href="https://gagzen.net">Gagzen</a>.</p>]]></description>
										<content:encoded><![CDATA[<div>
<p>Un petit script qui permet de surveiller la présence (ou non) d&rsquo;un process sous Linux.</p>
<p>Le fichier paramètre ressemble à <a title="Fichier de configuration" hreflang="fr" href="http://www.gagneux.info/fichier-de-configuration">celui-ci</a>.</p>
<p><span id="more-236"></span></p>
<p><strong>check_services.sh</strong></p>
</div>
<pre>#!/bin/sh
#
# Check de daemon
#
# utilisation :
#  sh ./check_service.sh [ADRESSE_MACHINE]
#
# Necessaire :
# fichier parametre nomme [ADRESSE_MACHINE].cfg
#
#######################
# VARIABLES       #
#######################
ADRESSE_MACHINE=$1
CONF_FILE="/srv/scripts/$ADRESSE_MACHINE.cfg"
TMP_FILE="/tmp/service_$ADRESSE_MACHINE.tmp"
UTILISATEUR_LINUX=`whoami`
EXIT_I=0
MSG_TEXT=""
EXIT_CODE="0"
SERVICE_MAX="0"
SERVICE=""
NB_PROCESS=""
PROCESS_ERREUR="0"
#######################
# Avant de commencer, on verifie la  #
# presence du fichier de configuration #
#et les paramètres #
#######################
if [ ! -e "$CONF_FILE" ] ; then
echo "--- Fichier de configuration $CONF_FILE : Absent. ---"
EXIT_CODE="3"
exit $EXIT_CODE
fi
if [ ! "$1" ] ; then
echo "--- Parametre manquant ---"
EXIT_CODE="3"
exit $EXIT_CODE
fi
ssh nagios@$ADRESSE_MACHINE ps -e &gt; $TMP_FILE
while read aLine ;do
LIGNE_SERVICE=`echo $aLine | grep "service=" |sed "s/service=//g"`
SERVICE=`echo $LIGNE_SERVICE | cut -d " " -f1`
PROCESS=`echo $LIGNE_SERVICE | cut -d " " -f2`
if [ "$SERVICE" != "" ] ; then
SERVICE_MAX=$((SERVICE_MAX+1))
NB_PROCESS=`grep -c -i $SERVICE $TMP_FILE`
fi
case $PROCESS in
0)
if [ "$NB_PROCESS" != "0" ] ; then
MSG_TEXT=$MSG_TEXT"\n\r$NB_PROCESS/0 $SERVICE"
PROCESS_ERREUR=$((PROCESS_ERREUR+1))
fi;;
1)
if [ "$NB_PROCESS" != "1" ] ; then
MSG_TEXT=$MSG_TEXT"\n\r$NB_PROCESS/1 $SERVICE"
PROCESS_ERREUR=$((PROCESS_ERREUR+1))
fi;;
2)
if [ "$NB_PROCESS" == "0" ] || [ "$NB_PROCESS" == "1" ] ; then
MSG_TEXT=$MSG_TEXT"\n\r$NB_PROCESS/X $SERVICE"
PROCESS_ERREUR=$((PROCESS_ERREUR+1))
fi;;
esac
SERVICE=""
NB_PROCESS=""
done &lt; $CONF_FILE
if [ "$PROCESS_ERREUR" != "0" ] ; then
MSG_TEXT="$PROCESS_ERREUR / $SERVICE_MAX Process KO : "$MSG_TEXT
EXIT_CODE="2"
else
MSG_TEXT="$SERVICE_MAX Process OK"
EXIT_CODE="0"
fi
#rm $TMP_FILE
echo $MSG_TEXT | sed -e 's#\\n\\r#&lt;br&gt;#'
echo -e $MSG_TEXT
exit $EXIT_CODE</pre><p>The post <a href="https://gagzen.net/2008/11/01/nagios-check_service-sh/">Nagios – check_service.sh</a> first appeared on <a href="https://gagzen.net">Gagzen</a>.</p>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
