Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Próxima revisión
Revisión previa
munin_alto_trafico [2024/05/28 16:13] – creado - editor externo 127.0.0.1munin_alto_trafico [2024/06/19 13:54] (actual) – [Referencias] kasandra
Línea 22: Línea 22:
 ==== 1. Munin CGI -  Generación dinámica de gráficas bajo demanda. ==== ==== 1. Munin CGI -  Generación dinámica de gráficas bajo demanda. ====
  
-Munin usualmente genera las graficas con su cron de actualización. Esto con un gran número de datos es insostenible, entonces es mejor generar las graficas SOLO bajo demanda.\\ +Munin usualmente genera las graficas con su cron de actualización. Esto con un gran número de datos es insostenible, entonces es mejor generar las graficas SOLO bajo demanda.
-\\ +
-Los pasos son\\+
  
 +Los pasos son
  
-  Cambie la configuracion de munin.conf a que tenga\\ +  *  Cambie la configuracion de munin.conf a que tenga 
-html_strategy cgi graph_strategy cgi\\ +  *  html_strategy cgi graph_strategy cgi 
-Las recomendaciones son: +  *  Las recomendaciones son: 
-  Cambie la configuracion de apache para que haga uso del cgi.  (Anexo archivo de Debian) +  *  Cambie la configuracion de apache para que haga uso del cgi.  (Anexo archivo de Debian) 
-  Tuve algunos problemas con la actualizacion de html entonces se puso un cron diario para actualizar los html  (/etc/cron.d/munin) \\ +  *  Tuve algunos problemas con la actualizacion de html entonces se puso un cron diario para actualizar los html  (/etc/cron.d/munin)  
-20  10_consejos_para_la_resolucion_de_problemas.html acta_de_constitucion_interna_del_proyecto.html active_directory.html administrar_servidores_con_ipmi.html admin_rpms_con_yum.html albasoftware_libre_de_gestion_educativa.html alta_disponibilidad_de_conexion_a_internet.html ansible_administracion_centralizada_de_servidores.html anti_virusanti_spam_y_hardening_de_correo2024.html anti_virusanti_spam_y_hardening_de_correo.html apache2_mod_security.html apacheservidor_de_www.html aplicativos_usando_ldap.html autoconf.html aws_amazon_ec2.html aws_amazon_lambda.html bacula_backup2024.html bacula_backup.html bandwidthd.html bind_dns.html bonding.html cacti.html cambio_contrasena_ldap_ad_por_web.html cambios_recientes.html caracteres_octal_hexa_unicode_html.html centos_sobre_hyperv.html cfengine.html chumne_administrador_de_licencias.html ciclo_de_pruebas_orfeo.html cluster_con_haproxy.html cluster_ldap.html colaborador_del_mes.html comision_de_proyectos_obsoleto.html como_desplegar_remoto_con_un_tunel_ssh.html como_hacer_manual_de_funciones.html como_instalar_spoon.html como_limpiar_cache_dns.html como_publicar_docs.html como_reportar_spam.html como_se_implementa_orfeo_sgd.html compensatorios_obsoleto.html condiciones_generales_de_contrato_de_soporte_v14.html configuracion_de_tomcat_como_modulo_de_apache.html configuracion_de_x_lite_cliente_sip.html configuracion_pidgin.html configuracion_planta_telefonica_voip.html configurar_redes.html consola_serial.html consul_open_participation_ruby.html controlador_de_dominio_secundario_samba4.html convertir_pdf_a_a_pdf_plano.html copiar_disco_por_la_red.html cpanel.html crack_de_wep_con_aircrack_ng.html creacion_servidor_codema.html creacion_usuario_postgres_solo_para_consultas.html crear_instalador_de_windows_facil_con_nsis.html crear_instancias_de_orfeong.html crear_paquetes_deb_y_rpm.html crear_repositorios_de_paquetes_deb_y_rpm.html cuestionario_de_severidad.html cups.html cygwn.html dd_wrt.html declaracion_de_trabajo_sow.html deploy_instancia_de_orfeo_express_5x_en_amazon.html deploy_instancia_de_orfeo_express_6x_en_amazon.html descargar_pagina_web_recursivo.html deshabilite_ipv6.html dhcp_multiples_vlans.html dhcp_server.html dhcp_y_dns_dinamico.html directrices_de_manejo_de_tiquetes_en_mesa_de_ayuda_glpi.html docker.html documentacion_de_codigo.html documentos_de_implementacion_de_orfeo_5x.html documentos_estandar_control_proyectos_desarrollo.html dotproject.html drbd.html drp_plan_de_recuperacion_de_desastres.html dsl_personalizacion.html egroupware_ex_phpgw.html ejabberd.html elastix.html enigmail.html enlightenment.html entidad_de_certificacion_a_mano.html entidad_de_certificacion.html entidad_de_certificacion_openca.html envio_y_recepcion_de_fax_en_asterisk.html errores_modelos.html esquema_backup_ikatta.html estandar_bitacora.html estandar_comunicaciones_por_correo_electronico.html estandar_de_archivos_y_directorios.html estandar_de_interfaz_para_proyectos_de_desarrollo.html estandar_de_manejo_de_cronograma.html estandar_de_revision_de_documentos.html estandar_de_soporte_y_mantenimiento_de_skinatech.html estandares_de_comunicacion_de_soporte.html estandar_estacion_de_trabajo_gnu_linux.html estandar_estacion_de_trabajo_ms_windows.html estandar_firma_skina.html estandar_para_interfaz_de_proyectos_de_desarrollo.html estandar_para_la_creacion_de_bases_de_dato.html example_howto.html exim_mta.html extraccion_de_texto_de_documentos.html fail2ban.html falla_laboral.html fax_server.html fink.html firewalld.html firewall_skina_howto.html flujo_de_trabajo_de_proyecto.html flujo_de_trabajo_de_proyecto_trello.html formatos_de_documentos_estandares_de_skinatech.html freenas.html freenx.html freetds.html ftpproxy.html generar_diccionarios_de_datos_en_workbench.html getfacl_y_setfacl.html getmenu2.html gforge.html git_flow.html git.html gitlab.html glassfish.html glpi10.html glpi95.html gnokii.html gnupg_gpg.html google_cloud_platform.html graylog_consolidador_de_bitacoras.html grub.html hacer_modelo_y_o_backup.html hardening_de_linux.html hearbeat_cluster.html hipergate.html hispaniola_firewall_ikatta.html horario_de_trabajo.html how_to_enviar_html_imagenes_con_php5.html howto.html howto_mon.html howto_php_nuke.html huawei_e220.html ibm_aix_snmp_setup_for_nagios.html ibm_db2.html ids_logchecklogwatchtripwireaideetc.html ilo2_e_ilo3.html implementacion_de_oauth2_google_en_orfeo_ng.html implementacion_de_oauth2_microsoft_en_orfeo_ng.html implementacion_glpi.html indicadores_de_gestion.html informes_semanales.html informix_apache_php.html infraestructura_de_operacion.html instalacion_asterisk_en_centos_53.html instalacion_asterisk_en_.html instalacion_de_modelo_de_servidor_con_minilinux.html instalacion_de_modelo_de_servidor.html instalacion_de_pqrs_en_orfeo_sgd.html instalacion_ldap_smb_34_en_debian_lenny.html instalacion_minima_appliance.html instalacion_mi­nima.html instalacion_r_server_&_r_shiny.html instalacion_r_server_&_r_shiny_server.html instalacion_splunk.html instalacion_y_configuracion_apachephp_con_db2_y_soporte_con_odbc.html instalacion_y_configuracion_de_sphinx_para_orfeo.html instalacion_y_configuracion_gatekeeper_h323.html instalacion_y_configuracion_lotus_domino.html instalacion_zimbra.html instalar_cancelador_de_eco_hpec_en_asterisk.html instructivo_de_demos_de_skinatech.html instructivo_formato_de_diagnostico.html ipcop_firewall.html ipsec.html ipsec_zeroshell.html iptables.html iscsi.html ispconfig_v1.html ispconfig_v3.html iwatch_inotifywatch_notificar_eventos_en_carpetas.html jmeter.html joomla_cms.html kernel_compilar.html kuine_administracion_de_licencias.html kuine_generacion_de_licencias.html libchart.html licencia_por_calamidad_domestica.html linux_livecd.html lista_de_mejoras.html locale.html lvm.html lvs_linux_virtual_server.html mailman.html mailscanner.html manejo_de_certificados_integracion_pki.html manejo_de_firma_digital_en_php.html manejo_de_la_cuenta_de_correo_de_soporte.html manejo_de_mi_cuenta_de_correo_electronico.html manejo_de_recursos_egroupware_18.html mantis_bug_tracker.html manual_de_funciones_de_agente_de_soporte.html manual_de_funciones_de_consultor_de_tecnologia.html manual_de_telefonos.html manual_de_uso_asterisk.html manual_de_uso_fastrix.html manuales_de_funciones_area_administrativa.html manuales_de_funciones_area_tecnica.html maya_render_farm.html mdadm.html mejorar_rendimiento_libre_office.html metodologia_estandar_de_control_de_proyectos.html metodologia_estandar_de_control_de_proyectos_orfeo.html metodologia_para_desarrollo_de_software.html migracion_bacula_de_5_a_7.html migracion_orfeo_5_a_6.html migrando_samba3_a_samba4.html modelo_appliance.html modelo_de_procedimientos.html modelo_para_howtos.html modelo_para_propuesta.html monit.html montar_bucket_s3_amazon_y_oracle.html montar_orfeo_en_iis.html moodle.html ms_windows_en_linux_wine.html multi_factor_authentication_mfa.html multipath_conexion_con_san.html multiple_versiones_de_php.html multi_router_trafic_grapher_mrtg.html munin_alto_trafico.html munin.html 10_consejos_para_la_resolucion_de_problemas.html acta_de_constitucion_interna_del_proyecto.html active_directory.html administrar_servidores_con_ipmi.html admin_rpms_con_yum.html albasoftware_libre_de_gestion_educativa.html alta_disponibilidad_de_conexion_a_internet.html ansible_administracion_centralizada_de_servidores.html anti_virusanti_spam_y_hardening_de_correo2024.html anti_virusanti_spam_y_hardening_de_correo.html apache2_mod_security.html apacheservidor_de_www.html aplicativos_usando_ldap.html autoconf.html aws_amazon_ec2.html aws_amazon_lambda.html bacula_backup2024.html bacula_backup.html bandwidthd.html bind_dns.html bonding.html cacti.html cambio_contrasena_ldap_ad_por_web.html cambios_recientes.html caracteres_octal_hexa_unicode_html.html centos_sobre_hyperv.html cfengine.html chumne_administrador_de_licencias.html ciclo_de_pruebas_orfeo.html cluster_con_haproxy.html cluster_ldap.html colaborador_del_mes.html comision_de_proyectos_obsoleto.html como_desplegar_remoto_con_un_tunel_ssh.html como_hacer_manual_de_funciones.html como_instalar_spoon.html como_limpiar_cache_dns.html como_publicar_docs.html como_reportar_spam.html como_se_implementa_orfeo_sgd.html compensatorios_obsoleto.html condiciones_generales_de_contrato_de_soporte_v14.html configuracion_de_tomcat_como_modulo_de_apache.html configuracion_de_x_lite_cliente_sip.html configuracion_pidgin.html configuracion_planta_telefonica_voip.html configurar_redes.html consola_serial.html consul_open_participation_ruby.html controlador_de_dominio_secundario_samba4.html convertir_pdf_a_a_pdf_plano.html copiar_disco_por_la_red.html cpanel.html crack_de_wep_con_aircrack_ng.html creacion_servidor_codema.html creacion_usuario_postgres_solo_para_consultas.html crear_instalador_de_windows_facil_con_nsis.html crear_instancias_de_orfeong.html crear_paquetes_deb_y_rpm.html crear_repositorios_de_paquetes_deb_y_rpm.html cuestionario_de_severidad.html cups.html cygwn.html dd_wrt.html declaracion_de_trabajo_sow.html deploy_instancia_de_orfeo_express_5x_en_amazon.html deploy_instancia_de_orfeo_express_6x_en_amazon.html descargar_pagina_web_recursivo.html deshabilite_ipv6.html dhcp_multiples_vlans.html dhcp_server.html dhcp_y_dns_dinamico.html directrices_de_manejo_de_tiquetes_en_mesa_de_ayuda_glpi.html docker.html documentacion_de_codigo.html documentos_de_implementacion_de_orfeo_5x.html documentos_estandar_control_proyectos_desarrollo.html dotproject.html drbd.html drp_plan_de_recuperacion_de_desastres.html dsl_personalizacion.html egroupware_ex_phpgw.html ejabberd.html elastix.html enigmail.html enlightenment.html entidad_de_certificacion_a_mano.html entidad_de_certificacion.html entidad_de_certificacion_openca.html envio_y_recepcion_de_fax_en_asterisk.html errores_modelos.html esquema_backup_ikatta.html estandar_bitacora.html estandar_comunicaciones_por_correo_electronico.html estandar_de_archivos_y_directorios.html estandar_de_interfaz_para_proyectos_de_desarrollo.html estandar_de_manejo_de_cronograma.html estandar_de_revision_de_documentos.html estandar_de_soporte_y_mantenimiento_de_skinatech.html estandares_de_comunicacion_de_soporte.html estandar_estacion_de_trabajo_gnu_linux.html estandar_estacion_de_trabajo_ms_windows.html estandar_firma_skina.html estandar_para_interfaz_de_proyectos_de_desarrollo.html estandar_para_la_creacion_de_bases_de_dato.html example_howto.html exim_mta.html extraccion_de_texto_de_documentos.html fail2ban.html falla_laboral.html fax_server.html fink.html firewalld.html firewall_skina_howto.html flujo_de_trabajo_de_proyecto.html flujo_de_trabajo_de_proyecto_trello.html formatos_de_documentos_estandares_de_skinatech.html freenas.html freenx.html freetds.html ftpproxy.html generar_diccionarios_de_datos_en_workbench.html getfacl_y_setfacl.html getmenu2.html gforge.html git_flow.html git.html gitlab.html glassfish.html glpi10.html glpi95.html gnokii.html gnupg_gpg.html google_cloud_platform.html graylog_consolidador_de_bitacoras.html grub.html hacer_modelo_y_o_backup.html hardening_de_linux.html hearbeat_cluster.html hipergate.html hispaniola_firewall_ikatta.html horario_de_trabajo.html how_to_enviar_html_imagenes_con_php5.html howto.html howto_mon.html howto_php_nuke.html huawei_e220.html ibm_aix_snmp_setup_for_nagios.html ibm_db2.html ids_logchecklogwatchtripwireaideetc.html ilo2_e_ilo3.html implementacion_de_oauth2_google_en_orfeo_ng.html implementacion_de_oauth2_microsoft_en_orfeo_ng.html implementacion_glpi.html indicadores_de_gestion.html informes_semanales.html informix_apache_php.html infraestructura_de_operacion.html instalacion_asterisk_en_centos_53.html instalacion_asterisk_en_.html instalacion_de_modelo_de_servidor_con_minilinux.html instalacion_de_modelo_de_servidor.html instalacion_de_pqrs_en_orfeo_sgd.html instalacion_ldap_smb_34_en_debian_lenny.html instalacion_minima_appliance.html instalacion_mi­nima.html instalacion_r_server_&_r_shiny.html instalacion_r_server_&_r_shiny_server.html instalacion_splunk.html instalacion_y_configuracion_apachephp_con_db2_y_soporte_con_odbc.html instalacion_y_configuracion_de_sphinx_para_orfeo.html instalacion_y_configuracion_gatekeeper_h323.html instalacion_y_configuracion_lotus_domino.html instalacion_zimbra.html instalar_cancelador_de_eco_hpec_en_asterisk.html instructivo_de_demos_de_skinatech.html instructivo_formato_de_diagnostico.html ipcop_firewall.html ipsec.html ipsec_zeroshell.html iptables.html iscsi.html ispconfig_v1.html ispconfig_v3.html iwatch_inotifywatch_notificar_eventos_en_carpetas.html jmeter.html joomla_cms.html kernel_compilar.html kuine_administracion_de_licencias.html kuine_generacion_de_licencias.html libchart.html licencia_por_calamidad_domestica.html linux_livecd.html lista_de_mejoras.html locale.html lvm.html lvs_linux_virtual_server.html mailman.html mailscanner.html manejo_de_certificados_integracion_pki.html manejo_de_firma_digital_en_php.html manejo_de_la_cuenta_de_correo_de_soporte.html manejo_de_mi_cuenta_de_correo_electronico.html manejo_de_recursos_egroupware_18.html mantis_bug_tracker.html manual_de_funciones_de_agente_de_soporte.html manual_de_funciones_de_consultor_de_tecnologia.html manual_de_telefonos.html manual_de_uso_asterisk.html manual_de_uso_fastrix.html manuales_de_funciones_area_administrativa.html manuales_de_funciones_area_tecnica.html maya_render_farm.html mdadm.html mejorar_rendimiento_libre_office.html metodologia_estandar_de_control_de_proyectos.html metodologia_estandar_de_control_de_proyectos_orfeo.html metodologia_para_desarrollo_de_software.html migracion_bacula_de_5_a_7.html migracion_orfeo_5_a_6.html migrando_samba3_a_samba4.html modelo_appliance.html modelo_de_procedimientos.html modelo_para_howtos.html modelo_para_propuesta.html monit.html montar_bucket_s3_amazon_y_oracle.html montar_orfeo_en_iis.html moodle.html ms_windows_en_linux_wine.html multi_factor_authentication_mfa.html multipath_conexion_con_san.html multiple_versiones_de_php.html multi_router_trafic_grapher_mrtg.html munin_alto_trafico.html munin.html *  munin  nice /usr/share/munin/munin-html  &> /dev/null+   20  * * *  munin  nice /usr/share/munin/munin-html  &> /dev/null
  
