PROJET AUTOBLOG


Shaarli - Librement Shaarli

Site original : Shaarli - Librement Shaarli

⇐ retour index

[ZBX-8042] On server startup, the value cache being populated freezes the insert of data into the database - ZABBIX SUPPORT

vendredi 19 janvier 2018 à 11:19
*** de cache....
ça m'a fait un sacré blackout. Faut que je trouve un moyen....
Permalink

Bourges : licenciée pour avoir tourné dans un film X, elle saisit les prud'hommes - Les liens du Lapin Masqué

jeudi 18 janvier 2018 à 00:22
Je rebondis sur ta remarque pour dire que je trouve inacceptable ce licenciement, et encore plus si elle a été dénoncé par un/une DP.
Nous sommes là pour protéger les salariés, tous. Ce qui encore plus important dans le rôle de DP c'est de savoir écouter le salarié, dans le perso si besoin comme dans le pro sans jamais essayer de lui faire mélanger sa vie pro et perso.
Permalink

Docs/howto/zabbix2 postgresql autopartitioning - Zabbix.org

mercredi 17 janvier 2018 à 12:05
Docs/howto/zabbix2 postgresql autopartitioning
Contents

    1 Auto Partitioning with Zabbix 2.0 and Postgresql.
    2 Create the partitions schema
    3 Create the main function with the following code
    4 Create a trigger for each (clock based) table you want to partition
    5 Disable partitioning
    6 Remove unwanted old partitions

Auto Partitioning with Zabbix 2.0 and Postgresql.

Here is my take on Zabbix and Postgresql 9.x (auto) partitioning.

This approach:

    does not require you to prepare the database to partition it with zabbix
    does not require you to create/schedule a cron job for creating the tables in advance
    seems a bit simpler to implement than other solutions.

It will auto create partitions under the "partition" schema with the following name convention

partitions.tablename_pYYYYMMDD  # for DAILY   partitions
partitions.tablename_pYYYYMM    # for MONTHLY partitions

Create the partitions schema

The partitioned tables will be created under the "partitions" schema, which you can create with:

-- Schema: partitions
 
-- DROP SCHEMA partitions;
 
CREATE SCHEMA partitions
  AUTHORIZATION zabbix;

Grant authorization to the PostgreSQL account used by Zabbix. See DBUser in zabbix_server.conf.
Create the main function with the following code

-- Function: trg_partition()

-- DROP FUNCTION trg_partition();

CREATE OR REPLACE FUNCTION trg_partition()
  RETURNS trigger AS
$BODY$
DECLARE
prefix text := 'partitions.';
timeformat text;
selector text;
_interval interval;
tablename text;
startdate text;
enddate text;
create_table_part text;
create_index_part text;
BEGIN
 
selector = TG_ARGV[0];
 
IF selector = 'day' THEN
timeformat := 'YYYY_MM_DD';
ELSIF selector = 'month' THEN
timeformat := 'YYYY_MM';
END IF;
 
_interval := '1 ' || selector;
tablename :=  TG_TABLE_NAME || '_p' || to_char(to_timestamp(NEW.clock), timeformat);
 
EXECUTE 'INSERT INTO ' || prefix || quote_ident(tablename) || ' SELECT ($1).*' USING NEW;
RETURN NULL;
 
EXCEPTION
WHEN undefined_table THEN
 
startdate := extract(epoch FROM date_trunc(selector, to_timestamp(NEW.clock)));
enddate := extract(epoch FROM date_trunc(selector, to_timestamp(NEW.clock) + _interval ));
 
create_table_part:= 'CREATE TABLE IF NOT EXISTS '|| prefix || quote_ident(tablename) || ' (CHECK ((clock >= ' || quote_literal(startdate) || ' AND clock < ' || quote_literal(enddate) || '))) INHERITS ('|| TG_TABLE_NAME || ')';
create_index_part:= 'CREATE INDEX '|| quote_ident(tablename) || '_1 on ' || prefix || quote_ident(tablename) || '(itemid,clock)';
 
EXECUTE create_table_part;
EXECUTE create_index_part;
 
--insert it again
EXECUTE 'INSERT INTO ' || prefix || quote_ident(tablename) || ' SELECT ($1).*' USING NEW;
RETURN NULL;
 
END;
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION trg_partition()
  OWNER TO postgres;

Create a trigger for each (clock based) table you want to partition

