abclinuxu.cz AbcLinuxu.cz itbiz.cz ITBiz.cz HDmag.cz HDmag.cz abcprace.cz AbcPráce.cz
Inzerujte na AbcPráce.cz od 950 Kč
Rozšířené hledání
×
    včera 19:11 | Nová verze

    Open source RDP (Remote Desktop Protocol) server xrdp (Wikipedie) byl vydán ve verzi 0.10.0. Z novinek je vypíchnuta podpora GFX (Graphic Pipeline Extension). Nová větev řeší také několik bezpečnostních chyb.

    Ladislav Hagara | Komentářů: 4
    včera 04:11 | Nová verze

    Rocky Linux byl vydán v nové stabilní verzi 9.4. Přehled novinek v poznámkách k vydání.

    Ladislav Hagara | Komentářů: 0
    9.5. 22:22 | Bezpečnostní upozornění

    Dellu byla odcizena databáze zákazníků (jméno, adresa, seznam zakoupených produktů) [Customer Care, Bleeping Computer].

    Ladislav Hagara | Komentářů: 13
    9.5. 21:11 | Zajímavý článek

    V lednu byl otevřen editor kódů Zed od autorů editoru Atom a Tree-sitter. Tenkrát běžel pouze na macOS. Byl napevno svázán s Metalem. Situace se ale postupně mění. V aktuálním příspěvku Kdy Zed na Linuxu? na blogu Zedu vývojáři popisují aktuální stav. Blíží se alfa verze.

    Ladislav Hagara | Komentářů: 29
    9.5. 14:33 | Pozvánky

    O víkendu 11. a 12. května lze navštívit Maker Faire Prague, festival plný workshopů, interaktivních činností a především nadšených a zvídavých lidí.

    Ladislav Hagara | Komentářů: 0
    8.5. 21:55 | Nová verze

    Byl vydán Fedora Asahi Remix 40, tj. linuxová distribuce pro Apple Silicon vycházející z Fedora Linuxu 40.

    Ladislav Hagara | Komentářů: 20
    8.5. 20:22 | IT novinky

    Představena byla služba Raspberry Pi Connect usnadňující vzdálený grafický přístup k vašim Raspberry Pi z webového prohlížeče. Odkudkoli. Zdarma. Zatím v beta verzi. Detaily v dokumentaci.

    Ladislav Hagara | Komentářů: 6
    8.5. 12:55 | Nová verze

    Byla vydána verze R14.1.2 desktopového prostředí Trinity Desktop Environment (TDE, fork KDE 3.5). Přehled novinek v poznámkách k vydání, podrobnosti v seznamu změn.

    JZD | Komentářů: 0
    7.5. 18:55 | IT novinky

    Dnešním dnem lze již také v Česku nakupovat na Google Store (telefony a sluchátka Google Pixel).

    Ladislav Hagara | Komentářů: 10
    7.5. 18:33 | IT novinky

    Apple představil (keynote) iPad Pro s čipem Apple M4, předělaný iPad Air ve dvou velikostech a nový Apple Pencil Pro.

    Ladislav Hagara | Komentářů: 9
    Podle hypotézy Mrtvý Internet mj. tvoří většinu online interakcí boti.
     (63%)
     (8%)
     (14%)
     (16%)
    Celkem 155 hlasů
     Komentářů: 11, poslední včera 18:00
    Rozcestník

    Dotaz: Nagios a Centreon

    15.7.2011 13:49 Dalibor V.
    Nagios a Centreon
    Přečteno: 1393×

    Mam 3 problemy s Centreonem (resp. Nagiosem) a prosim Vas o pomoc:

     

    - v konfiguraci služeb mi chybí pole ARGS pro pridani promennych parametru k prikazu

    - nevykresluji se grafy (resp. necitelny png obrazek)

    - a nedari se mi spustit command, ktery potrebuje prava roota (prostrednictvim sudo). Neznam spravnou syntaxi, z konzole OK

     

    Diky za pomoc. Predpokladam, ze nejsem jediny, co pouziva Nagios v kombinaci s Centreonem.

    Odpovědi

    15.7.2011 14:44 komodo | skóre: 27 | blog: komodo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    1. http://forge.centreon.com/issues/2479

    2. jak vypada obrazek ? hlasi nejakou chybu v logu ?

    3. co znamena nedari se spustit ? jak vypada definice commandu a nasledna definice checku ?
    15.7.2011 17:04 skunerq | skóre: 19 | blog: skunerovo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    ad 2, v nastaveni chybi cesta k rrd souborum, nevi kde je rrdtools ... zapnete v centreonovi kompletni logovani {administration=>options=>debug} a v /usr/local/centreon/log/ zkouknete soubory centreonstorage.log a rrdtool.log Dale zkontrolujte spravne nastavene cesty v centreonstorage {administration=>options=>centreonstorage=>options}

    ad 3, v /etc/sudoers by melo byt neco takoveho

    ## BEGIN: CENTREON SUDO #Add by CENTREON installation script User_Alias CENTREON=www-data,nagios Defaults:CENTREON !requiretty # Nagios Restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios* restart CENTREON ALL = NOPASSWD: /etc/init.d/nagios restart # Nagios reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios* reload CENTREON ALL = NOPASSWD: /etc/init.d/nagios reload # Nagios test config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -v * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -v * # Nagios test for optim config CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios* -s * CENTREON ALL = NOPASSWD: /usr/local/nagios/bin/nagios -s * # Snmptrapd Restart CENTREON ALL = NOPASSWD: /etc/init.d/snmptrapd restart # CentStorage Restart CENTREON ALL = NOPASSWD: /etc/init.d/centstorage restart # CentStorage stop CENTREON ALL = NOPASSWD: /etc/init.d/centstorage stop # CentStorage start CENTREON ALL = NOPASSWD: /etc/init.d/centstorage start ## END: CENTREON SUDO

    16.7.2011 10:39 Marek
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Ja mam asi podobny problem. V logach zadne chyby, cesty nastaveny spravne.. Pokud chcete, poslu nejake informace na ukazku, treba neco vyctete, ale ja zadne chyby nevidim :-(
    16.7.2011 14:20 skunerq | skóre: 19 | blog: skunerovo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    jsou ve /var/lib/centreon, adresare metrics a status? jsou v techto adresarich .rrd soubory? vykresluje centreon preformance grafy? {home=>nagios statistics=>graphs}

    zkuste zapnout debug v centreonstorage {/usr/local/centreon/bin/centreonstorage} v defaultu je vypnuto {$debug = 1;}. pak restartnete centreonstorage servisu nasledne zkouknete /usr/local/centreon/log/centreonstorage.log/
    18.7.2011 07:30 Marek
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    ano - ano - NE - ok :-)
    19.7.2011 10:39 Vasser
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Příloha:
    rrd se vytvari:
    19/7/2011 10:33:59 - DB updating : /var/lib/centreon/metrics/234.rrd
    19/7/2011 10:33:59 - DB updating : /var/lib/centreon/status/119.rrd
    19/7/2011 10:33:59 - DB updating : /var/lib/centreon/metrics/226.rrd
    19/7/2011 10:33:59 - DB updating : /var/lib/centreon/metrics/227.rrd
    19/7/2011 10:33:59 - DB updating : /var/lib/centreon/status/115.rrd
    
    ale vypada to takto.. viz. priloha
    Ruža Becelin avatar 19.7.2011 13:43 Ruža Becelin | skóre: 40 | blog: RuzaBecelinBlog
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Predpokladam, ze php-gd balik je nainstalovany?
    19.7.2011 14:03 Vasser
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    neni
    apt-get install php-gd
    Čtu seznamy balíků… Hotovo
    Vytvářím strom závislostí
    Čtu stavové informace… Hotovo
    E: Nelze najít balík php-gd
    
    k cemu to je?
    19.7.2011 14:16 Vasser
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    toto ale mam:
    apt-get install php5-gd
    Čtu seznamy balíků… Hotovo
    Vytvářím strom závislostí
    Čtu stavové informace… Hotovo
    php5-gd je již nejnovější verze.
    
    19.7.2011 16:51 skunerq | skóre: 19 | blog: skunerovo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    tak uz zustava perf-data v kongiguraci nagios.cfg zkontrolujte tyto polozky
    process_performance_data=1
    service_perfdata_command=process-service-perfdata
    service_perfdata_file=/usr/local/nagios/var/service-perfdata
    service_perfdata_file_mode=2
    event_broker_options=-1
    broker_module=/usr/local/nagios/bin/ndomod-3x.o config_file=/usr/local/nagios/etc/ndomod.cfg
    
    a zkontroloval zda ma webserver opravneni do slozek /var/lib/centreon/
    20.7.2011 07:04 Vasser
    Rozbalit Rozbalit vše Re: Nagios a Centreon

    Zdravim a dekuju za reakci. Vse mam nastaveno (postupoval jsem podle navodu), ale bohuzel problem pretrvava,. Jsem bezradnej :-(

    20.7.2011 09:09 skunerq | skóre: 19 | blog: skunerovo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    mozna by bylo lepsi postupovat podle oficialnich navodu link
    21.7.2011 16:23 komodo | skóre: 27 | blog: komodo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Nebo to jeste projit dle toho.
    22.7.2011 07:04 Vasser
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    To uz jsem taky procital, ale mam "vsechno" nastaveno dobre. Netusim, kde je zakopanej pes.
    20.7.2011 10:36 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Koukam ze se to tady docela rozjelo:-)

    skript
    $USER1$/check_asterisk_peers -p 100
    poustim pres centreon v Configuration > Commands > Checks a vysledek je takovy:
    Plugin test
    Command Line	/usr/lib/nagios/plugins/check_asterisk_peers -p 100
    Output	CRITICAL: ?[0;37mUnable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)
    ?[0m
    Status	CRITICAL
    ALE, kdyz ho pustim v terminalu pod uzivatelem nagios (pod tim bezi i centreon) se sudo (v /etc/sudoers mam potrebne udaje, tudiz na tento prikaz nepotrebuje uzivatel nagios heslo), vysledek je ok:
    server:~# su nagios
    server:/$ whoami
    nagios
    server:/$ sudo /usr/lib/nagios/plugins/check_asterisk_peers -p 100
     OK: 100
    
    Kam do toho commandu v centreonu mam zadat sudo?
    20.7.2011 13:06 skunerq | skóre: 19 | blog: skunerovo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    jakeho ma adresar plugin vlastnika ?

    ja mam pluginy v /usr/loval/nagios/libexec a vlastnikem je nagios

    drwxrwsr-x  3 nagios nagios   20480 2011-07-15 18:52 libexec
    20.7.2011 13:34 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    drwxr-xr-x 3 root root 12288 20. čec 12.27 plugins

    Takze to precte kazdy. Oni ty pluginy jdou spoustet, to je ok. Ale kdyz uz ten samotny plugin potrebuje prava roota, tak ho musim pustit pod sudo (/etc/sudoers mi resi to, ze neni zapotrebi vyzva k zadani hesla korektne). Ale to nevim, jak to z toho centreonu udelat, protoze tam pred command sudo nejde priradit.
    Ruža Becelin avatar 20.7.2011 14:51 Ruža Becelin | skóre: 40 | blog: RuzaBecelinBlog
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Co pouzit alias?
    20.7.2011 14:55 skunerq | skóre: 19 | blog: skunerovo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    podle me bys stacilo
    chown nagios:nagios /usr/lib/nagios/plugins/*
    Ruža Becelin avatar 20.7.2011 15:29 Ruža Becelin | skóre: 40 | blog: RuzaBecelinBlog
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    To ne, protoze sudo potrebuji pluginy...
    20.7.2011 15:35 skunerq | skóre: 19 | blog: skunerovo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    jediny kdo potrebuje ty pluginy je nagios, a root si je pusti taky bez problemu. Centreon to ma osetreno pres sudoers, takze nevidim duvod
    Ruža Becelin avatar 20.7.2011 16:49 Ruža Becelin | skóre: 40 | blog: RuzaBecelinBlog
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Divam jsem se na moji konfiguraci a pro spusteni binarky v privilegovanem modu mam sudo primo v pluginu.

    Takze:
    1) Bud si udela alias a sudo bude poustet pres nej
    2) Spusti sudo primo v pluginu
    20.7.2011 20:58 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    To jakoze napisu do pluginu nekam na zacatek sudo?
    20.7.2011 21:04 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    tady je ten script, kam mam dat sudo?
    #!/bin/sh
    
    # Check asterisk peers plugin for Nagios.
    # Written by Chad Phillips (chad@apartmentlines.com)
    # Last Modified: 2009-05-02
    
    ASTERISK=/usr/sbin/asterisk
    
    PROGPATH=`dirname $0`
    REVISION=`echo '$Revision: 2 $' | sed -e 's/[^0-9.]//g'`
    
    . $PROGPATH/utils.sh
    
    print_usage() {
        echo "
    Usage: check_asterisk_peers [--type | -t sip|iax] [--peers | -p peers] [--registrations | -r registrations] [--verify-peers] [--verify-registrations] [--config-file filepath]
    Usage: check_asterisk_peers --help | -h
    
    Description:
    
    This plugin checks Asterisk peers via Asterisk CLI commands to make sure
    they are in a healthy state.  Unlike other monitoring plugins, status
    is obtained from the perspective of the Asterisk server -- it's a good plugin
    to use for monitoring the state of your connections to providers.
    
    Both the peer itself and registration status to a peer can be monitored,
    with the option of verifying that the peer/registration is actively configured.
    
    If any of the checked peers/registrations return a non-OK state, a critical
    state is returned. If verification is being used and a peer/registration is
    not verified as being in the active configuration, then the status check is
    skipped for that item instead of a critical state being returned.
    
    Tested to work on Linux.
    
    The following arguments are accepted:
    
      --type  | -t            (Optional) The type of peer to check.  Valid values
                              are sip, iax. Defaults to sip.
    
      --peers | -p            (Optional) A space separated list of peers to check.
                              Use the peer name given in the configuration,
                              without the surrounding brackets.
    
      --registrations | -r    (Optional) A space separated list of registrations
                              to check, in the form of username@uri. For example,
                              to check the registration of peer foo to
                              somesite.com, use foo@somesite.com
    
      --verify-peers          (Optional) If set, peer entries are verified in
                              the configuration, and the check is skipped
                              if they are not found.
    
      --verify-registrations  (Optional) If set, registrations are verified in
                              the configuration, and the check is skipped
                              if they are not found.
    
      --config-file           (Optional) The location of the configuration file(s).
                              Use a space separated list if specifying multiple
                              files.
    
                              Default value is based on the --type setting:
    
                              sip: /etc/asterisk/sip.conf
                              iax: /etc/asterisk/iax.conf
    
      --help | -h             Print this help and exit.
    
    Examples:
    
    Check peers [foo] and [bar]:
    
      check_asterisk_peers -p \"foo bar\"
    
    Check peers [foo] and [bar], and registration for usr baz at somesite.com,
    and verify that both the peers and the registration are actively configured.
    
      check_asterisk_peers -p \"foo bar\" -r \"baz@somesite.com\" --verify-peers --verify-registrations
    
    Caveats:
    
    The verification checks will not work correctly if there is any leading or
    trailing whitespace on any of the register statement lines or the peer
    section headings.
    
    This plugin does not work with Realtime.
    
    This plugin calls the asterisk executable directly, so make sure that the user
    executing this script has appropriate permissions!  Usually the asterisk binary
    can only be run by the asterisk user or root. To grant the nagios user
    permissions to execute the script, try something like the following in your
    /etc/sudoers file:
      nagios ALL=(ALL) NOPASSWD: /path/to/plugins/directory/check_asterisk_peers
    
    Then call the plugin using sudo:
      /path/to/sudo check_asterisk_peers
    "
    }
    
    print_help() {
        print_usage
        echo "Check asterisk peers plugin for Nagios."
        echo ""
    }
    
    # Sets the exit status for the plugin.  This is done in such a way that the
    # status can only go in one direction: OK -> WARNING -> CRITICAL.
    set_exit_status() {
    	new_status=$1
    	# Nothing needs to be done if the state is already critical, so exclude
    	# that case.
    	case $exitstatus
    	in
    		$STATE_WARNING)
    			# Only upgrade from warning to critical.
    			if [ "$new_status" = "$STATE_CRITICAL" ]; then
    				exitstatus=$new_status;
    			fi
    		;;
    		$STATE_OK)
    			# Always update state if current state is OK.
    			exitstatus=$new_status;
    		;;
    	esac
    }
    
    # Ensures that a call to the Asterisk process returns successfully.  Exits
    # critical if not.
    check_asterisk_result() {
    	if [ "$1" != "0" ]; then
    		echo "CRITICAL: $2"
    		exit $STATE_CRITICAL
    	fi
    }
    
    # Recurse through the configuration file and find all included files, building
    # a final list of files to use for verification checks.
    get_config_files() {
    	for file in $1
    	do
    		if [ "$conf_file_list" ]; then
    			conf_file_list="$conf_file_list $file"
    		else
    			conf_file_list="$file"
    		fi
    		files=`cat $file | grep ^\#include | awk '{print $2;}'`
    		if [ "$files" ]; then
    			get_config_files "$files"
    		fi
    	done
    }
    
    # Defaults.
    exitstatus=$STATE_OK
    peers=
    registrations=
    verify_peers=
    verify_registrations=
    peer_type=
    conf_file=
    conf_file_list=
    all_config=
    test_ok=
    test_errors=
    output=
    
    # Grab the command line arguments.
    while test -n "$1"; do
        case "$1" in
            --help)
                print_help
                exit $STATE_OK
                ;;
            -h)
                print_help
                exit $STATE_OK
                ;;
            --peers)
                peers=$2
                shift
                ;;
            -p)
                peers=$2
                shift
                ;;
    		--registrations)
    			registrations=$2
    			shift
                ;;
    		-r)
    			registrations=$2
    			shift
                ;;
            --verify-peers)
            	verify_peers=1
            	;;
            --verify-registrations)
            	verify_registrations=1
            	;;
            --type)
                peer_type=$2
                shift
                ;;
            -t)
                peer_type=$2
                shift
                ;;
            --conf-file)
            	conf_file=$2
            	shift
            	;;
            -x)
                exitstatus=$2
                shift
                ;;
            --exitstatus)
                exitstatus=$2
                shift
                ;;
            *)
                echo "Unknown argument: $1"
                print_usage
                exit $STATE_UNKNOWN
                ;;
        esac
        shift
    done
    
    # Make sure we have a valid peer type.
    if [ "$peer_type" != "" ] && [ "$peer_type" != "sip" ] && [ "$peer_type" != "iax" ]; then
    	echo "Peer type must be one of: sip, iax."
    	exit $STATE_UNKNOWN
    # Convert iax type into internal iax2 type for the Asterisk executable.
    elif [ "$peer_type" = "iax" ]; then
    	peer_type=iax2
    # Default type is SIP.
    else
    	peer_type=sip
    fi
    
    if [ ! "$peers" ] && [ ! "$registrations" ]; then
    	echo "At least one peer or registration must be provided."
    	exit $STATE_UNKNOWN
    fi
    
    # Set a default configuration file if none was set.
    if [ "$conf_file" = "" ]; then
    	if [ "$peer_type" = "iax2" ]; then
    		conf_file=/etc/asterisk/iax.conf
    	else
    		conf_file=/etc/asterisk/sip.conf
    	fi
    fi
    
    # Check to make sure the registrations are in the username@uri format.
    # This is a weak check, but at least enough to make sure we have something
    # in the user/uri variables.
    if [ "$registrations" ]; then
    	for r in $registrations
    	do
    		REGISTRATION_FORMAT_CORRECT=`echo "$r" | grep ".\+@.\+"`
    		if [ ! "$REGISTRATION_FORMAT_CORRECT" ]; then
    			echo "Registration $r is not in the valid username@uri format."
    			exit $STATE_UNKNOWN
    		fi
    	done
    fi
    
    # Load the configuration files if necessary.
    if [ "$verify_peers" ] || [ "$verify_registrations" ]; then
    	get_config_files $conf_file
    	all_config=`cat $conf_file_list`
    fi
    
    # Check peers.
    if [ "$peers" ]; then
    	for p in $peers
    	do
    		if [ "$verify_peers" ]; then
    			peer_verified=`echo "$all_config" | grep "^\[${p}\]$"`
    		else
    			peer_verified=1
    		fi
    		if [ "$peer_verified" ]; then
    			# Fetch the data from asterisk.
    			command_output=`$ASTERISK -rx "$peer_type show peer $p" 2>&1`
    			check_asterisk_result $? "$command_output"
    			status=`echo "$command_output" | grep "^[[:space:]]*Status[[:space:]]*:" | awk '{print $3;}'`
    			if [ "$status" = "OK" ]; then
    				if [ "$test_ok" ]; then
    					test_ok="${test_ok}, $p"
    				else
    					test_ok="$p"
    				fi
    			else
    				if [ "$status" ]; then
    					status_error="$status"
    				else
    					status_error="Not found"
    				fi
    				if [ "$test_errors" ]; then
    					test_errors="${test_errors}, ${p}: $status_error"
    				else
    					test_errors="${p}: $status_error"
    				fi
    			fi
    		else
    			if [ "$test_ok" ]; then
    				test_ok="${test_ok}, $p (not active)"
    			else
    				test_ok="$p (not active)"
    			fi
    		fi
    	done
    fi
    
    # Check registrations.
    if [ "$registrations" ]; then
    	# Fetch the data from asterisk.
    	command_output=`$ASTERISK -rx "$peer_type show registry" 2>&1`
    	check_asterisk_result $? "$command_output"
    	for r in $registrations
    	do
    		user=`echo $r | cut -f 1 -d "@"`
    		# Add backslashes to escape the dot.
    		uri=`echo $r | cut -f 2 -d "@" | sed -e 's/\./\\\./g'`
    		if [ "$verify_registrations" ]; then
    			# This regex isn't perfect, but it does the trick ok.
    			registration_verified=`echo "$all_config" | grep "^register => ${user}:.\+@${uri}$"`
    		else
    			registration_verified=1
    		fi
    		if [ "$registration_verified" ]; then
    			# Have to cut off registration name at 12 characters, so let's hope
    			# it's still unique!
    			cut_user=${user:0:12}
    			# This regex isn't perfect, but it does the trick ok.
    			status=`echo "$command_output" | grep "^${uri}:[[:digit:]].\+[[:space:]].\+${cut_user}[[:space:]].\+" | awk '{print $4;}'`
    			if [ "$status" = "Registered" ]; then
    				if [ "$test_ok" ]; then
    					test_ok="${test_ok}, $r"
    				else
    					test_ok="$r"
    				fi
    			else
    				if [ "$status" ]; then
    					status_error="$status"
    				else
    					status_error="Not found"
    				fi
    				if [ "$test_errors" ]; then
    					test_errors="${test_errors}, ${r}: $status_error"
    				else
    					test_errors="${r}: $status_error"
    				fi
    			fi
    		else
    			if [ "$test_ok" ]; then
    				test_ok="${test_ok}, $r (not active)"
    			else
    				test_ok="$r (not active)"
    			fi
    		fi
    	done
    fi
    
    if [ "$test_errors" ]; then
    	output="$output ERROR: $test_errors"
    	set_exit_status $STATE_CRITICAL
    fi
    
    if [ "$test_ok" ]; then
    	output="$output OK: $test_ok"
    fi
    
    if [ ! "$output" ]; then
    	echo "UNKNOWN: No output"
    	exit $STATE_UNKNOWN
    fi
    
    echo "$output"
    
    Ruža Becelin avatar 21.7.2011 07:48 Ruža Becelin | skóre: 40 | blog: RuzaBecelinBlog
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    ASTERISK="/usr/bin/sudo /usr/sbin/asterisk"
    Zkus, jestli to pomuze...
    21.7.2011 11:26 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    To nee.. protoze pak to po me chce sudo heslo.. to bzch musel mit v sudoers primo /usr/sbin/asterisk a to nechci ... takze zmenou obsahu scriptu cesta nevede..
    21.7.2011 06:20 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Jen pro klid duse: tohle taky nepomohlo :-(
    21.7.2011 08:01 linuxik | skóre: 32 | Milovice
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Ahoj,

    nemas nahodou zapnuty selinux, nebo neco podobneho?
    21.7.2011 08:39 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Ahoj, predpokladam, ze ne :-)
    21.7.2011 09:17 linuxik | skóre: 32 | Milovice
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    No tak to je smula, reseni by bylo jednoduchy. Jeste me neco napadlo, kdyz spustis check z Centreonu, tak se spousti pod uzivatele WWW serveru a ne nagiosu.
    21.7.2011 11:32 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    No jo, ale porad mu to sudo nekam musim napsat..:-) sudo y centreonu pred script nejde jen tak napsat..
    21.7.2011 14:45 linuxik | skóre: 32 | Milovice
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    No a v cem je problem, napis ho primo do skriptu, pred prikaz ktery potrebuje roota, napr. ja takhle resim test smb sdileni:

    sudo mount -t cifs //$HOST/$SHARE ......

    funguje to bez problemu, jen musis v sudoers zakomentovat radku "Defaults requiretty" a pro Nagios nastavit spousteni prikazu bez hesla:

    nagios ALL=(ALL) NOPASSWD: ALL
    21.7.2011 15:29 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    No slo mi spis o to, aby nagios (resp. apache www-data) nemel plnej pristup k asterisku... to je trosku bezp. riziko, neee?
    21.7.2011 16:17 komodo | skóre: 27 | blog: komodo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    A takhle by to neslo ?
    /usr/bin/sudo $USER1$/check_asterisk_peers -p 100
    
    nezkousel jsem, je to jenom napad :-)
    21.7.2011 20:32 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    to je prvni, co jsem zkusil.. a to prave nejde :-/ ale diky :-)
    22.7.2011 09:23 komodo | skóre: 27 | blog: komodo
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    A co to poustet pres nrpe ? Jasne je to zbytecny meziclanek, ale asi to bude nejjednodussi.
    25.2.2012 23:54 David H.
    Rozbalit Rozbalit vše Re: Nagios a Centreon

    Také jsem se s tím trochu trápil a nakonec jsem to vyřešil tak, že jsem si udělal nový soubor, který volám z Centreonu a obsahuje to sudo.

    Obsah souboru vypadá nějak takto:

    #! /bin/sh

    /usr/bin/sudo /usr/local/nagios/libexec/check_mailq -M 'qmail' -w '80' -c '100'

    22.7.2011 11:31 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    Tak jsem si ve virtualu nainstaloval cistou instalaci Debianu s nagiosem a centreonem (stejne verze). Grafy i pole ARGs funguji bez problemu. Postupoval jsem podle stejneho navodu. Dala by se tahle instalace nejak vyuzit pro rozchozeni meho serveru?
    23.7.2011 12:52 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon

    >> nevykresluji se grafy (resp. necitelny png obrazek) toto VYRESENO: problem s Centreonem a PHP 5.3 (funkce split je deprecated). Zeditoval jsem /etc/php5/apache2/php.ini a zmenil error_reporting = E_ALL & ~E_NOTICE na error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED podle navodu.

    23.7.2011 13:02 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    VYRESENO timto i toto: >> v konfiguraci služeb mi chybí pole ARGS pro pridani promennych parametru k prikazu
    23.7.2011 13:28 Dalibor V.
    Rozbalit Rozbalit vše Re: Nagios a Centreon
    nicmene je to divny, protoze v tom virtualu jsem mel stejnou verzi Centreonu i PHP :-/

    Založit nové vláknoNahoru

    Tiskni Sdílej: Linkuj Jaggni to Vybrali.sme.sk Google Del.icio.us Facebook

    ISSN 1214-1267   www.czech-server.cz
    © 1999-2015 Nitemedia s. r. o. Všechna práva vyhrazena.