delete all CCM entries

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

delete all CCM entries

Post by kendallchenoweth »

Because I'm will be only the contents of the /usr/local/nagios/etc/static directory data content within a production instance of Nagios XI, I need to delete everything from the CCM. I did this once successfully, but I'm unable to recreate that effort now. What's the best way to delete everything from the CCM? I've clicked on delete for everything and deleted everything from the from the /usr/local/nagios/etc/static, but the static contents always come back along with references to some of the CCM entries references in the error. I also see these files in /usr/local/nagios/etc/cfgprep.

Since I've done this on one server, can I create an archive on that server and import into the other server? If so, how?

Thanks in advance!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: delete all CCM entries

Post by Box293 »

There has to be at least something defined for nagios to verify, hence this is why it comes with a localhost host and services. If you are deleting everything in CCM and static, then the verify will fail.
kendallchenoweth wrote:but the static contents always come back along with references to some of the CCM entries references in the error.
So whenever there is a problem applying config, everything is put back as it was before apply config was done.

As a rule of thumb, in CCM:
De-activate all dependencies and escalations and apply config.
De-activate all services and apply config.
De-activate the hosts and apply config.
If all is working OK then delete the objects.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

Re: delete all CCM entries

Post by kendallchenoweth »

Got it. Thanks. For anybody else reading this, I've attached a minimal cfg.

Code: Select all

define command {
       command_name                             check_dummy
       command_line                             $USER1$/check_dummy 0
}

define command {
       command_name                             xi_host_event_handler
       command_line                             /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore
_notification.php --notification-type=host --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --typ
e=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments="$
NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hostdi
splayname="$HOSTDISPLAYNAME$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTATEID$ --lasthoststate=$LASTHOS
TSTATE$ --lasthoststateid=$LASTHOSTSTATEID$ --hoststatetype=$HOSTSTATETYPE$ --currentattempt=$HOSTATTEMPT$
 --maxattempts=$MAXHOSTATTEMPTS$ --hosteventid=$HOSTEVENTID$ --hostproblemid=$HOSTPROBLEMID$ --hostoutput=
"$HOSTOUTPUT$" --longhostoutput="$LONGHOSTOUTPUT$" --datetime="$LONGDATETIME$"
}

define command {
       command_name                             xi_service_event_handler
       command_line                             /usr/bin/php /usr/local/nagiosxi/scripts/handle_nagioscore
_notification.php --notification-type=service --contact="$CONTACTNAME$" --contactemail="$CONTACTEMAIL$" --
type=$NOTIFICATIONTYPE$ --escalated="$NOTIFICATIONISESCALATED$" --author="$NOTIFICATIONAUTHOR$" --comments
="$NOTIFICATIONCOMMENT$" --host="$HOSTNAME$" --hostaddress="$HOSTADDRESS$" --hostalias="$HOSTALIAS$" --hos
tdisplayname="$HOSTDISPLAYNAME$" --service="$SERVICEDESC$" --hoststate=$HOSTSTATE$ --hoststateid=$HOSTSTAT
EID$ --servicestate=$SERVICESTATE$ --servicestateid=$SERVICESTATEID$ --lastservicestate=$LASTSERVICESTATE$
 --lastservicestateid=$LASTSERVICESTATEID$ --servicestatetype=$SERVICESTATETYPE$ --currentattempt=$SERVICE
ATTEMPT$ --maxattempts=$MAXSERVICEATTEMPTS$ --serviceeventid=$SERVICEEVENTID$ --serviceproblemid=$SERVICEP
ROBLEMID$ --serviceoutput="$SERVICEOUTPUT$" --longserviceoutput="$LONGSERVICEOUTPUT$" --datetime="$LONGDAT
ETIME$"
}


define contact {
        contact_name                            dummy
        alias                                   dummy
        host_notifications_enabled              0
        service_notifications_enabled           0
        host_notification_period                dummy
        service_notification_period             dummy
        host_notification_commands              xi_host_event_handler
        service_notification_commands           xi_service_event_handler
        email                                   [email protected]
        }


define service {
        host_name                       dummy
        service_description             dummy
        check_command                   check_dummy!!!!!!!!
        max_check_attempts              1
        check_interval                  5
        retry_interval                  5
        check_period                    dummy
        register                        1
        }


define host {
        host_name                       dummy
        alias                           dummy
        address                         127.0.0.1
        max_check_attempts              1
        check_interval                  5
        retry_interval                  5
        check_period                    dummy
        notification_period             dummy
        notifications_enabled           0
        _instance                       ah
        register                        1
        }


define timeperiod {
        timeperiod_name                         dummy
        alias                                   dummy
        monday                                  00:00-24:00
        }
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: delete all CCM entries

Post by tmcdonald »

Mind if I lock this up then?
Former Nagios employee
kendallchenoweth
Posts: 195
Joined: Fri Sep 13, 2013 10:43 am

Re: delete all CCM entries

Post by kendallchenoweth »

Lock it up! Thanks for your help!
Locked