CREATE TRIGGER partition_trg BEFORE INSERT ON history           FOR EACH ROW EXECUTE PROCEDURE trg_partition('day');
CREATE TRIGGER partition_trg BEFORE INSERT ON history_uint      FOR EACH ROW EXECUTE PROCEDURE trg_partition('day');
CREATE TRIGGER partition_trg BEFORE INSERT ON history_str       FOR EACH ROW EXECUTE PROCEDURE trg_partition('day');
CREATE TRIGGER partition_trg BEFORE INSERT ON history_text      FOR EACH ROW EXECUTE PROCEDURE trg_partition('day');
CREATE TRIGGER partition_trg BEFORE INSERT ON history_log       FOR EACH ROW EXECUTE PROCEDURE trg_partition('day');
CREATE TRIGGER partition_trg BEFORE INSERT ON trends            FOR EACH ROW EXECUTE PROCEDURE trg_partition('month');
CREATE TRIGGER partition_trg BEFORE INSERT ON trends_uint       FOR EACH ROW EXECUTE PROCEDURE trg_partition('month');

Disable partitioning

Should you want to remove the partitioning, just remove the partition_trg from each table, or run the following

DROP TRIGGER partition_trg ON history;
DROP TRIGGER partition_trg ON history_uint;
DROP TRIGGER partition_trg ON history_str;
DROP TRIGGER partition_trg ON history_text;
DROP TRIGGER partition_trg ON history_log;
DROP TRIGGER partition_trg ON trends;
DROP TRIGGER partition_trg ON trends_uint;

Remove unwanted old partitions

The following optional routine is to delete partitions older than the desired time. Unfortunately it requires you to schedule it using "cron" or run it manually. (SEE BELOW)

-- Function: delete_partitions(interval, text)

-- DROP FUNCTION delete_partitions(interval, text);

CREATE OR REPLACE FUNCTION delete_partitions(intervaltodelete interval, tabletype text)
  RETURNS text AS
$BODY$
DECLARE
result record ;
prefix text := 'partitions.';
table_timestamp timestamp;
delete_before_date date;
tablename text;

BEGIN
    FOR result IN SELECT * FROM pg_tables WHERE schemaname = 'partitions' LOOP

        table_timestamp := to_timestamp(substring(result.tablename from '[0-9_]*$'), 'YYYY_MM_DD');
        delete_before_date := date_trunc('day', NOW() - intervalToDelete);
        tablename := result.tablename;

    -- Was it called properly?
        IF tabletype != 'month' AND tabletype != 'day' THEN
   RAISE EXCEPTION 'Please specify "month" or "day" instead of %', tabletype;
        END IF;


    --Check whether the table name has a day (YYYY_MM_DD) or month (YYYY_MM) format
        IF length(substring(result.tablename from '[0-9_]*$')) = 10 AND tabletype = 'month' THEN
            --This is a daily partition YYYY_MM_DD
            -- RAISE NOTICE 'Skipping table % when trying to delete "%" partitions (%)', result.tablename, tabletype, length(substring(result.tablename from '[0-9_]*$'));
            CONTINUE;
        ELSIF length(substring(result.tablename from '[0-9_]*$')) = 7 AND tabletype = 'day' THEN
            --this is a monthly partition
            --RAISE NOTICE 'Skipping table % when trying to delete "%" partitions (%)', result.tablename, tabletype, length(substring(result.tablename from '[0-9_]*$'));
            CONTINUE;
        ELSE
            --This is the correct table type. Go ahead and check if it needs to be deleted
   --RAISE NOTICE 'Checking table %', result.tablename;
        END IF;

IF table_timestamp <= delete_before_date THEN
RAISE NOTICE 'Deleting table %', quote_ident(tablename);
EXECUTE 'DROP TABLE ' || prefix || quote_ident(tablename) || ';';
END IF;
    END LOOP;
RETURN 'OK';

END;

$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION delete_partitions(interval, text)
  OWNER TO postgres;

You can then remove old partition using the following commands

 SELECT delete_partitions('7 days', 'day')
 SELECT delete_partitions('11 months', 'month')

Permalink

Disk Usage - PostgreSQL wiki

mercredi 17 janvier 2018 à 10:52
SELECT nspname || '.' || relname AS "relation",
    pg_size_pretty(pg_relation_size(C.oid)) AS "size"
  FROM pg_class C
  LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
  WHERE nspname NOT IN ('pg_catalog', 'information_schema')
  ORDER BY pg_relation_size(C.oid) DESC
  LIMIT 20;
Permalink

Mise à jour Kernel sans reboot - Les liens de Knah Tsaeb

mardi 16 janvier 2018 à 15:51
ça marche top (testé sur debian + ubuntu et actuellement en prod). ça reload les services, le réseau, etc mais pas le hardware.
ça ressemble à un soft reboot chez android.
Permalink

Lancement de la campagne “crypto-dons” avec le Samu Social de Paris