-\\ 
-OJO con los permisos .. todo lo que toque el cgi debe ser de apache (www-data) . .. como /var/log/munin/munin-cgi* o /var/lib/munin/cgi-tmp\\ 
-\\ 
-\\ 
-http:%%//%%munin-monitoring.org/wiki/MuninConfigurationMasterCGI\\ 
-\\ 
-http:%%//%%munin.readthedocs.org/en/latest/example/index.html 
  
 +OJO con los permisos .. todo lo que toque el cgi debe ser de apache (www-data) . .. como /var/log/munin/munin-cgi* o /var/lib/munin/cgi-tmp
 +
 +
 +http://munin-monitoring.org/wiki/MuninConfigurationMasterCGI
 +
 +http://munin.readthedocs.org/en/latest/example/index.html
 ==== 2. Munin Async ==== ==== 2. Munin Async ====
  
Línea 207: Línea 205:
 ---- ----
  
- \\ + 
-ANEXOS\\+ANEXOS
    
  
-==============================================================\\ + 
-001-default    configuracion apache  para munin-cgi\\+============================================================== 
 +001-default    configuracion apache  para munin-cgi
 ============================================================== ==============================================================
  
-<code> +<VirtualHost *:80> 
-<VirtualHost *:80># ServerName munin.example.org# ServerAlias munin <IfModule !mod_rewrite.c> # required because we serve out of the cgi directory and URLs are relative Alias /munin-cgi/munin-cgi-html/static /var/cache/munin/www/static RedirectMatch ^/$ /munin-cgi/munin-cgi-html/ </IfModule> <IfModule mod_rewrite.c> # Rewrite rules to serve traffic from the root instead of /munin-cgi RewriteEngine On # Static files RewriteRule ^/favicon.ico /var/cache/munin/www/static/favicon.ico [L] RewriteRule ^/static/(.*) /var/cache/munin/www/static/$1 [L] # HTML RewriteRule ^(/.*\\.html)?$ /munin-cgi/munin-cgi-html/$1 [PT] # Images RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /$1 RewriteCond %{REQUEST_URI} !^/static RewriteRule ^/(.*.png)$ /munin-cgi/munin-cgi-graph/$1 [L,PT] </IfModule> # Ensure we can run (fast)cgi scripts ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph <Location /munin-cgi/munin-cgi-graph> Options +ExecCGI <IfModule mod_fcgid.c> SetHandler fcgid-script </IfModule> <IfModule mod_fastcgi.c> SetHandler fastcgi-script </IfModule> <IfModule !mod_fastcgi.c> <IfModule !mod_fcgid.c> SetHandler cgi-script </IfModule> </IfModule> Allow from all       # Replace above with "Require all granted" if running apache 2.4    </Location>    ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html    <Location /munin-cgi/munin-cgi-html>        Options +ExecCGI        <IfModule mod_fcgid.c>            SetHandler fcgid-script        </IfModule>        <IfModule mod_fastcgi.c>            SetHandler fastcgi-script        </IfModule>        <IfModule !mod_fastcgi.c>            <IfModule !mod_fcgid.c>                SetHandler cgi-script            </IfModule>        </IfModule>        Allow from all       # Replace above with "Require all granted" if running apache 2.4    </Location>    <IfModule !mod_rewrite.c>        <Location /munin-cgi/munin-cgi-html/static>                # this needs to be at the end to override the above sethandler directives                Options -ExecCGI                SetHandler None        </Location>    </IfModule></VirtualHost> +   ServerName munin.example.org 
-</code>+   ServerAlias munin
  
- +    <IfModule !mod_rewrite.c> 
 +        # required because we serve out of the cgi directory and URLs are relative 
 +        Alias /munin-cgi/munin-cgi-html/static /var/cache/munin/www/static 
 +        RedirectMatch ^/$ /munin-cgi/munin-cgi-html/ 
 +    </IfModule>
  
-==============================================================\\ +    <IfModule mod_rewrite.c> 
-munin-node3    script de inicio en Debian\\+        # Rewrite rules to serve traffic from the root instead of /munin-cgi 
 +        RewriteEngine On 
 + 
 +        # Static files 
 +        RewriteRule ^/favicon.ico /var/cache/munin/www/static/favicon.ico [L] 
 +        RewriteRule ^/static/(.*) /var/cache/munin/www/static/$1          [L] 
 + 
 +        # HTML 
 +        RewriteRule ^(/.*\.html)?          /munin-cgi/munin-cgi-html/$1 [PT] 
 + 
 +        # Images 
 +        RewriteRule ^/munin-cgi/munin-cgi-graph/(.*) /$1 
 +        RewriteCond %{REQUEST_URI}                 !^/static 
 +        RewriteRule ^/(.*.png)$  /munin-cgi/munin-cgi-graph/$1 [L,PT] 
 +    </IfModule> 
 + 
 +    # Ensure we can run (fast)cgi scripts 
 +    ScriptAlias /munin-cgi/munin-cgi-graph /usr/lib/munin/cgi/munin-cgi-graph 
 +    <Location /munin-cgi/munin-cgi-graph> 
 +        Options +ExecCGI 
 +        <IfModule mod_fcgid.c> 
 +            SetHandler fcgid-script 
 +        </IfModule> 
 +        <IfModule mod_fastcgi.c> 
 +            SetHandler fastcgi-script 
 +        </IfModule> 
 +        <IfModule !mod_fastcgi.c> 
 +            <IfModule !mod_fcgid.c> 
 +                SetHandler cgi-script 
 +            </IfModule> 
 +        </IfModule> 
 +        Allow from all 
 +       # Replace above with "Require all granted" if running apache 2.4 
 +    </Location> 
 + 
 +    ScriptAlias /munin-cgi/munin-cgi-html /usr/lib/munin/cgi/munin-cgi-html 
 +    <Location /munin-cgi/munin-cgi-html> 
 +        Options +ExecCGI 
 +        <IfModule mod_fcgid.c> 
 +            SetHandler fcgid-script 
 +        </IfModule> 
 +        <IfModule mod_fastcgi.c> 
 +            SetHandler fastcgi-script 
 +        </IfModule> 
 +        <IfModule !mod_fastcgi.c> 
 +            <IfModule !mod_fcgid.c> 
 +                SetHandler cgi-script 
 +            </IfModule> 
 +        </IfModule> 
 +        Allow from all 
 +       # Replace above with "Require all granted" if running apache 2.4 
 +    </Location> 
 + 
 +    <IfModule !mod_rewrite.c> 
 +        <Location /munin-cgi/munin-cgi-html/static> 
 +                # this needs to be at the end to override the above sethandler directives 
 +                Options -ExecCGI 
 +                SetHandler None 
 +        </Location> 
 +    </IfModule> 
 +</VirtualHost> 
 + 
 +  
 +============================================================== 
 +munin-node3    script de inicio en Debian
 ============================================================== ==============================================================
  
-<code> +#! /bin/bash
-#! /bin/bash### BEGIN INIT INFO# Provides: munin-node3# Required-Start: $network $named $local_fs $remote_fs# Required-Stop: $network $named $local_fs $remote_fs# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Start/stop Munin-Node 3# Description: Start/stop Munin-Node 3### END INIT INFOPATH=/sbin:/bin:/usr/sbin:/usr/binDAEMON=/opt/munin3/sbin/munin-nodePIDFILE=/opt/munin3/var/run/munin-node.pidCONFFILE=/opt/munin3/etc/munin-node.confDAEMON_ARGS="--config $CONFFILE". /lib/lsb/init-functions[ -r /etc/default/munin-node ] && . /etc/default/munin-nodeif [ ! -x $DAEMON ]; then log_failure_msg "Munin-Node3 appears to be uninstalled." exit 5elif [ ! -e $CONFFILE ]; then# log_failure_msg "Munin-Node3 appears to be unconfigured." exit 6fi# Figure out if the pid file is in a non-standard locationwhile read line; do line=${line%%\\#*} # get rid of comments set -f line=$(echo $line) # get rid of extraneous blanks set +f if [ "$line" != "${line#pid_file }" ]; then PIDFILE=${line#pid_file } fidone < $CONFFILEverify_superuser() { action=$1 [ $EUID -eq 0 ] && return log_failure_msg "Superuser privileges required for the" \\ "\\"$action\\" action." exit 4}start() { log_daemon_msg "Starting Munin-Node3" mkdir -p /opt/munin3/var/run /opt/munin3/log chown munin:root /opt/munin3/var/run chown munin:www-data /opt/munin3/log chmod 0755 /opt/munin3/var/run chmod 0755 /opt/munin3/log if pidofproc -p $PIDFILE $DAEMON >/dev/null; then log_progress_msg "started beforehand" log_end_msg 0 exit 0 fi start_daemon -p $PIDFILE $DAEMON $DAEMON_ARGS# /usr/sbin/munin-node3 --config /etc/munin3/munin-node.conf ret=$? # start_daemon() isn't thorough enough, ensure the daemon has been # started manually attempts=0 until pidofproc -p $PIDFILE $DAEMON >/dev/null; do attempts=$(( $attempts + 1 )) sleep 0.05 [ $attempts -lt 20 ] && continue log_end_msg 1 return 1 done [ $ret -eq 0 ] && log_progress_msg "done" log_end_msg $ret return $ret}stop() { log_daemon_msg "Stopping Munin-Node3" # killproc() doesn't try hard enough if the pid file is missing, # so create it is gone and the daemon is still running if [ ! -r $PIDFILE ]; then pid=$(pidofproc -p $PIDFILE $DAEMON) if [ -z "$pid" ]; then log_progress_msg "stopped beforehand" log_end_msg 0 return 0 fi echo $pid 2>/dev/null > $PIDFILE if [ $? -ne 0 ]; then log_end_msg 1 return 1 fi fi killproc -p $PIDFILE /opt/munin3/sbin/munin-node ret=$? # killproc() isn't thorough enough, ensure the daemon has been # stopped manually attempts=0 until ! pidofproc -p $PIDFILE $DAEMON >/dev/null; do attempts=$(( $attempts + 1 )) sleep 0.05 [ $attempts -lt 20 ] && continue log_end_msg 1 return 1 done [ $ret -eq 0 ] && log_progress_msg "done" log_end_msg $ret return $ret}if [ "$#" -ne 1 ]; then log_failure_msg "Usage: /etc/init.d/munin-node3" \\ "{start|stop|restart|force-reload|try-restart}" exit 2ficase "$1" in start) verify_superuser $1 start exit $? ;; stop) verify_superuser $1 stop exit $? ;; restart|force-reload) verify_superuser $1 stop || exit $? start exit $? ;; try-restart) verify_superuser $1 pidofproc -p $PIDFILE $DAEMON >/dev/null if [ $? -eq 0 ]; then stop || exit $? start exit $? fi log_success_msg "Munin-Node3 was stopped beforehand and thus not" \\ "restarted." exit 0 ;; reload) log_failure_msg "The \\"reload\\" action is not implemented." exit 3 ;; status) pid=$(pidofproc -p $PIDFILE $DAEMON) ret=$? pid=${pid% } # pidofproc() supplies a trailing space, strip it if [ $ret -eq 0 ]; then log_success_msg "Munin-Node3 is running (PID: $pid)" exit 0 # the LSB specifies that I in this case (daemon dead + pid file exists) # should return 1, however lsb-base returned 2 in this case up to and # including version 3.1-10 (cf. #381684). Since that bug is present # in Sarge, Ubuntu Dapper, and (at the time of writing) Ubuntu Etch, # and taking into account that later versions of pidofproc() do not # under any circumstance return 2, I'll keep understanding invalid # return code for the time being, even though the LSB specifies it is # to be used for the situation where the "program is dead and /var/lock # lock file exists" elif [ $ret -eq 1 ] || [ $ret -eq 2 ]; then log_failure_msg "Munin-Node3 is dead, although $PIDFILE exists." exit 1 elif [ $ret -eq 3 ]; then log_warning_msg "Munin-Node3 is not running." exit 3 fi log_warning_msg "Munin-Node3 status unknown." exit 4 ;; *) log_failure_msg "Usage: /etc/init.d/munin-node3" \\ "{start|stop|restart|force-reload|try-restart}" exit 2 ;;esaclog_failure_msg "Unexpected failure, please file a bug."exit 1==============================================================munin-async3    script de inicio en Debian============================================================== +
-</code>+
  
