Re: mais sobre ndodb

Leonardo Neves <[email protected]>
Newsgroups gmane.network.nagios.user.brazil
Message-ID <[email protected]>
Olha esse código, pode ser útil.

#apagar checagens antigas
db=nagios
echo "USE $db; DELETE FROM nagios_servicechecks WHERE start_time <= (NOW() -
INTERVAL 1 DAY)" | mysql $MYSQL_LOGIN >/dev/null
echo "USE $db; DELETE FROM nagios_hostchecks WHERE start_time <= (NOW() -
INTERVAL 1 DAY)" | mysql $MYSQL_LOGIN >/dev/null

#otimizar todos os databases
for db in $(echo "SHOW DATABASES;" | mysql $MYSQL_LOGIN | grep -v -e
"Database" -e "information_schema" -e "test")
do
        TABLES=$(echo "USE $db; SHOW TABLES;" | mysql $MYSQL_LOGIN |  grep
-v Tables_in_)
        echo "Switching to database $db"
        for table in $TABLES
        do
                echo -n " * Optimizing table $table ... "
                echo "USE $db; OPTIMIZE TABLE $table" | mysql $MYSQL_LOGIN
>/dev/null
                echo "done."
        done
done

Atenciosamente,
Leonardo Neves Bernardo
Linux/Unix Specialist
LPIC3 (core+mixed environment+security) + RHCT



2009/7/13 Jose Oliveira <[email protected]>

> Colegas
>
> Iniciei um Nagios 3.06 com ndodb e, fora a briga com performance, o banco
> cresçe pra caçamba...
>
> Em 15 dias o Banco atingiu 4Gb. Temos alguma política de expurgo no
> projeto,
> ou alguém já escreveu?
>
> No mesmo assunto: O broker tem opção de apagar umas linhas do passado para
> diminuir o tamanho. Quando ligo esta opção, o delete demora muito, pois as
> tabelas tem milhares de linhas. Voces criaram índices por data nestas
> tabelas? Parece que melhoraria...
>
>
> --
> Abraços
> JGeraldo
>
>
>
>
> --
> Abraços
> JGeraldo
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> --
> [email protected] mailing list
> https://lists.sourceforge.net/lists/listinfo/nagios-users-br
> Wiki: http://nagios-br.sf.net/wiki
>
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
-- 
[email protected] mailing list
https://lists.sourceforge.net/lists/listinfo/nagios-users-br
Wiki: http://nagios-br.sf.net/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.