lundi 15 janvier 2018 à 20:18
Pour ceux qui ne savent plus quoi faire de leurs BC ;-)
Permalink

OpenNews

dimanche 14 janvier 2018 à 16:25
Je crois que je vais aller sur un moto g5 plus :
Environ 5"
Lineageos compatible
Batterie changeable
NFC + 700mhz
Bon appareil photo et bonne autonomie.
Pour 250€ environ.

J'attends les soldes.
Permalink

Note: Mon futur smartphone ??? - Liens et humeurs

jeudi 11 janvier 2018 à 14:02
J'attends le moto g5 plus à moins de 220€, il serait pas mal à tous niveaux.
Compatible lineageos en plus
Permalink

La magie d'internet - HowTommy | Liens et actu en vrac

mercredi 10 janvier 2018 à 18:16
Même chose de mon côté !
Ça le ferait de se croiser. Mais les distances  n'aident pas toujours.
Permalink

on motor bike... - YouTube

lundi 8 janvier 2018 à 23:34
Très très bon.
Permalink

Microprocessor Side-Channel Attacks (CVE-2017-5715, CVE-2017-5753, CVE-2017-5754): Impact on Dell EMC products (Dell Enterprise Servers, Storage and Networking) | Dell US

lundi 8 janvier 2018 à 15:06
topo dell sur les failles CPU
Permalink

How to upgrade a single package using apt-get? - Ask Ubuntu

lundi 8 janvier 2018 à 11:33
apt-get install --only-upgrade <packagename>
Permalink

Tweet de Open Culture (@openculture), à 6 janv. à 22:16

dimanche 7 janvier 2018 à 11:18
Software Used by Hayao Miyazaki’s Animation Studio Becomes Open Source & Free to Download https://t.co/JDPRdq1Xfg https://t.co/9DjUr440K1
Permalink

Tweet de Hubert Łępicki🍳🥓🌶️🍗🥩🧀 (@hubertlepicki), à 7 janv. à 02:32

dimanche 7 janvier 2018 à 11:07
TIL: Visualize your PostgreSQL database schema with 3 commands:

$ sudo apt-get install graphviz postgresql-autodoc
$ postgresql_autodoc -t dot -d yourdatabasename
$ dot -Tpng https://t.co/5EDEoYMkWV -o schema.png
Permalink

Exchange 2013 - OWA Password Expired - Requiring DOMAIN\Username

vendredi 5 janvier 2018 à 14:47

Question
Sign in to vote
5
Sign in to vote

I found a way to default the domain:

Browse to:

C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\<latestversion>\scripts\premium\

Make a backup copy of fexppw.js, then look for this section:
        // UPN authentication isn't supported, don't fill in the username
        // if it's an email address
        //
        if (rg && rg[3].indexOf('@') == -1)
        {
            // Fill in username, set focus to password
            //
            gbid("username").value = rg[3];
            gbid("oldPwd").focus();
        }

Change the username value setting code to this:

gbid("username").value = "YOURDOMAIN\\" + rg[3];
Permalink

#mercredifiction

mercredi 20 décembre 2017 à 13:53
Arnaud ouvre sa page web. Il croit à un problème de connexion, calmement il rallume sa box. L'heure s'affiche à nouveau mais son internet est cassé : les f5 n'y font rien. Arnaud veut appeler Nico, son vieil ami informaticien, hélas, cela fait longtemps qu'il n'a plus son numéro, leurs conversations étaient tellement plus simples derrière un écran. Arnaud ne sait plus quoi faire, c'est la déprime : son 6m2 ne lui permet pas de bouger tellement ses affaires sont empilées. Ses affaires, ils ne les a pas touché depuis 4 ans, à l'époque il venait d'emménager, sa connexion avait été  activée bien avant de penser à déballer les carton. Aujourd'hui, Arnaud ouvre le petit carton beige devant lui, une paire de chaussures de volley, un ballon, un jeu de carte. Aujourd'hui Google ne fonctionnera plus. Internet est cassé #mercredifiction
Permalink

Décret n° 2016-382 du 30 mars 2016 fixant les modalités d'établissement de l'état des lieux et de prise en compte de la vétusté des logements loués à usage de résidence principale - Article 3 | Legifrance

mardi 19 décembre 2017 à 23:47
Coudé. #parcecitya
Permalink

⚡ Next INpact et les trackers

lundi 18 décembre 2017 à 13:56
<3
Permalink

Bitcoin, énergie et wtf twitterien

lundi 18 décembre 2017 à 13:52
Je crois que ploum a fait plaf....
Permalink

Cake marbré chocolat-vanille

dimanche 10 décembre 2017 à 23:58

Permalink