-<code> +### BEGIN INIT INFO 
-#! /bin/sh### BEGIN INIT INFO# Provides: munin-async3# Required-Start: $network $named $local_fs $remote_fs munin-node# Required-Stop: $network $named $local_fs $remote_fs munin-node# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Munin asynchronous server 3# Description: Asynchronous munin node 3### END INIT INFO# Author: Jorne Kandziora <jorne@quarantainenet.nl>## Do NOT "set -e"# PATH should only include /usr/bin /usr/etc /usr/games /usr/include /usr/lib /usr/lib64 /usr/libexec /usr/local /usr/sbin /usr/share /usr/src /usr/tmp if it runs after the mountnfs.sh scriptPATH=/sbin:/usr/sbin:/bin:/usr/binDESC="Munin asynchronous server 3"NAME=munin-asyncdDAEMON=/opt/munin3/lib/$NAMEDAEMON_ARGS=""DAEMON_USER="munin-async3"PIDFILE=/opt/munin3/var/run/$NAME.pidSCRIPTNAME=/etc/init.d/$NAME# Exit if the package is not installed[ -"$DAEMON] || exit 0# Read configuration variable file if it is present[ -r /etc/default/$NAME ] && . /etc/default/$NAME# Load the VERBOSE setting and other rcS variables/lib/init/vars.shDefine LSB log_* functions.# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.. /lib/lsb/init-functions## Function that starts the daemon/service#do_start()Return # 0 if daemon has been started 1 if daemon was already running 2 if daemon could not be started start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --chuid $DAEMON_USER --exec $DAEMON --test > /dev/null \\ || return 1 start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --chuid $DAEMON_USER --exec $DAEMON -\\ $DAEMON_ARGS \\ || return 2}## Function that stops the daemon/service#do_stop(){ # killproc() doesn't try hard enough if the pid file is missing, # so create it is gone and the daemon is still running if [ ! -r $PIDFILE ]; then pid=$(pidofproc -p $PIDFILE $DAEMON) if [ -z "$pid" ]; then [ "$VERBOSE" != no ] && log_progress_msg "stopped beforehand" log_end_msg 0 return 0 fi echo $pid 2>/dev/null > $PIDFILE if [ $? -ne 0 ]; then log_end_msg 1 return 1 fi fi killproc -p $PIDFILE $DAEMON ret=$? # killproc() isn't thorough enough, ensure the daemon has been # stopped manually attempts=0 until ! pidofproc -p $PIDFILE $DAEMON >/dev/null; do attempts=$(( $attempts + 1 )) sleep 0.05 [ $attempts -lt 20 ] && continue log_end_msg 1 return 1 done [ $ret -eq 0 ] && [ "$VERBOSE" != no ] && log_progress_msg "done" log_end_msg $ret return $ret}## Function that sends a SIGHUP to the daemon/service#do_reload() # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # start-stop-daemon --stop --signal 1 --background --make-pidfile --quiet --pidfile $PIDFILE --exec $DAEMON return 0}case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2[ "$VERBOSE" != no ] && log_end_msg ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; #reload|force-reload) # # If do_reload() is not implemented then leave this commented out # and leave 'force-reload' as an alias for 'restart'. # #log_daemon_msg "Reloading $DESC" "$NAME" #do_reload #log_end_msg $? #;; restart|force-reload# # If the "reload" option is implemented then remove the # 'force-reload' alias # log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) do_start case "$?" in 0) log_end_msg 0 ;; 1log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; status) pid=$(pidofproc -p $PIDFILE $DAEMON) ret=$? pid=${pid% } # pidofproc() supplies a trailing space, strip it if [ $ret -eq 0 ]; then log_success_msg "Munin-Async3 is running (PID: $pid)" exit 0 # the LSB specifies that I in this case (daemon dead + pid file exists) # should return 1, however lsb-base returned 2 in this case up to and # including version 3.1-10 (cf. #381684). Since that bug is present # in Sarge, Ubuntu Dapper, and (at the time of writing) Ubuntu Etch, # and taking into account that later versions of pidofproc() do not # under any circumstance return 2, I'll keep understanding invalid # return code for the time being, even though the LSB specifies it is # to be used for the situation where the "program is dead and /var/lock # lock file exists" elif [ $ret -eq 1 ] || [ $ret -eq 2 ]; then log_failure_msg "Munin-Async3 is dead, although $PIDFILE exists." exit 1 elif [ $ret -eq 3 ]; then log_warning_msg "Munin-Async3 is not running." exit 3 fi log_warning_msg "Munin-Async3 status unknown." exit 4 ;; *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}>&2 echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&exit ;;esac +# Provides:          munin-node3 
-</code>+# Required-Start:    $network $named $local_fs $remote_fs 
 +# Required-Stop:     $network $named $local_fs $remote_fs 
 +# Default-Start:     2 3 4 5 
 +# Default-Stop:      0 1 6 
 +# Short-Description: Start/stop Munin-Node 3 
 +# Description:       Start/stop Munin-Node 3 
 +### END INIT INFO 
 + 
 +PATH=/sbin:/bin:/usr/sbin:/usr/bin 
 +DAEMON=/opt/munin3/sbin/munin-node 
 +PIDFILE=/opt/munin3/var/run/munin-node.pid 
 +CONFFILE=/opt/munin3/etc/munin-node.conf 
 +DAEMON_ARGS="--config $CONFFILE" 
 + 
 +. /lib/lsb/init-functions 
 +[ -r /etc/default/munin-node ] && . /etc/default/munin-node 
 + 
 +if [ ! -x $DAEMON ]; then 
 +        log_failure_msg "Munin-Node3 appears to be uninstalled.
 +        exit 5 
 +elif [ ! -e $CONFFILE ]; then 
 +      log_failure_msg "Munin-Node3 appears to be unconfigured.
 +        exit 6 
 +fi 
 + 
 +# Figure out if the pid file is in a non-standard location 
 +while read line; do 
 +        line=${line%%\#*} get rid of comments 
 +        set -f 
 +        line=$(echo $line) # get rid of extraneous blanks 
 +        set +f 
 +        if [ "$line" != "${line#pid_file }" ]; then 
 +                PIDFILE=${line#pid_file } 
 +        fi 
 +done < $CONFFILE 
 + 
 +verify_superuser() { 
 +        action=$1 
 +        [ $EUID -eq 0 ] && return 
 +        log_failure_msg "Superuser privileges required for the" \ 
 +                        "\"$action\" action." 
 +        exit 4 
 +
 + 
 +start() { 
 +        log_daemon_msg "Starting Munin-Node3" 
 +        mkdir -p /opt/munin3/var/run /opt/munin3/log 
 +        chown munin:root /opt/munin3/var/run 
 +        chown munin:www-data /opt/munin3/log 
 +        chmod 0755 /opt/munin3/var/run 
 +        chmod 0755 /opt/munin3/log 
 +        if pidofproc -$PIDFILE $DAEMON >/dev/null; then 
 +                log_progress_msg "started beforehand" 
 +                log_end_msg 0 
 +                exit 0 
 +        fi 
 +        start_daemon -p $PIDFILE $DAEMON $DAEMON_ARGS 
 +#        /usr/sbin/munin-node3 --config /etc/munin3/munin-node.conf 
 +        ret=$? 
 +        # start_daemon() isn't thorough enough, ensure the daemon has been 
 +        # started manually 
 +        attempts=0 
 +        until pidofproc -$PIDFILE $DAEMON >/dev/null; do 
 +                attempts=$(( $attempts + 1 )) 
 +                sleep 0.05 
 +                [ $attempts -lt 20 ] && continue 
 +                log_end_msg 1 
 +                return 1 
 +        done 
 +        [ $ret -eq 0 ] && log_progress_msg "done" 
 +        log_end_msg $ret 
 +        return $ret 
 +} 
 + 
 +stop() { 
 +        log_daemon_msg "Stopping Munin-Node3" 
 +        # killproc() doesn't try hard enough if the pid file is missing, 
 +        # so create it is gone and the daemon is still running 
 +        if [ ! -r $PIDFILE ]; then 
 +                pid=$(pidofproc -p $PIDFILE $DAEMON) 
 +                if [ -z "$pid" ]; then 
 +                        log_progress_msg "stopped beforehand" 
 +                        log_end_msg 0 
 +                        return 0 
 +                fi 
 +                echo $pid 2>/dev/null > $PIDFILE 
 +                if [ $? -ne 0 ]; then 
 +                        log_end_msg 1 
 +                        return 1 
 +                fi 
 +        fi 
 +        killproc -p $PIDFILE /opt/munin3/sbin/munin-node 
 +        ret=$? 
 +        # killproc() isn't thorough enough, ensure the daemon has been 
 +        # stopped manually 
 +        attempts=0 
 +        until ! pidofproc -p $PIDFILE $DAEMON >/dev/null; do 
 +                attempts=$(( $attempts + 1 )) 
 +                sleep 0.05 
 +                [ $attempts -lt 20 ] && continue 
 +                log_end_msg 1 
 +                return 1 
 +        done 
 +        [ $ret -eq 0 ] && log_progress_msg "done" 
 +        log_end_msg $ret 
 +        return $ret 
 +} 
 + 
 +if [ "$#" -ne 1 ]; then 
 +        log_failure_msg "Usage: /etc/init.d/munin-node3"
 +                        "{start|stop|restart|force-reload|try-restart}
 +        exit 2 
 +fi 
 + 
 +case "$1" in 
 +  start) 
 +        verify_superuser $
 +        start 
 +        exit $? 
 +        ;; 
 +  stop) 
 +        verify_superuser $1 
 +        stop 
 +        exit $? 
 +        ;; 
 +  restart|force-reload) 
 +        verify_superuser $
 +        stop || exit $
 +        start 
 +        exit $? 
 +        ;; 
 +  try-restart) 
 +        verify_superuser $1 
 +        pidofproc -$PIDFILE $DAEMON >/dev/null 
 +        if [ $? -eq ]; then 
 +                stop || exit $? 
 +                start 
 +                exit $? 
 +        fi 
 +        log_success_msg "Munin-Node3 was stopped beforehand and thus not" \ 
 +                        "restarted." 
 +        exit 0 
 +        ;; 
 +  reload) 
 +        log_failure_msg "The \"reload\" action is not implemented." 
 +        exit 3 
 +        ;; 
 +  status) 
 +        pid=$(pidofproc -p $PIDFILE $DAEMON) 
 +        ret=$? 
 +        pid=${pid% } # pidofproc() supplies a trailing space, strip it 
 +        if [ $ret -eq 0 ]; then 
 +                log_success_msg "Munin-Node3 is running (PID: $pid)" 
 +                exit 0 
 +        # the LSB specifies that I in this case (daemon dead + pid file exists) 
 +        # should return 1, however lsb-base returned 2 in this case up to and 
 +        # including version 3.1-10 (cf. #381684).  Since that bug is present 
 +        # in Sarge, Ubuntu Dapper, and (at the time of writing) Ubuntu Etch, 
 +        # and taking into account that later versions of pidofproc() do not 
 +        # under any circumstance return 2, I'll keep understanding invalid 
 +        # return code for the time being, even though the LSB specifies it is 
 +        # to be used for the situation where the "program is dead and /var/lock 
 +        # lock file exists".   
 +        elif [ $ret -eq 1 ] || [ $ret -eq 2 ]; then 
 +                log_failure_msg "Munin-Node3 is dead, although $PIDFILE exists." 
 +                exit 1 
 +        elif [ $ret -eq 3 ]; then 
 +                log_warning_msg "Munin-Node3 is not running." 
 +                exit 3 
 +        fi 
 +        log_warning_msg "Munin-Node3 status unknown." 
 +        exit 4 
 +        ;; 
 +  *) 
 +        log_failure_msg "Usage: /etc/init.d/munin-node3
 +                        "{start|stop|restart|force-reload|try-restart}" 
 +        exit 
 +        ;; 
 +esac 
 + 
 +log_failure_msg "Unexpected failure, please file a bug." 
 +exit 1
  
