* * *
Benvenuto! Effettua l'accesso oppure registrati.
Hai perso l'e-mail di attivazione?
27 Marzo 2017, 14:31:59

Inserisci il nome utente, la password e la durata della sessione.

Links

ads

Supporta il Forum per 2017

Supporta anche tu CentOS-Italia.org in maniera del tutto gratuita.

Semplicemente accedendo ad Amazon con Link questo  quando effettui un acquisto , una piccola percentuale viene data a CentOS-Italia.org , 

consentendoci cosi di tenere online il forum e viva la comunità italiana.

Salva il Link nei bookmark https://www.amazon.it/?tag=centositalia-21

Grazie a tutti del supporto

Buon CentOS 

leggi di più

Benvenuto


Benvenuto su la Community CentOS-Italia.Org

La Community Italiana di Linux CentOS e' lieta di averti tra noi , CentOS-Italia.Org e' un risorsa di guide e forum dal principiante al sistemista senior.
Clicca qua per registrati ora

La registrazione e' gratuita e ti consente di avere pieno accesso alle risorse di CentOS-Italia.org , come uso della ricerca avanzata , le funzioni interattive del portale e visualizzare i links nei post.
Gli utenti registrati non visualizzano gli ads, quindi registrati subito se non l'hai gia fatto.

Lo staff di CentOS-Italia.Org cerca di rendere la community un posto piacevole e il piu' produttivo possibile, invitiamo quindi i nuovi utenti a leggere le regole base.
Per info o problemi di registrazione scrivere a centos (at) centos-italia.org .
Dopo avere installato Nagios 2.10 con la guida della parte 1 procediamo ora a alcune personalizzazioni.<br /> Di Default con la parte 1 della guida vengono installati i plugin per PING,Current Load,Current Users,Root Partition e Total Processes .<br /> Vediamo ora come aggiungere qualche plugin, i plugin installati si trovano in /usr/lib64/nagios/plugins ( o per sistemi 32 bit /usr/lib/nagios/plugins )<br /> <br /> Supponiamo che vogliamo aggiungere gli utili plugins per http,ftp e smtp , andiamo cosi a editare il file localhost.cfg<br /> <br /> <div class="codeheader">Codice:</div> <div class="code"> <pre style="margin-top: 0pt; display: inline;">vi /etc/nagios/localhost.cfg</pre> </div> <br /> nella sezione # Define a service to check the load on the local machine , aggiungiamo:<br /> <br /> define service{<br /> use local-service ; Name of service template to use<br /> host_name localhost<br /> service_description Http<br /> check_command check_http<br /> }<br /> <br /> define service{<br /> use local-service ; Name of service template to use<br /> host_name localhost<br /> service_description Ftp<br /> check_command check_ftp<br /> }<br /> <br /> define service{<br /> use local-service ; Name of service template to use<br /> host_name localhost<br /> service_description Smtp<br /> check_command check_smtp<br /> }<br /> <br /> Questi plugin hanno gia definito il check_command nel file /etc/nagios/command.cfg , quindi non e'neccessaria nessuna altra configurazione. <br /> Vediamo ora invece la configurazione di un plugin che non e' presente nel command.cfg , esempio vedremo check_ssh.<br /> <br /> Andiamo ad aprire il file commands.cfg<br /> <br /> Codice: <div class="code"> <pre style="margin-top: 0pt; display: inline;">vi /etc/nagios/commands.cfg</pre> </div> <br /> visto che il comando check_ssh non e' definito dobbiamo aggiungerlo noi , trovate la sezione :<br /> <br /> ################################################################################<br /> <br /> # NOTE:&nbsp; The following 'check_...' commands are used to monitor services on<br /> <br /> #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; both local and remote hosts.<br /> <br /> ################################################################################<br /> <br /> e aggiungiamo:<br /> <br /> # 'check_ssh' command definition<br /> define command{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_name&nbsp;&nbsp;&nbsp; check_ssh<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_line&nbsp;&nbsp;&nbsp; $USER1$/check_ssh -H $HOSTADDRESS$<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /> <br /> salviamo il file , e come per i plugin precedenti andiamo a editare /etc/nagios/localhost.cfg<br /> <br /> troviamo la sezione :<br /> <br /> # Define a service to check the load on the local machine. <br /> <br /> e aggiungiamo:<br /> <br /> define service{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local-service&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Name of service template to use<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; host_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; service_description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Check ssh<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check_command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check_ssh<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /> <br /> Ogni volta che inseriamo un plugin e' buona norma prima testarlo in 2 modi , per prima cosa andiamo a vedere se esecuzione del plugin<br /> crea problemi , spostiamoci nella directory dei plugins per CentOS 5.1 64bit /usr/lib64/nagios/plugins ) e eseguiamo lo script :<br /> <br /> Codice: <div class="code"> <pre style="margin-top: 0pt; display: inline;">./check_ssh -H 127.0.0.1</pre> </div> <br /> se avremo una risposta simile tutto e' ok :<br /> <br /> [root@centos plugins]# ./check_ssh -H 127.0.0.1<br /> SSH OK - OpenSSH_4.3 (protocol 2.0)<br /> <br /> secondo passo e' simulare nagios.cfg :<br /> <br /> Codice: <div class="code"> <pre style="margin-top: 0pt; display: inline;">nagios -v nagios.cfg</pre> </div> <br /> questo e' un esempio di risposta positiva :<br /> <br /> [root@centos nagios]# nagios -v nagios.cfg<br /> Nagios 2.10<br /> Copyright (c) 1999-2007 Ethan Galstad (http://www.nagios.org)<br /> Last Modified: 10-21-2007<br /> License: GPL<br /> Reading configuration data...<br /> Running pre-flight check on configuration data...<br /> Checking services...<br /> Checked 10 services.<br /> Checking hosts...<br /> Checked 1 hosts.<br /> Checking host groups...<br /> Checked 1 host groups.<br /> Checking service groups...<br /> Checked 0 service groups.<br /> Checking contacts...<br /> Checked 1 contacts.<br /> Checking contact groups...<br /> Checked 1 contact groups.<br /> Checking service escalations...<br /> Checked 0 service escalations.<br /> Checking service dependencies...<br /> Checked 0 service dependencies.<br /> Checking host escalations...<br /> Checked 0 host escalations.<br /> Checking host dependencies...<br /> Checked 0 host dependencies.<br /> Checking commands...<br /> Checked 24 commands.<br /> Checking time periods...<br /> Checked 4 time periods.<br /> Checking extended host info definitions...<br /> Checked 0 extended host info definitions.<br /> Checking extended service info definitions...<br /> Checked 0 extended service info definitions.<br /> Checking for circular paths between hosts...<br /> Checking for circular host and service dependencies...<br /> Checking global event handlers...<br /> Checking obsessive compulsive processor commands...<br /> Checking misc settings...<br /> Total Warnings: 0<br /> Total Errors:&nbsp;&nbsp; 0<br /> Things look okay - No serious problems were detected during the pre-flight check<br /> <br /> <br /> Se questi 2 test sono positivi siamo pronti er rendere effettive le modifiche e riavviare nagios.<br /> <br /> <div class="codeheader">Codice:</div> <div class="code"> <pre style="margin-top: 0pt; display: inline;">service nagios restartamp</pre> </div> <br /> Ora se puntiamo nagios ( http:IPDELSERVER/nagios/ ) vedremo i plugin inseriti ( servono circa 5 minuti per poterli visualizzare la prima volta ) .<br /> Un altro plugin di uso comune e' check_mysql anche lui non definito nel commands.cfg , quindi come per il plugin check_ssh andiamo a editare il commands.cfg<br /> <br /> <div class="codeheader">Codice:</div> <div class="code"> <pre style="margin-top: 0pt; display: inline;">vi /etc/nagios/commands.cfg</pre> </div> <br /> e aggiungiamo<br /> <br /> # 'check_mysql' command definition<br /> define command{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_name&nbsp;&nbsp;&nbsp;&nbsp; check_mysql<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; command_line&nbsp;&nbsp;&nbsp;&nbsp; $USER1$/check_mysql<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /> <br /> proseguiamo poi editando il /etc/nagios/localhost.cfg aggiungendo :<br /> <br /> define service{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; use&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local-service&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Name of service template to use<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; host_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; localhost<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; service_description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Check mysql<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check_command&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; check_mysql<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br /> <br /> Chiaramente questi sono solo opzioni base , Nagios e' abbastanza complesso per una maggiore personalizzazione vi rimando alla documentazione di nagios <br /> consultabile dal interfaccia web di nagios su http://IPDELSERVER/nagios/docs/toc.html , oppure scaricate la documentazione completa in <a href="http://nagios.sourceforge.net/docs/nagios-2.pdf">pdf</a> .<br /> Per accedere invece all help dei plugin digitiamo :<br /> <br /> ./check_nomeplugin --help<br /> esempio:<br /> Codice:<br /> <div class="code"><br /> <pre style="margin-top: 0pt; display: inline;">[root@centos plugins]# ./check_http --help<br /><br />check_http v1861 (nagios-plugins 1.4.11)<br /><br />Copyright (c) 1999 Ethan Galstad &lt;nagios@nagios.org&gt;<br /><br />Copyright (c) 1999-2006 Nagios Plugin Development Team<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;nagiosplug-devel@lists.sourceforge.net&gt;<br /><br /><br /><br />This plugin tests the HTTP service on the specified host. It can test<br /><br />normal (http) and secure (https) servers, follow redirects, search for<br /><br />strings and regular expressions, check connection times, and report on<br /><br />certificate expiration times.<br /><br /><br /><br /><br /><br />Usage: check_http -H &lt;vhost&gt; | -I &lt;IP-address&gt; [-u &lt;uri&gt;] [-p &lt;port&gt;]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-w &lt;warn time&gt;] [-c &lt;critical time&gt;] [-t &lt;timeout&gt;] [-L]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-a auth] [-f &lt;ok | warn | critcal | follow&gt;] [-e &lt;expect&gt;]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-s string] [-l] [-r &lt;regex&gt; | -R &lt;case-insensitive regex&gt;] [-P string]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-m &lt;min_pg_size&gt;:&lt;max_pg_size&gt;] [-4|-6] [-N] [-M &lt;age&gt;] [-A string]<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [-k string] [-S] [-C &lt;age&gt;] [-T &lt;content-type&gt;]<br /><br />NOTE: One or both of -H and -I must be specified<br /><br /><br /><br />Options:<br /><br />&nbsp;-h, --help<br /><br />&nbsp;&nbsp;&nbsp; Print detailed help screen<br /><br />&nbsp;-V, --version<br /><br />&nbsp;&nbsp;&nbsp; Print version information<br /><br />&nbsp;-H, --hostname=ADDRESS<br /><br />&nbsp;&nbsp;&nbsp; Host name argument for servers using host headers (virtual host)<br /><br />&nbsp;&nbsp;&nbsp; Append a port to include it in the header (eg: example.com:5000)<br /><br />&nbsp;-I, --IP-address=ADDRESS<br /><br />&nbsp;&nbsp;&nbsp; IP address or name (use numeric address if possible to bypass DNS lookup).<br /><br />&nbsp;-p, --port=INTEGER<br /><br />&nbsp;Port number (default: 80)<br /><br />&nbsp;-4, --use-ipv4<br /><br />&nbsp;&nbsp;&nbsp; Use IPv4 connection<br /><br />&nbsp;-6, --use-ipv6<br /><br />&nbsp;&nbsp;&nbsp; Use IPv6 connection<br /><br />&nbsp;-S, --ssl<br /><br />&nbsp;&nbsp; Connect via SSL. Port defaults to 443<br /><br />&nbsp;-C, --certificate=INTEGER<br /><br />&nbsp;&nbsp; Minimum number of days a certificate has to be valid. Port defaults to 443<br /><br />&nbsp;&nbsp; (when this option is used the url is not checked.)<br /><br /><br /><br />&nbsp;-e, --expect=STRING<br /><br />&nbsp;&nbsp;&nbsp; String to expect in first (status) line of server response (default: <br /><br />HTTP/1.)<br /><br />&nbsp;&nbsp;&nbsp; If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)<br /><br />&nbsp;-s, --string=STRING<br /><br />&nbsp;&nbsp;&nbsp; String to expect in the content<br /><br />&nbsp;-u, --url=PATH<br /><br />&nbsp;&nbsp;&nbsp; URL to GET or POST (default: /)<br /><br />&nbsp;-P, --post=STRING<br /><br />&nbsp;&nbsp;&nbsp; URL encoded http POST data<br /><br />&nbsp;-N, --no-body<br /><br />&nbsp;&nbsp;&nbsp; Don't wait for document body: stop reading after headers.<br /><br />&nbsp;&nbsp;&nbsp; (Note that this still does an HTTP GET or POST, not a HEAD.)<br /><br />&nbsp;-M, --max-age=SECONDS<br /><br />&nbsp;&nbsp;&nbsp; Warn if document is more than SECONDS old. the number can also be of<br /><br />&nbsp;&nbsp;&nbsp; the form &quot;10m&quot; for minutes, &quot;10h&quot; for hours, or &quot;10d&quot; for days.<br /><br />&nbsp;-T, --content-type=STRING<br /><br />&nbsp;&nbsp;&nbsp; specify Content-Type header media type when POSTing<br /><br /><br /><br />&nbsp;-l, --linespan<br /><br />&nbsp;&nbsp;&nbsp; Allow regex to span newlines (must precede -r or -R)<br /><br />&nbsp;-r, --regex, --ereg=STRING<br /><br />&nbsp;&nbsp;&nbsp; Search page for regex STRING<br /><br />&nbsp;-R, --eregi=STRING<br /><br />&nbsp;&nbsp;&nbsp; Search page for case-insensitive regex STRING<br /><br />&nbsp;--invert-regex<br /><br />&nbsp;&nbsp;&nbsp; Return CRITICAL if found, OK if not<br /><br /><br /><br />&nbsp;-a, --authorization=AUTH_PAIR<br /><br />&nbsp;&nbsp;&nbsp; Username:password on sites with basic authentication<br /><br />&nbsp;-A, --useragent=STRING<br /><br />&nbsp;&nbsp;&nbsp; String to be sent in http header as &quot;User Agent&quot;<br /><br />&nbsp;-k, --header=STRING<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; Any other tags to be sent in http header. Use multiple times for additional headers<br /><br />&nbsp;-L, --link<br /><br />&nbsp;&nbsp;&nbsp; Wrap output in HTML link (obsoleted by urlize)<br /><br />&nbsp;-f, --onredirect=&lt;ok|warning|critical|follow&gt;<br /><br />&nbsp;&nbsp;&nbsp; How to handle redirected pages<br /><br />&nbsp;-m, --pagesize=INTEGER&lt;:INTEGER&gt;<br /><br />&nbsp;&nbsp;&nbsp; Minimum page size required (bytes) : Maximum page size required (bytes)<br /><br />&nbsp;-w, --warning=DOUBLE<br /><br />&nbsp;&nbsp;&nbsp; Response time to result in warning status (seconds)<br /><br />&nbsp;-c, --critical=DOUBLE<br /><br />&nbsp;&nbsp;&nbsp; Response time to result in critical status (seconds)<br /><br />&nbsp;-t, --timeout=INTEGER<br /><br />&nbsp;&nbsp;&nbsp; Seconds before connection times out (default: 10)<br /><br />&nbsp;-v, --verbose<br /><br />&nbsp;&nbsp;&nbsp; Show details for command-line debugging (Nagios may truncate output)<br /><br />Notes: This plugin will attempt to open an HTTP connection with the host.<br /><br />&nbsp;Successful connects return STATE_OK, refusals and timeouts return STATE_CRITICAL<br /><br />&nbsp;other errors return STATE_UNKNOWN.&nbsp; Successful connects, but incorrect reponse<br /><br />&nbsp;messages from the host result in STATE_WARNING return values.&nbsp; If you are<br /><br />&nbsp;checking a virtual server that uses 'host headers' you must supply the FQDN<br /><br />&nbsp;(fully qualified domain name) as the [host_name] argument.<br /><br />&nbsp;This plugin can also check whether an SSL enabled web server is able to<br /><br />&nbsp;serve content (optionally within a specified time) or whether the X509 <br /><br />&nbsp;certificate is still valid for the specified number of days.<br /><br />Examples: CHECK CONTENT: check_http -w 5 -c 10 --ssl -H www.verisign.com<br /><br /><br /><br />&nbsp;When the 'www.verisign.com' server returns its content within 5 seconds,<br /><br />&nbsp;a STATE_OK will be returned. When the server returns its content but exceeds<br /><br />&nbsp;the 5-second threshold, a STATE_WARNING will be returned. When an error occurs,<br /><br />&nbsp;a STATE_CRITICAL will be returned.<br /><br /><br /><br />&nbsp;CHECK CERTIFICATE: check_http -H www.verisign.com -C 14<br /><br /><br /><br />&nbsp;When the certificate of 'www.verisign.com' is valid for more than 14 days,<br /><br />&nbsp;a STATE_OK is returned. When the certificate is still valid, but for less than<br /><br />&nbsp;14 days, a STATE_WARNING is returned. A STATE_CRITICAL will be returned when<br /><br />&nbsp;the certificate is expired.<br /><br /><br /><br /><br /><br />Send email to nagios-users@lists.sourceforge.net if you have questions<br /><br />regarding use of this software. To submit patches or suggest improvements,<br /><br />send email to nagiosplug-devel@lists.sourceforge.net<br /><br /><br /><br />regarding use of this software. To submit patches or suggest improvements,<br /><br /><br /><br /><br /><br /><br /><br />send email to nagiosplug-devel@lists.sourceforge.net&lt;\div&gt;<br /><br /><br /><br />Questa guida descrive solo alcune parti di nagios , la configurazione e le personalizzazioni per nagios sono tantissime , per queste<br /><br />vi lascio alla documentazione ufficiale e a gli help dei pugins .... e perche' no nel nostro forum :)) ....</pre> <br /> </div> <br /> Questa guida descrive solo alcune parti di nagios , la configurazione e le personalizzazioni per nagios sono tantissime , per queste vi lascio alla documentazione ufficiale e a gli help dei pugins .... e perche' no nel nostro forum :)) ....

Commenti *

I commenti per questo articolo sono stati disabilitati.

Notizie

Per un veloce Download di CentOS 6 http://mi.mirror.garr.it/mirrors/CentOS/6.4/isos/ Per una ricerca veloce su google linux http://www.google.it/linux

Collegamenti

Posts Recenti

Utenti
  • Utenti in totale: 6086
  • Ultimo: teo7512
Statistiche
  • Post in totale: 12524
  • Topic in totale: 2796
  • Online Oggi: 178
  • Massimi online: 536
  • (26 Luglio 2012, 11:06:17)
Utenti Online
Utenti: 0
Visitatori: 166
Totale: 166

Permessi

-no content-

ShoutBox!

Ultimo 5 Shout:

trattore

28 Settembre 2015, 03:30:48
ma qui non c'è mai nessuno
 ;)

ivo

26 Agosto 2015, 16:01:14
Ho configurato il DHCP creato il file /etc/dhcpd.conf con il seguente contenuto
-------------------------------------------------------------------------------
ddns-update-style interim;
ignore client-updates;

authoritative;

subnet 172.16.208.96 netmask 255.255.255.240 {
    option routers      
 

ifconfig

03 Aprile 2015, 19:02:35
NON REGISTRATEVI CON EMAIL HOTMAIL/LIVE/OUTLOOK SPESSO NON ARRIVANO LE MAIL

Mostra ultimi 50