Announcement

Collapse
No announcement yet.

Acknowledge Service via CLAPI

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Acknowledge Service via CLAPI

    Hello,

    is there a way to acknowledge a service/host via clapi or rest api?
    Tried setparam a.s.o. but nothing worked for me.

    Thank you for any help!

    Best regards,
    bugfix

  • #2
    Hey bugfix.. Had some needs here and after a lot of work I got it working, here is how:



    now=`date +%s`
    F="/var/lib/centreon-engine/rw/centengine.cmd"
    L="ack.log"

    if [ -z $4 ]; then
    echo "ERRRO - missing arguments: $0 host_name service author comment "
    exit 1
    else
    host_name=$1
    service=$2
    author=$3
    comment=$4
    fi

    /usr/bin/printf "[%lu] ACKNOWLEDGE_SVC_PROBLEM;${host_name};${service};1; 0;1;${author};"${comment}"\n" $now > $F

    /usr/bin/printf "[%lu] ACKNOWLEDGE_SVC_PROBLEM;${host_name};${service};1; 0;1;${author};"${comment}"\n" $now >> $L

    echo "OK"
    exit 0


    I then made a PHP via web so it calls out this bash, and I also integrated with e-mail notification, sometime notify also auto open tickets and auto acknowledge.

    cheers



    ________________________________________
    CentOS 5.5 x64 / Nagios 3.2.2 / Centreon 2.1.10
    Monitoring: 467 Hosts / 2109Services 16th Server
    NdoUtils 1.49,NagiosPlugins 1.4.14, NagVis 1.5.1, Distributed Architeture(howto)

    Nagios/Centreon Custom Scripts / Troubleshooting
    www.felipeferreira.net

    Comment

    Working...
    X