-==============================================================\\ 
-kvd_dispon_multi\\ 
 ============================================================== ==============================================================
 +munin-async3    script de inicio en Debian
 +==============================================================
 +
 +#! /bin/sh
 +### BEGIN INIT INFO
 +# Provides:          munin-async3
 +# Required-Start:    $network $named $local_fs $remote_fs munin-node
 +# Required-Stop:     $network $named $local_fs $remote_fs munin-node
 +# Default-Start:     2 3 4 5
 +# Default-Stop:      0 1 6
 +# Short-Description: Munin asynchronous server 3
 +# Description:       Asynchronous munin node 3
 +### END INIT INFO
 +
 +# Author: Jorne Kandziora <jorne@quarantainenet.nl>
 +#
 +# Do NOT "set -e"
 +
 +# PATH should only include /usr/* if it runs after the mountnfs.sh script
 +PATH=/sbin:/usr/sbin:/bin:/usr/bin
 +DESC="Munin asynchronous server 3"
 +NAME=munin-asyncd
 +DAEMON=/opt/munin3/lib/$NAME
 +DAEMON_ARGS=""
 +DAEMON_USER="munin-async3"
 +PIDFILE=/opt/munin3/var/run/$NAME.pid
 +SCRIPTNAME=/etc/init.d/$NAME
 +
 +# Exit if the package is not installed
 +[ -x "$DAEMON" ] || exit 0
 +
 +# Read configuration variable file if it is present
 +[ -r /etc/default/$NAME ] && . /etc/default/$NAME
 +
 +# Load the VERBOSE setting and other rcS variables
 +. /lib/init/vars.sh
 +
 +# Define LSB log_* functions.
 +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
 +. /lib/lsb/init-functions
 +
 +#
 +# Function that starts the daemon/service
 +#
 +do_start()
 +{
 +        # Return
 +        #   0 if daemon has been started
 +        #   1 if daemon was already running
 +        #   2 if daemon could not be started
 +        start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --chuid $DAEMON_USER --exec $DAEMON --test > /dev/null \
 +                || return 1
 +        start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --chuid $DAEMON_USER --exec $DAEMON -- \
 +                $DAEMON_ARGS \
 +                || return 2
 +}
 +
 +#
 +# Function that stops the daemon/service
 +#
 +do_stop()
 +{
 +        # killproc() doesn't try hard enough if the pid file is missing,
 +        # so create it is gone and the daemon is still running
 +        if [ ! -r $PIDFILE ]; then
 +                pid=$(pidofproc -p $PIDFILE $DAEMON)
 +                if [ -z "$pid" ]; then
 +                        [ "$VERBOSE" != no ] && log_progress_msg "stopped beforehand"
 +                        log_end_msg 0
 +                        return 0
 +                fi
 +                echo $pid 2>/dev/null > $PIDFILE
 +                if [ $? -ne 0 ]; then
 +                        log_end_msg 1
 +                        return 1
 +                fi
 +        fi
 +        killproc -p $PIDFILE $DAEMON
 +        ret=$?
 +        # killproc() isn't thorough enough, ensure the daemon has been
 +        # stopped manually
 +        attempts=0
 +        until ! pidofproc -p $PIDFILE $DAEMON >/dev/null; do
 +                attempts=$(( $attempts + 1 ))
 +                sleep 0.05
 +                [ $attempts -lt 20 ] && continue
 +                log_end_msg 1
 +                return 1
 +        done
 +        [ $ret -eq 0 ] && [ "$VERBOSE" != no ] && log_progress_msg "done"
 +        log_end_msg $ret
 +        return $ret
 +}
 +
 +#
 +# Function that sends a SIGHUP to the daemon/service
 +#
 +do_reload() {
 +        #
 +        # If the daemon can reload its configuration without
 +        # restarting (for example, when it is sent a SIGHUP),
 +        # then implement that here.
 +        #
 +        start-stop-daemon --stop --signal 1 --background --make-pidfile --quiet --pidfile $PIDFILE --exec $DAEMON
 +        return 0
 +}
 +
 +case "$1" in
 +  start)
 +        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
 +        do_start
 +        case "$?" in
 +                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 +                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 +        esac
 +        ;;
 +  stop)
 +        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
 +        do_stop
 +        case "$?" in
 +                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
 +                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
 +        esac
 +        ;;
 +  #reload|force-reload)
 +        #
 +        # If do_reload() is not implemented then leave this commented out
 +        # and leave 'force-reload' as an alias for 'restart'.
 +        #
 +        #log_daemon_msg "Reloading $DESC" "$NAME"
 +        #do_reload
 +        #log_end_msg $?
 +        #;;
 +  restart|force-reload)
 +        #
 +        # If the "reload" option is implemented then remove the
 +        # 'force-reload' alias
 +        #
 +        log_daemon_msg "Restarting $DESC" "$NAME"
 +        do_stop
 +        case "$?" in
 +          0|1)
 +                do_start
 +                case "$?" in
 +                        0) log_end_msg 0 ;;
 +                        1) log_end_msg 1 ;; # Old process is still running
 +                        *) log_end_msg 1 ;; # Failed to start
 +                esac
 +                ;;
 +          *)
 +                # Failed to stop
 +                log_end_msg 1
 +                ;;
 +        esac
 +        ;;
 +  status)
 +        pid=$(pidofproc -p $PIDFILE $DAEMON)
 +        ret=$?
 +        pid=${pid% } # pidofproc() supplies a trailing space, strip it
 +        if [ $ret -eq 0 ]; then
 +                log_success_msg "Munin-Async3 is running (PID: $pid)"
 +                exit 0
 +        # the LSB specifies that I in this case (daemon dead + pid file exists)
 +        # should return 1, however lsb-base returned 2 in this case up to and
 +        # including version 3.1-10 (cf. #381684).  Since that bug is present
 +        # in Sarge, Ubuntu Dapper, and (at the time of writing) Ubuntu Etch,
 +        # and taking into account that later versions of pidofproc() do not
 +        # under any circumstance return 2, I'll keep understanding invalid
 +        # return code for the time being, even though the LSB specifies it is
 +        # to be used for the situation where the "program is dead and /var/lock
 +        # lock file exists".  
 +        elif [ $ret -eq 1 ] || [ $ret -eq 2 ]; then
 +                log_failure_msg "Munin-Async3 is dead, although $PIDFILE exists."
 +                exit 1
 +        elif [ $ret -eq 3 ]; then
 +                log_warning_msg "Munin-Async3 is not running."
 +                exit 3
 +        fi
 +        log_warning_msg "Munin-Async3 status unknown."
 +        exit 4
 +        ;;
 +  *)
 +        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
 +        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
 +        exit 3
 +        ;;
 +esac
 +
 +
 +==============================================================
 +kvd_dispon_multi
 +==============================================================
 +
 +#!/bin/bash
 +#
 +#
 +#
 +
 +rrd_dir="/var/lib/munin/kvd-estado"
 +
 +conexion="mysql -f -B --password=password --user=admin"
 +
 +comando="SELECT nombre FROM spt_inventario ORDER BY nombre ASC; "
 +kioskos=`$conexion -e "$comando" timer | grep -v nombre `
 +
 +
 +case $1 in
 +   config)
 +     # primero el consolidador
 +     echo "multigraph kvd_dispon
 +graph_category KVD-Dispon
 +graph_title Disponibilidad Kioskos 
 +graph_args --units-exponent 0
 +graph_vlabel Cumplimiento"
 +#     for i in $kioskos ; do
 +#        echo "$i-Subida.label $i Carga (Upload)"
 +#     done
 +     for i in $kioskos ; do
 +        echo "multigraph kvd_dispon.$i
 +graph_category KVD-Dispon
 +graph_title Disponibilidad Kiosko $i
 +graph_args --units-exponent 0
 +graph_vlabel Cumplimiento
 +$i-percent.label Porcentaje (20H)
 +$i-percent.draw AREA
 +$i-horas.label Horas
 +$i-horas.draw AREA"
 +done
 +        exit 0
 +        ;;
 +esac
 +
 +
 +echo "multigraph kvd_dispon"
 +for idkiosk in $kioskos ; do
 +    echo "multigraph kvd_dispon.$idkiosk"
 +    archivo="$rrd_dir/kvd-estado-kvd_estado-$idkiosk-`echo $idkiosk | sed 's/^./_/g'`-g.rrd"
 +    valor=$(rrdtool fetch $archivo AVERAGE \
 +          -s `date --date="last monday"  +"%s" ` |\
 +          grep ":" | grep -v '\-nan' | awk '{if($2 > 0) print $0}' | wc -l )
 +
 +    echo -n "$idkiosk-percent.value "
 +    echo $valor/12/20*100 | bc -l | awk '{printf "%.2f\n",$1}'
 +    echo -n "$idkiosk-horas.value "
 +    echo $valor/12 | bc -l | awk '{printf "%.3f\n",$1}'
 +done
 +
 +
 +
  
-<code> 
-#!/bin/bash###rrd_dir="/var/lib/munin/kvd-estado"conexion="mysql -f -B --password=password --user=admin"comando="SELECT nombre FROM spt_inventario ORDER BY nombre ASC; "kioskos=`$conexion -e "$comando" timer | grep -v nombre `case $1 in config) # primero el consolidador echo "multigraph kvd_dispongraph_category KVD-Dispongraph_title Disponibilidad Kioskos graph_args --units-exponent 0graph_vlabel Cumplimiento"# for i in $kioskos ; do# echo "$i-Subida.label $i Carga (Upload)"# done for i in $kioskos ; do echo "multigraph kvd_dispon.$igraph_category KVD-Dispongraph_title Disponibilidad Kiosko $igraph_args --units-exponent 0graph_vlabel Cumplimiento$i-percent.label Porcentaje (20H)$i-percent.draw AREA$i-horas.label Horas$i-horas.draw AREA"done exit 0 ;;esacecho "multigraph kvd_dispon"for idkiosk in $kioskos ; do echo "multigraph kvd_dispon.$idkiosk" archivo="$rrd_dir/kvd-estado-kvd_estado-$idkiosk-`echo $idkiosk | sed 's/^./_/g'`-g.rrd" valor=$(rrdtool fetch $archivo AVERAGE \\ -s `date --date="last monday" +"%s" ` |\\ grep ":" | grep -v '\\-nan' | awk '{if($2 > 0) print $0}' | wc -l ) echo -n "$idkiosk-percent.value " echo $valor/12/20*100 | bc -l | awk '{printf "%.2f\",$1}' echo -n "$idkiosk-horas.value " echo $valor/12 | bc -l | awk '{printf "%.3f\",$1}'done 
-</code> 
  
Volver arriba