Results 1 to 3 of 3

Thread: Alert when changing !!

  1. #1
    Join Date
    Mar 2012
    Posts
    10

    Default Alert when changing !!

    There is the possibility of Centreon email every time you make a change (Insert, Modify, delete) on any host or service?

    If you can not, someone could help me create it, nor having to change my Centreon?

  2. #2
    Join Date
    Jul 2008
    Location
    France - Paris
    Posts
    4,312

    Default

    Hi,

    There si no possibility to send email for notification but you can see modification using "Aministration -> Log".
    You can get this information of changes from Centreon_storage table.
    Centreon Community Manager
    Centreon Syslog Module Manager/Developper
    Centreon E2S Module Manager/Developper
    Centreon Enterprise Server (2.0 / 2.2 / 3.0) : Centreon Engine 1.3.x, Centreon Broker 2.6.x, Centreon 2.x, Centreon-Syslog 1.5.x, Centreon E2S 2.0
    Nagios 3.x et NDOutil 1.x

  3. #3
    Join Date
    Mar 2012
    Posts
    10

    Default [Resolved] - I got a solution !!

    I got it, I made the modification in the file:
    vi /usr/local/centreon/www/class/centreonLogAction.class.php

    Insert the following functions before the function insertLog:
    /*
    * returns the contact name
    */
    function getContactname1($id)
    {
    global $pearDB;

    $DBRESULT = $pearDB->query("SELECT contact_name FROM `contact` WHERE contact_id = '$id' LIMIT 1");
    while ($data = $DBRESULT->fetchRow())
    $name = $data["contact_name"];
    unset($data);
    $DBRESULT->free();
    return $name;
    }


    /*
    * Display clear action labels
    */
    function replaceActiontype1($action)
    {
    $actionList = array();
    $actionList["d"] = "Delete";
    $actionList["c"] = "Change";
    $actionList["a"] = "Create";
    $actionList["disable"] = "Disable";
    $actionList["enable"] = "Enable";
    $actionList["mc"] = "Massive change";

    foreach ($actionList as $key => $value) {
    if ($action == $key)
    $action = $value;
    }
    return $action;
    }

    Insert inside the function insertLog :

    $contactName = $this->getContactname1($this->logUser->user_id);
    $actionTypeEx = $this->replaceActiontype1($action_type);
    $alteracoes = "Nome: ". $object_name . " Tipo: " . $object_type . " Action: " . $actionTypeEx . " Alterado por: " . $contactNamae;

    Insert the following line below the line $ this-> insertFieldsNameValue ($ LogId ["MAX (action_log_id)"], $ fields);:
    system('echo -ne "' . $alteracoes . '" | nail -r seuEmail@XXXX.com -s "Alteração no Centreon ['. $actionTypeEx .'] - ' . $object_name . '" -S smtp=smtp.XXXX.com destino@XXXXX.com');

    You must have nail installed
    !

    Any changes made to Centreon, it will send email to recipients. It was helpful to us because we have many analysts and sometimes we are not aware of the changes made.
    Last edited by Tomassoni; 16th April 2012 at 14:31.

Similar Threads

  1. Replies: 2
    Last Post: 15th November 2011, 20:02
  2. Changing disk use graph Y axis scale
    By kevinkenny in forum Interface
    Replies: 3
    Last Post: 21st May 2011, 08:00
  3. Changing service schdule
    By Hicham in forum Setup
    Replies: 1
    Last Post: 2nd March 2011, 13:32
  4. Changing / Clearing Perfdata
    By bomahony in forum Setup
    Replies: 2
    Last Post: 24th September 2010, 16:23
  5. Changing MySQL Servers
    By SeanFromIT in forum Setup
    Replies: 3
    Last Post: 15th February 2008, 10:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •