Add service detail view

refs #4181
This commit is contained in:
Jannis Moßhammer 2013-07-22 16:03:36 +02:00
parent a0f96379a9
commit a0839ea0da
85 changed files with 3786 additions and 200 deletions

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Application;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Application;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Authentication\Backend;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Authentication;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Authentication;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Authentication;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Authentication;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Authentication;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}}
namespace Icinga\Authentication;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\Criteria;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\DataView;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\DataView;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\Statusdat\DataView;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\Statusdat\DataView;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Backend\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Exception;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Exception;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Exception;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Exception;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Exception;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Form;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Commandpipe;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Commandpipe;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Commandpipe;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Commandpipe;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Commandpipe\Exception;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Commandpipe;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Commandpipe;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Ldap;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Ldap;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Ldap;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Ldap;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Ldap;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Ldap;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat\Exception;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat\Query;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat\Query;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat\Query;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Protocol\Statusdat;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web\Hook\Configuration;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web\Hook\Configuration;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web\Hook\Configuration;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web\Hook;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web\Hook;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web;

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web\Paginator\Adapter;

View File

@ -2,6 +2,27 @@
// @codingStandardsIgnoreStart
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
/**

View File

@ -1,5 +1,26 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Web;

View File

@ -36,7 +36,7 @@ class Monitoring_ShowController extends ModuleActionController
$this->backend = Backend::getInstance($this->_getParam('backend'));
if ($service !== null && $service !== '*') {
$this->view->service = $this->backend->fetchService($host, $service);
$this->view->service = $this->backend->fetchService($host, $service, true);
}
if ($host !== null) {
$this->view->host = $this->backend->fetchHost($host, true);
@ -210,6 +210,27 @@ class Monitoring_ShowController extends ModuleActionController
->where('host_name', $this->view->host->host_name)
->fetchAll();
$this->view->downtimes = $this->backend->select()
->from(
'downtime',
array(
'host_name',
'downtime_type',
'downtime_author_name',
'downtime_comment_data',
'downtime_is_fixed',
'downtime_duration',
'downtime_scheduled_start_time',
'downtime_scheduled_end_time',
'downtime_actual_start_time',
'downtime_was_started',
'downtime_is_in_effect',
'downtime_internal_downtime_id'
)
)
->where('host_name', $this->view->host->host_name)
->fetchAll();
$this->view->customvars = $this->backend->select()
->from(
'customvar',

View File

@ -0,0 +1,88 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
use Icinga\Monitoring\Command\Meta;
/**
* Class MonitoringCommands
*
* Helper which produces a list of command buttons
* depending on object states
*/
class Zend_View_Helper_MonitoringCommands extends Zend_View_Helper_Abstract
{
/**
* @param stdClass $object host or service object or something other
* @param string $type small or full
* @return string html output
*/
public function monitoringCommands(\stdClass $object, $type)
{
$commands = new Meta();
$definitions = $commands->getCommandForObject($object, $type);
$out = '<div>';
$i = 0;
foreach ($definitions as $definition) {
if ($i % 5 === 0) {
$out .= '</div><div class="command-section pull-left">';
}
if ($type === Meta::TYPE_FULL) {
$out .= '<div>';
}
$out .= sprintf(
'<button type="button" data-target="command"'
. ' data-command-id="%1$s" class="btn %5$s"'
. ' title="%3$s">'
. '<i class="%4$s"></i> %2$s'
. '</button>',
$definition->id,
$definition->shortDescription,
$definition->longDescription,
$definition->iconCls,
$definition->btnCls
);
if ($type === Meta::TYPE_FULL) {
$out .= '</div>';
}
$i++;
}
$out .= '</div>';
$out .= '<div class="clearfix"></div>';
if ($type === Meta::TYPE_FULL) {
return '<div class="command-container">'. $out. '</div>';
}
return $out;
}
}

View File

@ -0,0 +1,56 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Class Zend_View_Helper_MonitoringFlags
*
* Rendering helper for flags depending on objects
*/
class Zend_View_Helper_MonitoringFlags extends Zend_View_Helper_Abstract
{
/**
* Key of flags without prefix (e.g. host or service)
* @var string[]
*/
private static $keys = array(
'passive_checks_enabled' => 'Passive checks',
'active_checks_enabled' => 'Active checks',
'obsess_over_host' => 'Obsessing',
'notifications_enabled' => 'Notifications',
'event_handler_enabled' => 'Event handler',
'flap_detection_enabled' => 'Flap detection',
);
/**
* Type prefix
* @param array $vars
* @return string
*/
private function getObjectType(array $vars)
{
return array_shift(explode('_', array_shift(array_keys($vars)), 2));
}
/**
* Build all existing flags to a readable array
* @param stdClass $object
* @return array
*/
public function monitoringFlags(\stdClass $object)
{
$vars = (array)$object;
$type = $this->getObjectType($vars);
$out = array();
foreach (self::$keys as $key => $name) {
$value = false;
if (array_key_exists(($realKey = $type. '_'. $key), $vars)) {
$value = $vars[$realKey] === '1' ? true : false;
}
$out[$name] = $value;
}
return $out;
}
}

View File

@ -0,0 +1,250 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Class Zend_View_Helper_MonitoringProperties
*/
class Zend_View_Helper_MonitoringProperties extends Zend_View_Helper_Abstract
{
/**
* Value for check type active
*/
const CHECK_ACTIVE = 'ACTIVE';
/**
* Value for check type passive
*/
const CHECK_PASSIVE = 'PASSIVE';
/**
* Value for check type disabled
*/
const CHECK_DISABLED = 'DISABLED';
/**
* Return value for not available
*/
const VALUE_NA = 'N/A';
/**
* Return value for "YES"
*/
const VALUE_YES = 'YES';
/**
* Return value for "NO"
*/
const VALUE_NO = 'NO';
/**
* Label / value mapping for object keys
*
* Keys can be callables in this object
*
* @var array
*/
private static $keys = array(
'buildAttempt' => 'Current attempt',
'last_check' => 'Last check time',
'buildCheckType' => 'Check type',
'buildLatency' => 'Check latency / duration',
'buildNextCheck' => 'Next scheduled active check',
'buildLastStateChange' => 'Last state change',
'buildLastNotification' => 'Last notification',
'buildFlapping' => 'Is this %s flapping?',
'buildScheduledDowntime' => 'In scheduled downtime?',
'status_update_time' => 'Last update'
);
/**
* Return the object type
* @param stdClass $object
* @return mixed
*/
private function getObjectType(\stdClass $object)
{
return array_shift(explode('_', array_shift(array_keys(get_object_vars($object))), 2));
}
/**
* Drop all object specific attribute prefixes
* @param stdClass $object
* @param $type
* @return object
*/
private function dropObjectType(\stdClass $object, $type)
{
$vars = get_object_vars($object);
$out = array();
foreach ($vars as $name => $value) {
$name = str_replace($type. '_', '', $name);
$out[$name] = $value;
}
return (object)$out;
}
/**
* Get string for attempt
* @param stdClass $object
* @return string
*/
private function buildAttempt(\stdClass $object)
{
return sprintf(
'%s/%s (%s state)',
$object->current_check_attempt,
$object->max_check_attempts,
($object->state_type === '1') ? 'HARD' : 'SOFT'
);
}
/**
* Generic fomatter for float values
* @param $value
* @return string
*/
private function floatFormatter($value)
{
return sprintf('%.4f', $value);
}
/**
* Get the string for check type
* @param stdClass $object
* @return string
*/
private function buildCheckType(\stdClass $object)
{
if ($object->passive_checks_enabled === '1' && $object->active_checks_enabled === '0') {
return self::CHECK_PASSIVE;
} elseif ($object->passive_checks_enabled === '0' && $object->active_checks_enabled === '0') {
return self::CHECK_DISABLED;
}
return self::CHECK_ACTIVE;
}
/**
* Get string for latency
* @param stdClass $object
* @return string
*/
private function buildLatency(\stdClass $object)
{
$val = '';
if ($this->buildCheckType($object) === self::CHECK_PASSIVE) {
$val .= self::VALUE_NA;
} else {
$val .= $this->floatFormatter($object->latency);
}
$val .= ' / '. $this->floatFormatter($object->execution_time). ' seconds';
return $val;
}
/**
* Get string for next check
* @param stdClass $object
* @return string
*/
private function buildNextCheck(\stdClass $object)
{
if ($this->buildCheckType($object) === self::CHECK_PASSIVE) {
return self::VALUE_NA;
} else {
return $object->next_check;
}
}
/**
* Get date for last state change
* @param stdClass $object
* @return string
*/
private function buildLastStateChange(\stdClass $object)
{
return strftime('%Y-%m-%d %H:%M:%S', $object->last_state_change);
}
/**
* Get string for "last notification"
* @param stdClass $object
* @return string
*/
private function buildLastNotification(\stdClass $object)
{
$val = '';
if ($object->last_notification === '0000-00-00 00:00:00') {
$val .= self::VALUE_NA;
} else {
$val .= $object->last_notification;
}
$val .= sprintf(' (notification %d)', $object->current_notification_number);
return $val;
}
/**
* Get string for "is flapping"
* @param stdClass $object
* @return string
*/
private function buildFlapping(\stdClass $object)
{
$val = '';
if ($object->is_flapping === '0') {
$val .= self::VALUE_NO;
} else {
$val .= self::VALUE_YES;
}
$val .= sprintf(' (%.2f%% state change)', $object->percent_state_change);
return $val;
}
/**
* Get string for scheduled downtime
* @param stdClass $object
* @return string
*/
private function buildScheduledDowntime(\stdClass $object)
{
if ($object->in_downtime === '1') {
return self::VALUE_YES;
}
return self::VALUE_NO;
}
/**
* Get an array which represent monitoring properties
*
* @param stdClass $object
* @return array
*/
public function monitoringProperties(\stdClass $object)
{
$type = $this->getObjectType($object);
$object = $this->dropObjectType($object, $type);
$out = array();
foreach (self::$keys as $property => $label) {
$label = sprintf($label, $type);
if (is_callable(array(&$this, $property))) {
$out[$label] = $this->$property($object);
} elseif (isset($object->{$property})) {
$out[$label] = $object->{$property};
}
}
return $out;
}
}

View File

@ -1,5 +1,5 @@
<?php if (! empty($this->comments)): ?>
<?php if (! empty($this->comments)) { ?>
<?
$list = array();
foreach ($this->comments as $comment) {
@ -28,4 +28,4 @@ foreach ($this->comments as $comment) {
<blockquote> <?= implode('<br />', $list) ?></blockquote>
</div>
<?php endif; ?>
<?php } ?>

View File

@ -0,0 +1,43 @@
<?php if (!empty($this->downtimes)) { ?>
<?php
$list = array();
foreach ($this->downtimes as $downtime) {
$row = array();
if ($downtime->downtime_is_in_effect === '1') {
$row[] = 'Running<br />since '. $this->timeSince($downtime->downtime_actual_start_time);
} else {
if ($downtime->downtime_is_fixed) {
$row[] = 'Scheduled<br />for '. $downtime->downtime_scheduled_start_time;
} else {
$row[] = 'Waiting';
}
}
$row[] = sprintf(
'Triggered by %s: <em>%s</em>',
$downtime->downtime_author_name,
$downtime->downtime_comment_data
);
$row[] = '<button type="button" data-target="command" class="btn btn-warning"'
. ' data-command-id="29" data-command-info="'. $downtime->downtime_internal_downtime_id. '"'
. '><i class="icon-delete"></i> Delete'
. '</button>';
$list[] = '<td>'. implode('</td><td>', $row). '</td>';
}
?>
<div class="information-container">
<div class="head">
<span>Downtimes</span>
</div>
<div>
<table>
<tr>
<?= implode('</tr><tr>', $list); ?>
</tr>
</table>
</div>
</div>
<?php } ?>

View File

@ -0,0 +1,25 @@
<?php
$object = null;
if (isset($this->service)) {
$object = $this->service;
} elseif (isset($this->host)) {
$object = $this->host;
}
$flags = $this->monitoringFlags($object);
?>
<table class="flag-container">
<?php foreach ($flags as $name => $value) { ?>
<tr>
<th><?= $name; ?></th>
<td>
<?php if ($value === true) { ?>
<span class="flag flag-enabled">ENABLED</span>
<?php } else { ?>
<span class="flag flag-disabled">DISABLED</span>
<?php } ?>
</td>
</tr>
<?php } ?>
</table>

View File

@ -0,0 +1,19 @@
<?php
$object = null;
if (isset($this->service)) {
$object = $this->service;
} elseif (isset($this->host)) {
$object = $this->host;
}
$properties = $this->monitoringProperties($object);
?>
<table>
<?php foreach ($properties as $label => $value) { ?>
<tr>
<th><?= $label ?></th>
<td><?= $value ?></td>
</tr>
<?php } ?>
</table>

View File

@ -18,22 +18,23 @@ if (!$this->compact) {
<div class="information-container">
<?php if ($inlineCommands === true) { ?>
<div class="pull-right">
<div>
<button type="button" class="btn btn-primary">
<span>Check now</span>
</button>
</div>
<div class="container-spacer">
<button type="button" class="btn btn-danger">
<span>Acknowledge</span>
</button>
</div>
<?=
$this->monitoringCommands(
($showService === true) ? $this->service : $this->host,
'small'
);
?>
</div>
<?php } ?>
<table>
<tr class="<?= $this->monitoringState($this->host, 'host') ?><?= $this->host->host_handled ? ' handled' : '' ?>">
<td>
<?php if ($this->service->host_icon_image): ?>
<div class="monitoring_icon">
<img src="<?= $this->service->host_icon_image; ?>" alt="Host image" />
</div>
<?php endif; ?>
<strong>
<?= $this->escape($this->host->host_name); ?>
<?php if ($this->host->host_address && $this->host->host_address !== $this->host->host_name) { ?>
@ -46,14 +47,22 @@ if (!$this->compact) {
<sup>(<?= $this->host->host_alias; ?>)</sup>
<?php } ?>
</td>
<td class="state"<?= $showService ? '' : ' rowspan="2"'; ?>>
<td class="state"<?= $showService ? '' : ' rowspan="2"'; ?>
<?= $this->util()->getHostStateName($this->host->host_state); ?>
since <?= $this->timeSince($this->host->host_last_state_change); ?>
<?php if ($this->host->host_acknowledged === '1') { ?>
(Has been acknowledged)
<?php } ?>
</td>
</tr>
<?php if ($showService === true) { ?>
<?php if ($showService === true): ?>
<tr class="<?= $this->monitoringState($this->service, 'service'); ?><?= $this->service->service_handled ? ' handled' : '' ?>">
<td>
<?php if ($this->service->service_icon_image): ?>
<div class="monitoring_icon">
<img src="<?= $this->service->service_icon_image; ?>" alt="Host image" />
</div>
<?php endif; ?>
<strong>
Service: <?= $this->escape($this->service->service_description); ?>
</strong>
@ -61,12 +70,26 @@ if (!$this->compact) {
<td class="state">
<?= $this->util()->getServiceStateName($this->service->service_state); ?>
since <?= $this->timeSince($this->service->service_last_state_change); ?>
<?php if ($this->service->service_acknowledged === '1') { ?>
(Has been acknowledged)
<?php } ?>
</td>
</tr>
<?php } else { ?>
<?php // BYPASS ?>
<?php } ?>
</table>
<?php if ($this->service->service_action_url || $this->service->service_notes_url): ?>
<tr>
<td class="urls" rowspan="2">
<span class="url">
<a href='<?= $this->service->service_notes_url ?>'>Actions </a>
</span>
<span class="url">
<a href='<?= $this->service->service_notes_url ?>'>Notes </a>
</span>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
</table>
<div class="clearfix"></div>
</div>

View File

@ -11,8 +11,6 @@
);
}
}
var_dump($this->host);
?>
<?=
$this->partial(
@ -64,6 +62,8 @@ var_dump($this->host);
<?= $this->render('show/components/comments.phtml'); ?>
<?= $this->render('show/components/downtime.phtml'); ?>
<?= $this->render('show/components/customvars.phtml'); ?>
<?php if ($this->host->host_perfdata): ?>
@ -75,4 +75,31 @@ var_dump($this->host);
<?= $this->perfdata($this->host->host_perfdata); ?>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
<div class="information-container">
<div class="head">
<span>Flags</span>
</div>
<div>
<?= $this->render('show/components/flags.phtml'); ?>
</div>
</div>
<div class="information-container">
<div class="head">
<span>Properties</span>
</div>
<div>
<?= $this->render('show/components/properties.phtml'); ?>
</div>
</div>
<div class="information-container">
<div class="head">
<span>Commands</span>
</div>
<div>
<?= $this->monitoringCommands($this->host, 'full'); ?>
</div>
</div>

View File

@ -1,31 +1,105 @@
<?= $this->partial('show/header.phtml', array(
'host' => $this->host,
'service' => $this->service,
'tabs' => $this->tabs,
'compact' => $this->compact
)); ?>
<?= $this->expandable(
$this->pluginOutput($this->service->service_output),
$this->pluginOutput($this->service->service_long_output)
) ?>
<?php
$servicegroupLinkList = array();
if (!empty($this->hostgroups)) {
foreach ($this->hostgroups as $name => $alias) {
$servicegroupLinkList[] = $this->qlink(
$alias,
'monitoring/list/services',
array(
'servicegroups' => $name
)
);
}
}
?>
<?=
$this->partial(
'show/header.phtml',
array(
'host' => $this->host,
'service' => $this->service,
'tabs' => $this->tabs,
'compact' => $this->compact
)
);
?>
<?= $this->render('show/components/contacts.phtml') ?>
<?= $this->render('show/components/comments.phtml') ?>
<?= $this->preview_image ?>
<div class="information-container">
<div class="head">
<span>Plugin output</span>
</div>
<div>
<?= $this->pluginOutput($this->service->service_output); ?>
<?= $this->pluginOutput($this->service->service_long_output); ?>
</div>
</div>
<div class="information-container">
<div class="head">
<span>Command</span>
</div>
<div>
<strong>Command:</strong>
<?= array_shift(explode('!', $this->service->service_check_command, 2)); ?>
<?= $this->commandArguments($this->service->service_check_command); ?>
</div>
</div>
<div class="information-container">
<div class="head">
<span>Groups and Contacts</span>
</div>
<?php if (count($servicegroupLinkList)) { ?>
<strong>Servicegroups:</strong>
<?= implode(' ', $servicegroupLinkList); ?>
<?php } ?>
<?= $this->render('show/components/contacts.phtml') ?>
</div>
<?= $this->render('show/components/comments.phtml'); ?>
<?= $this->render('show/components/downtime.phtml'); ?>
<?= $this->render('show/components/customvars.phtml'); ?>
<?php foreach ($this->customvars as $name => $value): ?>
<b><?= $this->escape($name) ?>:</b> <?= $this->escape($value) ?><br />
<?php endforeach; ?>
<?= $this->expandable(
'<b>Command:</b> ' . array_shift(preg_split('|!|', $this->service->service_check_command)),
$this->commandArguments($this->service->service_check_command)
) ?>
<?php if ($this->service->service_perfdata): ?>
<?= $this->expandable(
'<b>Performance data</b>:',
$this->perfdata($this->service->service_perfdata),
array('collapsed' => false)
) ?>
<div class="information-container">
<div class="head">
<span>Perfdata</span>
</div>
<div>
<?= $this->perfdata($this->service->service_perfdata); ?>
</div>
</div>
<?php endif; ?>
<?= $this->partial('show/legacy-service.phtml', array('service' => $this->service)) ?>
<?= $this->preview_image ?>
<div class="information-container">
<div class="head">
<span>Flags</span>
</div>
<div>
<?= $this->render('show/components/flags.phtml'); ?>
</div>
</div>
<div class="information-container">
<div class="head">
<span>Properties</span>
</div>
<div>
<?= $this->render('show/components/properties.phtml'); ?>
</div>
</div>
<div class="information-container">
<div class="head">
<span>Commands</span>
</div>
<div>
<?= $this->monitoringCommands($this->service, 'full'); ?>
</div>
</div>

View File

@ -84,7 +84,13 @@ class AbstractBackend implements DatasourceInterface
}
// UGLY temporary host fetch
/**
* UGLY temporary host fetch
*
* @param string $host
* @param bool $fetchAll
* @return mixed
*/
public function fetchHost($host, $fetchAll = false)
{
$fields = array(
@ -102,49 +108,52 @@ class AbstractBackend implements DatasourceInterface
'host_perfdata'
);
$fields = array_merge(
$fields,
array(
'current_check_attempt',
'max_check_attempts',
'attempt',
'last_check',
'next_check',
'check_type',
'last_state_change',
'last_hard_state_change',
'last_hard_state',
'last_time_up',
'last_time_down',
'last_time_unreachable',
'state_type',
'last_notification',
'next_notification',
'no_more_notifications',
'notifications_enabled',
'problem_has_been_acknowledged',
'acknowledgement_type',
'current_notification_number',
'passive_checks_enabled',
'active_checks_enabled',
'event_handler_enabled',
'flap_detection_enabled',
'is_flapping',
'percent_state_change',
'latency',
'execution_time',
'scheduled_downtime_depth',
'failure_prediction_enabled',
'process_performance_data',
'obsess_over_host',
'modified_host_attributes',
'event_handler',
'check_command',
'normal_check_interval',
'retry_check_interval',
'check_timeperiod_object_id'
)
);
if ($fetchAll === true) {
$fields = array_merge(
$fields,
array(
'host_current_check_attempt',
'host_max_check_attempts',
'host_attempt',
'host_last_check',
'host_next_check',
'host_check_type',
'host_last_state_change',
'host_last_hard_state_change',
'host_last_hard_state',
'host_last_time_up',
'host_last_time_down',
'host_last_time_unreachable',
'host_state_type',
'host_last_notification',
'host_next_notification',
'host_no_more_notifications',
'host_notifications_enabled',
'host_problem_has_been_acknowledged',
'host_acknowledgement_type',
'host_current_notification_number',
'host_passive_checks_enabled',
'host_active_checks_enabled',
'host_event_handler_enabled',
'host_flap_detection_enabled',
'host_is_flapping',
'host_percent_state_change',
'host_latency',
'host_execution_time',
'host_scheduled_downtime_depth',
'host_failure_prediction_enabled',
'host_process_performance_data',
'host_obsess_over_host',
'host_modified_host_attributes',
'host_event_handler',
'host_check_command',
'host_normal_check_interval',
'host_retry_check_interval',
'host_check_timeperiod_object_id',
'host_status_update_time'
)
);
}
$select = $this->select()
->from('status', $fields)
@ -153,74 +162,83 @@ class AbstractBackend implements DatasourceInterface
}
// UGLY temporary service fetch
public function fetchService($host, $service)
public function fetchService($host, $service, $fetchAll = false)
{
Benchmark::measure('Preparing service select');
$select = $this->select()
->from(
'status',
array(
$fields = array(
'service_description',
'host_name',
'host_address',
'host_state',
'host_handled',
'host_icon_image',
'service_state',
'service_handled',
'service_in_downtime',
'service_acknowledged',
'service_check_command',
'service_last_state_change',
'service_display_name',
'service_output',
'service_long_output',
'service_perfdata',
'service_action_url',
'service_notes_url',
'service_icon_image'
);
'host_name',
'host_state',
'host_check_command',
'host_last_state_change',
'service_description',
'service_state',
'service_acknowledged',
'service_handled',
'service_output',
'service_long_output',
'service_perfdata',
// '_host_satellite',
'service_check_command',
'service_last_state_change',
if ($fetchAll === true) {
$fields = array_merge(
$fields,
array(
'service_current_check_attempt',
'service_max_check_attempts',
'service_attempt',
'service_last_check',
'service_next_check',
'service_check_execution_time',
'service_check_latency',
// 'service_
'service_check_type',
'service_last_state_change',
'service_last_hard_state_change',
'service_last_hard_state',
'service_last_time_ok',
'service_last_time_warning',
'service_last_time_unknown',
'service_last_time_critical',
'service_state_type',
'service_last_notification',
'service_next_notification',
'service_no_more_notifications',
'service_notifications_enabled',
'service_problem_has_been_acknowledged',
'service_acknowledgement_type',
'service_current_notification_number',
'service_passive_checks_enabled',
'service_active_checks_enabled',
'service_event_handler_enabled',
'service_flap_detection_enabled',
'service_is_flapping',
'service_percent_state_change',
'service_latency',
'service_execution_time',
'service_scheduled_downtime_depth',
'service_failure_prediction_enabled',
'service_process_performance_data',
'service_obsess_over_service',
'service_modified_service_attributes',
'service_event_handler',
'service_check_command',
'service_normal_check_interval',
'service_retry_check_interval',
'service_check_timeperiod_object_id',
'service_status_update_time'
)
)
->where('host_name', $host)
->where('service_description', $service);
// Benchmark::measure((string) $select->getQuery());
Benchmark::measure('Prepared service select');
);
}
$select = $this->select()
->from('status', $fields)
->where('host_name', $host);
return $select->fetchRow();
$object = \Icinga\Objects\Service::fromBackend(
$this->select()
->from(
'status',
array(
'host_name',
'host_state',
'host_check_command',
'host_last_state_change',
'service_description',
'service_state',
'service_acknowledged',
'service_handled',
'service_output',
'service_long_output',
'service_perfdata',
// '_host_satellite',
'service_check_command',
'service_last_state_change',
'service_last_check',
'service_next_check',
'service_check_execution_time',
'service_check_latency',
// 'service_
)
)
->where('host_name', $host)
->where('service_description', $service)
->fetchRow()
);
// $object->customvars = $this->fetchCustomvars($host, $service);
return $object;
}

View File

@ -0,0 +1,98 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Monitoring\Backend\Ido\Query;
/**
* Class DowntimeQuery
*/
class DowntimeQuery extends AbstractQuery
{
/**
* Column map
* @var array
*/
protected $columnMap = array(
'downtime' => array(
'downtime_type' => 'sd.downtime_type',
'downtime_author_name' => 'sd.author_name',
'downtime_comment_data' => 'sd.comment_data',
'downtime_is_fixed' => 'sd.is_fixed',
'downtime_duration' => 'sd.duration',
'downtime_scheduled_start_time' => 'sd.scheduled_start_time',
'downtime_scheduled_end_time' => 'sd.scheduled_end_time',
'downtime_was_started' => 'sd.was_started',
'downtime_actual_start_time' => 'sd.actual_start_time',
'downtime_actual_start_time_usec' => 'sd.actual_start_time_usec',
'downtime_is_in_effect' => 'sd.is_in_effect',
'downtime_trigger_time' => 'sd.trigger_time',
'downtime_internal_downtime_id' => 'sd.internal_downtime_id'
),
'hosts' => array(
'host_name' => 'ho.name1',
),
'services' => array(
'service_host_name' => 'so.name1',
'service_description' => 'so.name2',
)
);
/**
* Join with scheduleddowntime
*/
protected function joinBaseTables()
{
$this->baseQuery = $this->db->select()->from(
array('sd' => $this->prefix . 'scheduleddowntime'),
array()
);
$this->joinedVirtualTables = array('downtime' => true);
}
/**
* Join if host needed
*/
protected function joinHosts()
{
$this->baseQuery->join(
array('ho' => $this->prefix . 'objects'),
'sd.object_id = ho.object_id AND ho.is_active = 1 AND ho.objecttype_id = 1',
array()
);
}
/**
* Join if services needed
*/
protected function joinServices()
{
$this->baseQuery->join(
array('so' => $this->prefix . 'objects'),
'so.object_id = ho.object_id AND ho.is_active = 1 AND ho.objecttype_id = 2',
array()
);
}
}

View File

@ -15,6 +15,8 @@ class StatusQuery extends AbstractQuery
'host_address' => 'h.address',
'host_ipv4' => 'INET_ATON(h.address)',
'host_icon_image' => 'h.icon_image',
'host_action_url' => 'h.action_url',
'host_notes_url' => 'h.notes_url'
),
'hoststatus' => array(
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END',
@ -29,44 +31,44 @@ class StatusQuery extends AbstractQuery
'host_last_state_change' => 'UNIX_TIMESTAMP(hs.last_state_change)',
'host_check_command' => 'hs.check_command',
'current_check_attempt' => 'hs.current_check_attempt',
'max_check_attempts' => 'hs.max_check_attempts',
'attempt' => 'CONCAT(hs.current_check_attempt, "/", hs.max_check_attempts)',
'last_check' => 'hs.last_check',
'next_check' => 'hs.next_check',
'check_type' => 'hs.check_type',
'last_state_change' => 'hs.last_state_change',
'last_hard_state_change' => 'hs.last_hard_state_change',
'last_hard_state' => 'hs.last_hard_state',
'last_time_up' => 'hs.last_time_up',
'last_time_down' => 'hs.last_time_down',
'last_time_unreachable' => 'hs.last_time_unreachable',
'state_type' => 'hs.state_type',
'last_notification' => 'hs.last_notification',
'next_notification' => 'hs.next_notification',
'no_more_notifications' => 'hs.no_more_notifications',
'notifications_enabled' => 'hs.notifications_enabled',
'problem_has_been_acknowledged' => 'hs.problem_has_been_acknowledged',
'acknowledgement_type' => 'hs.acknowledgement_type',
'current_notification_number' => 'hs.current_notification_number',
'passive_checks_enabled' => 'hs.passive_checks_enabled',
'active_checks_enabled' => 'hs.active_checks_enabled',
'event_handler_enabled' => 'hs.event_handler_enabled',
'flap_detection_enabled' => 'hs.flap_detection_enabled',
'is_flapping' => 'hs.is_flapping',
'percent_state_change' => 'hs.percent_state_change',
'latency' => 'hs.latency',
'execution_time' => 'hs.execution_time',
'scheduled_downtime_depth' => 'hs.scheduled_downtime_depth',
'failure_prediction_enabled' => 'hs.failure_prediction_enabled',
'process_performance_data' => 'hs.process_performance_data',
'obsess_over_host' => 'hs.obsess_over_host',
'modified_host_attributes' => 'hs.modified_host_attributes',
'event_handler' => 'hs.event_handler',
'check_command' => 'hs.check_command',
'normal_check_interval' => 'hs.normal_check_interval',
'retry_check_interval' => 'hs.retry_check_interval',
'check_timeperiod_object_id' => 'hs.check_timeperiod_object_id',
'host_current_check_attempt' => 'hs.current_check_attempt',
'host_max_check_attempts' => 'hs.max_check_attempts',
'host_attempt' => 'CONCAT(hs.current_check_attempt, "/", hs.max_check_attempts)',
'host_last_check' => 'hs.last_check',
'host_next_check' => 'hs.next_check',
'host_check_type' => 'hs.check_type',
'host_last_hard_state_change' => 'hs.last_hard_state_change',
'host_last_hard_state' => 'hs.last_hard_state',
'host_last_time_up' => 'hs.last_time_up',
'host_last_time_down' => 'hs.last_time_down',
'host_last_time_unreachable' => 'hs.last_time_unreachable',
'host_state_type' => 'hs.state_type',
'host_last_notification' => 'hs.last_notification',
'host_next_notification' => 'hs.next_notification',
'host_no_more_notifications' => 'hs.no_more_notifications',
'host_notifications_enabled' => 'hs.notifications_enabled',
'host_problem_has_been_acknowledged' => 'hs.problem_has_been_acknowledged',
'host_acknowledgement_type' => 'hs.acknowledgement_type',
'host_current_notification_number' => 'hs.current_notification_number',
'host_passive_checks_enabled' => 'hs.passive_checks_enabled',
'host_active_checks_enabled' => 'hs.active_checks_enabled',
'host_event_handler_enabled' => 'hs.event_handler_enabled',
'host_flap_detection_enabled' => 'hs.flap_detection_enabled',
'host_is_flapping' => 'hs.is_flapping',
'host_percent_state_change' => 'hs.percent_state_change',
'host_latency' => 'hs.latency',
'host_execution_time' => 'hs.execution_time',
'host_scheduled_downtime_depth' => 'hs.scheduled_downtime_depth',
'host_failure_prediction_enabled' => 'hs.failure_prediction_enabled',
'host_process_performance_data' => 'hs.process_performance_data',
'host_obsess_over_host' => 'hs.obsess_over_host',
'host_modified_host_attributes' => 'hs.modified_host_attributes',
'host_event_handler' => 'hs.event_handler',
'host_check_command' => 'hs.check_command',
'host_normal_check_interval' => 'hs.normal_check_interval',
'host_retry_check_interval' => 'hs.retry_check_interval',
'host_check_timeperiod_object_id' => 'hs.check_timeperiod_object_id',
'host_status_update_time' => 'hs.status_update_time',
'host_problems' => 'CASE WHEN hs.current_state = 0 THEN 0 ELSE 1 END',
'host_severity' => 'CASE WHEN hs.current_state = 0
@ -110,27 +112,60 @@ class StatusQuery extends AbstractQuery
'service_description' => 'so.name2',
'service_display_name' => 's.display_name',
'service_icon_image' => 's.icon_image',
'service_action_url' => 's.action_url',
'service_notes_url' => 's.notes_url'
),
'servicestatus' => array(
'current_state' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN 99 ELSE ss.current_state END',
'service_state' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN 99 ELSE ss.current_state END',
'service_hard_state' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN 99 ELSE CASE WHEN ss.state_type = 1 THEN ss.current_state ELSE ss.last_hard_state END END',
'service_state_type' => 'ss.state_type',
'service_output' => 'ss.output',
'service_long_output' => 'ss.long_output',
'service_perfdata' => 'ss.perfdata',
'service_acknowledged' => 'ss.problem_has_been_acknowledged',
'service_in_downtime' => 'CASE WHEN (ss.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END',
'service_handled' => 'CASE WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth + COALESCE(hs.current_state, 0)) > 0 THEN 1 ELSE 0 END',
'service_handled' => 'CASE WHEN (ss.problem_has_been_acknowledged + ss.scheduled_downtime_depth) > 0 THEN 1 ELSE 0 END',
'service_does_active_checks' => 'ss.active_checks_enabled',
'service_accepts_passive_checks' => 'ss.passive_checks_enabled',
'service_last_state_change' => 'UNIX_TIMESTAMP(ss.last_state_change)',
'service_last_hard_state_change' => 'UNIX_TIMESTAMP(ss.last_hard_state_change)',
'service_check_command' => 'ss.check_command',
'service_last_check' => 'UNIX_TIMESTAMP(ss.last_check)',
'service_next_check' => 'CASE WHEN ss.should_be_scheduled THEN UNIX_TIMESTAMP(ss.next_check) ELSE NULL END',
'service_check_execution_time' => 'ss.execution_time',
'service_check_latency' => 'ss.latency',
'service_last_time_ok' => 'ss.last_time_ok',
'service_last_time_warning' => 'ss.last_time_warning',
'service_last_time_critical' => 'ss.last_time_critical',
'service_last_time_unknown' => 'ss.last_time_unknown',
'service_current_check_attempt' => 'ss.current_check_attempt',
'service_max_check_attempts' => 'ss.max_check_attempts',
'service_attempt' => 'CONCAT(ss.current_check_attempt, "/", ss.max_check_attempts)',
'service_last_check' => 'ss.last_check',
'service_next_check' => 'ss.next_check',
'service_check_type' => 'ss.check_type',
'service_last_hard_state_change' => 'ss.last_hard_state_change',
'service_last_hard_state' => 'ss.last_hard_state',
'service_state_type' => 'ss.state_type',
'service_last_notification' => 'ss.last_notification',
'service_next_notification' => 'ss.next_notification',
'service_no_more_notifications' => 'ss.no_more_notifications',
'service_notifications_enabled' => 'ss.notifications_enabled',
'service_problem_has_been_acknowledged' => 'ss.problem_has_been_acknowledged',
'service_acknowledgement_type' => 'ss.acknowledgement_type',
'service_current_notification_number' => 'ss.current_notification_number',
'service_passive_checks_enabled' => 'ss.passive_checks_enabled',
'service_active_checks_enabled' => 'ss.active_checks_enabled',
'service_event_handler_enabled' => 'ss.event_handler_enabled',
'service_flap_detection_enabled' => 'ss.flap_detection_enabled',
'service_is_flapping' => 'ss.is_flapping',
'service_percent_state_change' => 'ss.percent_state_change',
'service_latency' => 'ss.latency',
'service_execution_time' => 'ss.execution_time',
'service_scheduled_downtime_depth' => 'ss.scheduled_downtime_depth',
'service_failure_prediction_enabled' => 'ss.failure_prediction_enabled',
'service_process_performance_data' => 'ss.process_performance_data',
'service_obsess_over_service' => 'ss.obsess_over_service',
'service_modified_service_attributes' => 'ss.modified_service_attributes',
'service_event_handler' => 'ss.event_handler',
'service_check_command' => 'ss.check_command',
'service_normal_check_interval' => 'ss.normal_check_interval',
'service_retry_check_interval' => 'ss.retry_check_interval',
'service_check_timeperiod_object_id' => 'ss.check_timeperiod_object_id',
'service_status_update_time' => 'ss.status_update_time'
),
'status' => array(
'problems' => 'CASE WHEN ss.current_state = 0 THEN 0 ELSE 1 END',

View File

@ -0,0 +1,846 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Monitoring\Command;
use Icinga\Authentication\User;
use Icinga\Exception\ProgrammingError;
/**
* Class Meta
*
* Deals with objects and available commands which can be used on the object
*/
class Meta
{
/**
* Category name which is useless
*/
const DROP_CATEGORY = 'none';
/**
* Interface type for small interfaces
*
* Only important commands
*/
const TYPE_SMALL = 'small';
/**
* Interface type for full featured interface
*
* All commands are shown
*/
const TYPE_FULL = 'full';
const CMD_DISABLE_ACTIVE_CHECKS = 1;
const CMD_ENABLE_ACTIVE_CHECKS = 2;
const CMD_RESCHEDULE_NEXT_CHECK = 3;
const CMD_SUBMIT_PASSIVE_CHECK_RESULT = 4;
const CMD_STOP_OBSESSING = 5;
const CMD_START_OBSESSING = 6;
const CMD_STOP_ACCEPTING_PASSIVE_CHECKS = 7;
const CMD_START_ACCEPTING_PASSIVE_CHECKS = 8;
const CMD_DISABLE_NOTIFICATIONS = 9;
const CMD_ENABLE_NOTIFICATIONS = 10;
const CMD_SEND_CUSTOM_NOTIFICATION = 11;
const CMD_SCHEDULE_DOWNTIME = 12;
const CMD_SCHEDULE_DOWNTIMES_TO_ALL = 13;
const CMD_REMOVE_DOWNTIMES_FROM_ALL = 14;
const CMD_DISABLE_NOTIFICATIONS_FOR_ALL = 15;
const CMD_ENABLE_NOTIFICATIONS_FOR_ALL = 16;
const CMD_RESCHEDULE_NEXT_CHECK_TO_ALL = 17;
const CMD_DISABLE_ACTIVE_CHECKS_FOR_ALL = 18;
const CMD_ENABLE_ACTIVE_CHECKS_FOR_ALL = 19;
const CMD_DISABLE_EVENT_HANDLER = 20;
const CMD_ENABLE_EVENT_HANDLER = 21;
const CMD_DISABLE_FLAP_DETECTION = 22;
const CMD_ENABLE_FLAP_DETECTION = 23;
const CMD_ADD_COMMENT = 24;
const CMD_RESET_ATTRIBUTES = 25;
const CMD_ACKNOWLEDGE_PROBLEM = 26;
const CMD_REMOVE_ACKNOWLEDGEMENT = 27;
const CMD_DELAY_NOTIFICATION = 28;
const CMD_REMOVE_DOWNTIME = 29;
/**
* Filter array for array displayed in small interfaces
* @var int[]
*/
private static $commandSmallFilter = array(
self::CMD_RESCHEDULE_NEXT_CHECK,
self::CMD_ACKNOWLEDGE_PROBLEM,
self::CMD_REMOVE_ACKNOWLEDGEMENT
);
/**
* Information about interface commands
*
* With following structure
* <pre>
* array(
* self::CMD_CONSTANT_* => array(
* '<LONG DESCRIPTION WHERE %s is the type, e.g. host or service>',
* '<SHORT DESCRIPTION WHERE %s is the type, e.g. host or service>',
* '[ICON CSS CLASS]',
* '[BUTTON CSS CLASS]',
*
* // Maybe any other options later on
* )
* )
* </pre>
*
* @var array
*/
private static $commandInformation = array(
self::CMD_DISABLE_ACTIVE_CHECKS => array(
'Disable active checks for this %s', // Long description (mandatory)
'Disable active checks', // Short description (mandatory)
'', // Icon anything (optional)
'' // Button css cls (optional)
),
self::CMD_ENABLE_ACTIVE_CHECKS => array(
'Enable active checks for this %s',
'Enable active checks',
''
),
self::CMD_RESCHEDULE_NEXT_CHECK => array(
'Reschedule next service check',
'Recheck',
'',
'btn-success'
),
self::CMD_SUBMIT_PASSIVE_CHECK_RESULT => array(
'Submit passive check result',
'Submit check result',
''
),
self::CMD_STOP_OBSESSING => array(
'Stop obsessing over this %s',
'Stop obsessing',
''
),
self::CMD_START_OBSESSING => array(
'Start obsessing over this %s',
'Start obsessing',
''
),
self::CMD_STOP_ACCEPTING_PASSIVE_CHECKS => array(
'Stop accepting passive check for this %s',
'Stop passive checks',
''
),
self::CMD_START_ACCEPTING_PASSIVE_CHECKS => array(
'Start accepting passive check for this %s',
'Start passive checks',
''
),
self::CMD_DISABLE_NOTIFICATIONS => array(
'Disable notifications for this %s',
'Disable notifications',
''
),
self::CMD_ENABLE_NOTIFICATIONS => array(
'Enable notifications for this %s',
'Enable notifications',
''
),
self::CMD_SEND_CUSTOM_NOTIFICATION => array(
'Send custom %s notification',
'Send notification',
''
),
self::CMD_SCHEDULE_DOWNTIME => array(
'Schedule downtime for this %s',
'Schedule downtime',
''
),
self::CMD_SCHEDULE_DOWNTIMES_TO_ALL => array(
'Schedule downtime for this %s and all services',
'Schedule services downtime',
''
),
self::CMD_REMOVE_DOWNTIMES_FROM_ALL => array(
'Remove downtime(s) for this %s and all services',
'Remove downtime(s)',
''
),
self::CMD_DISABLE_NOTIFICATIONS_FOR_ALL => array(
'Disable notification for all service on this %s',
'Disable service notifications',
''
),
self::CMD_ENABLE_NOTIFICATIONS_FOR_ALL => array(
'Enable notification for all service on this %s',
'Enable service notifications',
''
),
self::CMD_RESCHEDULE_NEXT_CHECK_TO_ALL => array(
'Schedule a check of all service on this %s',
'Recheck all services',
'',
'btn-success'
),
self::CMD_DISABLE_ACTIVE_CHECKS_FOR_ALL => array(
'Disable checks for all services on this %s',
'Disable service checks',
''
),
self::CMD_ENABLE_ACTIVE_CHECKS_FOR_ALL => array(
'Enable checks for all services on this %s',
'Enable service checks',
''
),
self::CMD_DISABLE_EVENT_HANDLER => array(
'Disable event handler for this %s',
'Disable event handler',
''
),
self::CMD_ENABLE_EVENT_HANDLER => array(
'Enable event handler for this %s',
'Enable event handler',
''
),
self::CMD_DISABLE_FLAP_DETECTION => array(
'Disable flap detection for this %s',
'Disable flap detection',
''
),
self::CMD_ENABLE_FLAP_DETECTION => array(
'Enable flap detection for this %s',
'Enable flap detection',
''
),
self::CMD_ADD_COMMENT => array(
'Add new %s comment',
'Add comment',
''
),
self::CMD_RESET_ATTRIBUTES => array(
'Reset modified attributes',
'Reset attributes',
'',
'btn-danger'
),
self::CMD_ACKNOWLEDGE_PROBLEM => array(
'Acknowledge %s problem',
'Acknowledge',
'',
'btn-warning'
),
self::CMD_REMOVE_ACKNOWLEDGEMENT => array(
'Remove %s acknowledgement',
'Remove acknowledgement',
'',
'btn-warning'
),
self::CMD_DELAY_NOTIFICATION => array(
'Delay next %s notification',
'Delay notification',
''
),
);
/**
* An mapping array which is valid for hosts and services
* @var array
*/
private static $defaultObjectCommands = array(
self::CMD_DISABLE_ACTIVE_CHECKS,
self::CMD_ENABLE_ACTIVE_CHECKS,
self::CMD_RESCHEDULE_NEXT_CHECK,
self::CMD_SUBMIT_PASSIVE_CHECK_RESULT,
self::CMD_STOP_OBSESSING,
self::CMD_START_OBSESSING,
self::CMD_ACKNOWLEDGE_PROBLEM,
self::CMD_REMOVE_ACKNOWLEDGEMENT,
self::CMD_STOP_ACCEPTING_PASSIVE_CHECKS,
self::CMD_START_ACCEPTING_PASSIVE_CHECKS,
self::CMD_DISABLE_NOTIFICATIONS,
self::CMD_ENABLE_NOTIFICATIONS,
self::CMD_SEND_CUSTOM_NOTIFICATION,
self::CMD_SCHEDULE_DOWNTIME,
self::CMD_SCHEDULE_DOWNTIMES_TO_ALL,
self::CMD_REMOVE_DOWNTIMES_FROM_ALL,
self::CMD_DISABLE_NOTIFICATIONS_FOR_ALL,
self::CMD_ENABLE_NOTIFICATIONS_FOR_ALL,
self::CMD_RESCHEDULE_NEXT_CHECK_TO_ALL,
self::CMD_DISABLE_ACTIVE_CHECKS_FOR_ALL,
self::CMD_ENABLE_ACTIVE_CHECKS_FOR_ALL,
self::CMD_DISABLE_EVENT_HANDLER,
self::CMD_ENABLE_EVENT_HANDLER,
self::CMD_DISABLE_FLAP_DETECTION,
self::CMD_ENABLE_FLAP_DETECTION,
self::CMD_ADD_COMMENT,
self::CMD_RESET_ATTRIBUTES,
self::CMD_DELAY_NOTIFICATION
);
/**
* Command mapper
*
* Holds information about commands for object types
*
* Please note that host and service are implicit initialized!
* see $defaultObjectCommands for definition
*
* @var array
*/
private static $objectCommands = array(
// 'host' => self::$defaultObjectCommands,
// 'service' => self::$defaultObjectCommands,
// -> this is done in self::initCommandStructure()
//
// Real other commands structures:
// NONE
);
/**
* Array of modifier methods in this class
*
* Maps object type to modifier method which rewrites
* visible commands depending on object states
*
* @var array
*/
private static $commandProcessorMethods = array(
'host' => 'defaultCommandProcessor',
'service' => 'defaultCommandProcessor'
);
/**
* Init flag for lazy, static data preparation
* @var bool
*/
private static $initialized = false;
/**
* Array of available categories
* @var array
*/
private static $rawCategories = array();
/**
* Categories to command names
* @var array
*/
private static $rawCommandCategories = array();
/**
* Command reference list
* @var array
*/
private static $rawCommands = array(
'NONE' => 'none',
'ADD_HOST_COMMENT' => 'host',
'DEL_HOST_COMMENT' => 'host',
'ADD_SVC_COMMENT' => 'service',
'DEL_SVC_COMMENT' => 'service',
'ENABLE_SVC_CHECK' => 'service',
'DISABLE_SVC_CHECK' => 'service',
'SCHEDULE_SVC_CHECK' => 'service',
'DELAY_SVC_NOTIFICATION' => 'service',
'DELAY_HOST_NOTIFICATION' => 'host',
'DISABLE_NOTIFICATIONS' => 'global',
'ENABLE_NOTIFICATIONS' => 'global',
'RESTART_PROCESS' => 'global',
'SHUTDOWN_PROCESS' => 'global',
'ENABLE_HOST_SVC_CHECKS' => 'host',
'DISABLE_HOST_SVC_CHECKS' => 'host',
'SCHEDULE_HOST_SVC_CHECKS' => 'host',
'DELAY_HOST_SVC_NOTIFICATIONS' => 'host',
'DEL_ALL_HOST_COMMENTS' => 'host',
'DEL_ALL_SVC_COMMENTS' => 'service',
'ENABLE_SVC_NOTIFICATIONS' => 'service',
'DISABLE_SVC_NOTIFICATIONS' => 'service',
'ENABLE_HOST_NOTIFICATIONS' => 'host',
'DISABLE_HOST_NOTIFICATIONS' => 'host',
'ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST' => 'host',
'DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST' => 'host',
'ENABLE_HOST_SVC_NOTIFICATIONS' => 'host',
'DISABLE_HOST_SVC_NOTIFICATIONS' => 'host',
'PROCESS_SERVICE_CHECK_RESULT' => 'service',
'SAVE_STATE_INFORMATION' => 'global',
'READ_STATE_INFORMATION' => 'global',
'ACKNOWLEDGE_HOST_PROBLEM' => 'host',
'ACKNOWLEDGE_SVC_PROBLEM' => 'service',
'START_EXECUTING_SVC_CHECKS' => 'service',
'STOP_EXECUTING_SVC_CHECKS' => 'service',
'START_ACCEPTING_PASSIVE_SVC_CHECKS' => 'service',
'STOP_ACCEPTING_PASSIVE_SVC_CHECKS' => 'service',
'ENABLE_PASSIVE_SVC_CHECKS' => 'service',
'DISABLE_PASSIVE_SVC_CHECKS' => 'service',
'ENABLE_EVENT_HANDLERS' => 'global',
'DISABLE_EVENT_HANDLERS' => 'global',
'ENABLE_HOST_EVENT_HANDLER' => 'host',
'DISABLE_HOST_EVENT_HANDLER' => 'host',
'ENABLE_SVC_EVENT_HANDLER' => 'service',
'DISABLE_SVC_EVENT_HANDLER' => 'service',
'ENABLE_HOST_CHECK' => 'host',
'DISABLE_HOST_CHECK' => 'host',
'START_OBSESSING_OVER_SVC_CHECKS' => 'service',
'STOP_OBSESSING_OVER_SVC_CHECKS' => 'service',
'REMOVE_HOST_ACKNOWLEDGEMENT' => 'host',
'REMOVE_SVC_ACKNOWLEDGEMENT' => 'service',
'SCHEDULE_FORCED_HOST_SVC_CHECKS' => 'host',
'SCHEDULE_FORCED_SVC_CHECK' => 'service',
'SCHEDULE_HOST_DOWNTIME' => 'host',
'SCHEDULE_SVC_DOWNTIME' => 'service',
'ENABLE_HOST_FLAP_DETECTION' => 'host',
'DISABLE_HOST_FLAP_DETECTION' => 'host',
'ENABLE_SVC_FLAP_DETECTION' => 'service',
'DISABLE_SVC_FLAP_DETECTION' => 'service',
'ENABLE_FLAP_DETECTION' => 'global',
'DISABLE_FLAP_DETECTION' => 'global',
'ENABLE_HOSTGROUP_SVC_NOTIFICATIONS' => 'hostgroup',
'DISABLE_HOSTGROUP_SVC_NOTIFICATIONS' => 'hostgroup',
'ENABLE_HOSTGROUP_HOST_NOTIFICATIONS' => 'hostgroup',
'DISABLE_HOSTGROUP_HOST_NOTIFICATIONS' => 'hostgroup',
'ENABLE_HOSTGROUP_SVC_CHECKS' => 'hostgroup',
'DISABLE_HOSTGROUP_SVC_CHECKS' => 'hostgroup',
'CANCEL_HOST_DOWNTIME' => 'host',
'CANCEL_SVC_DOWNTIME' => 'service',
'CANCEL_ACTIVE_HOST_DOWNTIME' => 'host',
'CANCEL_PENDING_HOST_DOWNTIME' => 'host',
'CANCEL_ACTIVE_SVC_DOWNTIME' => 'service',
'CANCEL_PENDING_SVC_DOWNTIME' => 'service',
'CANCEL_ACTIVE_HOST_SVC_DOWNTIME' => 'host',
'CANCEL_PENDING_HOST_SVC_DOWNTIME' => 'host',
'FLUSH_PENDING_COMMANDS' => 'global',
'DEL_HOST_DOWNTIME' => 'host',
'DEL_SVC_DOWNTIME' => 'service',
'ENABLE_FAILURE_PREDICTION' => 'global',
'DISABLE_FAILURE_PREDICTION' => 'global',
'ENABLE_PERFORMANCE_DATA' => 'global',
'DISABLE_PERFORMANCE_DATA' => 'global',
'SCHEDULE_HOSTGROUP_HOST_DOWNTIME' => 'hostgroup',
'SCHEDULE_HOSTGROUP_SVC_DOWNTIME' => 'hostgroup',
'SCHEDULE_HOST_SVC_DOWNTIME' => 'host',
'PROCESS_HOST_CHECK_RESULT' => 'host',
'START_EXECUTING_HOST_CHECKS' => 'host',
'STOP_EXECUTING_HOST_CHECKS' => 'host',
'START_ACCEPTING_PASSIVE_HOST_CHECKS' => 'host',
'STOP_ACCEPTING_PASSIVE_HOST_CHECKS' => 'host',
'ENABLE_PASSIVE_HOST_CHECKS' => 'host',
'DISABLE_PASSIVE_HOST_CHECKS' => 'host',
'START_OBSESSING_OVER_HOST_CHECKS' => 'host',
'STOP_OBSESSING_OVER_HOST_CHECKS' => 'host',
'SCHEDULE_HOST_CHECK' => 'host',
'SCHEDULE_FORCED_HOST_CHECK' => 'host',
'START_OBSESSING_OVER_SVC' => 'global',
'STOP_OBSESSING_OVER_SVC' => 'global',
'START_OBSESSING_OVER_HOST' => 'global',
'STOP_OBSESSING_OVER_HOST' => 'global',
'ENABLE_HOSTGROUP_HOST_CHECKS' => 'host',
'DISABLE_HOSTGROUP_HOST_CHECKS' => 'host',
'ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS' => 'host',
'DISABLE_HOSTGROUP_PASSIVE_SVC_CHECKS' => 'host',
'ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS' => 'host',
'DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS' => 'host',
'ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS' => 'servicegroup',
'DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS' => 'servicegroup',
'ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS' => 'servicegroup',
'DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS' => 'servicegroup',
'ENABLE_SERVICEGROUP_SVC_CHECKS' => 'servicegroup',
'DISABLE_SERVICEGROUP_SVC_CHECKS' => 'servicegroup',
'ENABLE_SERVICEGROUP_HOST_CHECKS' => 'servicegroup',
'DISABLE_SERVICEGROUP_HOST_CHECKS' => 'servicegroup',
'ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS' => 'servicegroup',
'DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS' => 'servicegroup',
'ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS' => 'servicegroup',
'DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS' => 'servicegroup',
'SCHEDULE_SERVICEGROUP_HOST_DOWNTIME' => 'servicegroup',
'SCHEDULE_SERVICEGROUP_SVC_DOWNTIME' => 'servicegroup',
'CHANGE_GLOBAL_HOST_EVENT_HANDLER' => 'global',
'CHANGE_GLOBAL_SVC_EVENT_HANDLER' => 'global',
'CHANGE_HOST_EVENT_HANDLER' => 'host',
'CHANGE_SVC_EVENT_HANDLER' => 'service',
'CHANGE_HOST_CHECK_COMMAND' => 'host',
'CHANGE_SVC_CHECK_COMMAND' => 'service',
'CHANGE_NORMAL_HOST_CHECK_INTERVAL' => 'host',
'CHANGE_NORMAL_SVC_CHECK_INTERVAL' => 'service',
'CHANGE_RETRY_SVC_CHECK_INTERVAL' => 'service',
'CHANGE_MAX_HOST_CHECK_ATTEMPTS' => 'host',
'CHANGE_MAX_SVC_CHECK_ATTEMPTS' => 'service',
'SCHEDULE_AND_PROPAGATE_TRIGGERED_HOST_DOWNTIME' => 'host',
'ENABLE_HOST_AND_CHILD_NOTIFICATIONS' => 'host',
'DISABLE_HOST_AND_CHILD_NOTIFICATIONS' => 'host',
'SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME' => 'host',
'ENABLE_SERVICE_FRESHNESS_CHECKS' => 'global',
'DISABLE_SERVICE_FRESHNESS_CHECKS' => 'global',
'ENABLE_HOST_FRESHNESS_CHECKS' => 'host',
'DISABLE_HOST_FRESHNESS_CHECKS' => 'host',
'SET_HOST_NOTIFICATION_NUMBER' => 'host',
'SET_SVC_NOTIFICATION_NUMBER' => 'service',
'CHANGE_HOST_CHECK_TIMEPERIOD' => 'host',
'CHANGE_SVC_CHECK_TIMEPERIOD' => 'service',
'PROCESS_FILE' => 'global',
'CHANGE_CUSTOM_HOST_VAR' => 'host',
'CHANGE_CUSTOM_SVC_VAR' => 'service',
'CHANGE_CUSTOM_CONTACT_VAR' => 'global',
'ENABLE_CONTACT_HOST_NOTIFICATIONS' => 'host',
'DISABLE_CONTACT_HOST_NOTIFICATIONS' => 'host',
'ENABLE_CONTACT_SVC_NOTIFICATIONS' => 'service',
'DISABLE_CONTACT_SVC_NOTIFICATIONS' => 'service',
'ENABLE_CONTACTGROUP_HOST_NOTIFICATIONS' => 'host',
'DISABLE_CONTACTGROUP_HOST_NOTIFICATIONS' => 'host',
'ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS' => 'service',
'DISABLE_CONTACTGROUP_SVC_NOTIFICATIONS' => 'service',
'CHANGE_RETRY_HOST_CHECK_INTERVAL' => 'host',
'SEND_CUSTOM_HOST_NOTIFICATION' => 'host',
'SEND_CUSTOM_SVC_NOTIFICATION' => 'service',
'CHANGE_HOST_NOTIFICATION_TIMEPERIOD' => 'host',
'CHANGE_SVC_NOTIFICATION_TIMEPERIOD' => 'service',
'CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD' => 'host',
'CHANGE_CONTACT_SVC_NOTIFICATION_TIMEPERIOD' => 'service',
'CHANGE_HOST_MODATTR' => 'host',
'CHANGE_SVC_MODATTR' => 'service',
'CHANGE_CONTACT_MODATTR' => 'contact',
'CHANGE_CONTACT_MODHATTR' => 'contact',
'CHANGE_CONTACT_MODSATTR' => 'contact',
'SYNC_STATE_INFORMATION' => 'contact',
'DEL_DOWNTIME_BY_HOST_NAME' => 'host',
'DEL_DOWNTIME_BY_HOSTGROUP_NAME' => 'hostgroup',
'DEL_DOWNTIME_BY_START_TIME_COMMENT' => 'comment',
'ACKNOWLEDGE_HOST_PROBLEM_EXPIRE' => 'host',
'ACKNOWLEDGE_SVC_PROBLEM_EXPIRE' => 'service',
'DISABLE_NOTIFICATIONS_EXPIRE_TIME' => 'global',
'CUSTOM_COMMAND' => 'none',
);
/**
* Initialize command structures only once
*/
private static function initCommandStructure()
{
if (self::$initialized === true) {
return;
}
/*
* Build everything for raw commands
*/
$categories = array();
foreach (self::$rawCommands as $commandName => $categoryName) {
// We do not want to see useless commands
if ($categoryName === self::DROP_CATEGORY) {
unset(self::$rawCommands[$commandName]);
continue;
}
$categories[$categoryName] = null;
if (array_key_exists($categoryName, self::$rawCommandCategories) === false) {
self::$rawCommandCategories[$categoryName] = array();
}
self::$rawCommandCategories[$categoryName][] = $commandName;
}
self::$rawCategories = array_keys($categories);
sort(self::$rawCategories);
/*
* Build everything for object commands
*/
self::$objectCommands['host'] = self::$defaultObjectCommands;
self::$objectCommands['service'] = self::$defaultObjectCommands;
self::$initialized = true;
}
/**
* Creates a new object
*/
public function __construct()
{
self::initCommandStructure();
}
/**
* Return a full list of commands
* @return string[]
*/
public function getRawCommands()
{
static $commands = null;
if ($commands === null) {
$commands = array_keys(self::$rawCommands);
}
return $commands;
}
/**
* Return all commands for a category
* @param string $categoryName
* @return string[]
*/
public function getRawCommandsForCategory($categoryName)
{
$this->assertRawCategoryExistence($categoryName);
return array_values(self::$rawCommandCategories[$categoryName]);
}
/**
* Test for category existence
* @param string $categoryName
* @throws \Icinga\Exception\ProgrammingError
*/
private function assertRawCategoryExistence($categoryName)
{
if (array_key_exists($categoryName, self::$rawCommandCategories) === false) {
throw new ProgrammingError('Category does not exists: ' . $categoryName);
}
}
/**
* Return a list of all categories
* @return string[]
*/
public function getRawCategories()
{
return self::$rawCategories;
}
/**
* Returns the type of object
*
* This is made by the first key of property
* e.g.
* $object->host_state
* Type is 'host'
*
* @param \stdClass $object
* @return mixed
*/
private function getObjectType(\stdClass $object)
{
return array_shift(explode('_', array_shift(array_keys(get_object_vars($object))), 2));
}
/**
* Returns method name based on object type
* @param string $type
* @return string
* @throws \Icinga\Exception\ProgrammingError
*/
private function getCommandProcessorMethod($type)
{
if (array_key_exists($type, self::$commandProcessorMethods)) {
$method = self::$commandProcessorMethods[$type];
if (is_callable(array(&$this, $method))) {
return $method;
}
}
throw new ProgrammingError('Type has no command processor: '. $type);
}
/**
* Return interface commands by object type
* @param string $type
* @return array
* @throws \Icinga\Exception\ProgrammingError
*/
private function getCommandsByType($type)
{
if (array_key_exists($type, self::$objectCommands)) {
return self::$objectCommands[$type];
}
throw new ProgrammingError('Type has no commands defined: '. $type);
}
/**
* Modifies data objects to drop their object type
*
* - host_state will be state
* - service_state will be also state
* - And so on
*
* @param \stdClass $object
* @param $type
* @return object
*/
private function dropTypeAttributes(\stdClass $object, $type)
{
$objectData = get_object_vars($object);
foreach ($objectData as $propertyName => $propertyValue) {
$newProperty = str_replace($type. '_', '', $propertyName);
$objectData[$newProperty] = $propertyValue;
unset($objectData[$propertyName]);
}
return (object)$objectData;
}
/**
* Default processor for host and service objects
*
* Drop commands from list based on states and object properties
*
* @param \stdClass $object
* @param array $commands
* @param string $type
* @return array
*/
private function defaultCommandProcessor(\stdClass $object, array $commands, $type)
{
$object = $this->dropTypeAttributes($object, $type);
$commands = array_flip($commands);
if ($object->active_checks_enabled === '1') {
unset($commands[self::CMD_ENABLE_ACTIVE_CHECKS]);
} else {
unset($commands[self::CMD_DISABLE_ACTIVE_CHECKS]);
}
if ($object->passive_checks_enabled !== '1') {
unset($commands[self::CMD_SUBMIT_PASSIVE_CHECK_RESULT]);
}
if ($object->passive_checks_enabled === '1') {
unset($commands[self::CMD_STOP_ACCEPTING_PASSIVE_CHECKS]);
} else {
unset($commands[self::CMD_START_ACCEPTING_PASSIVE_CHECKS]);
}
$obsess = 'obsess_over_'.$type;
if ($object->$obsess === '1') {
unset($commands[self::CMD_START_OBSESSING]);
} else {
unset($commands[self::CMD_STOP_OBSESSING]);
}
if ($object->state !== '0') {
if ($object->acknowledged === '1') {
unset($commands[self::CMD_ACKNOWLEDGE_PROBLEM]);
} else {
unset($commands[self::CMD_REMOVE_ACKNOWLEDGEMENT]);
}
} else {
unset($commands[self::CMD_ACKNOWLEDGE_PROBLEM]);
unset($commands[self::CMD_REMOVE_ACKNOWLEDGEMENT]);
}
if ($object->notifications_enabled === '1') {
unset($commands[self::CMD_ENABLE_NOTIFICATIONS]);
} else {
unset($commands[self::CMD_DISABLE_NOTIFICATIONS]);
}
if ($object->event_handler_enabled === '1') {
unset($commands[self::CMD_ENABLE_EVENT_HANDLER]);
} else {
unset($commands[self::CMD_DISABLE_EVENT_HANDLER]);
}
if ($object->flap_detection_enabled === '1') {
unset($commands[self::CMD_ENABLE_FLAP_DETECTION]);
} else {
unset($commands[self::CMD_DISABLE_FLAP_DETECTION]);
}
return array_flip($commands);
}
/**
* Creates structure to work with in interfaces
*
* @param array $commands
* @param string $objectType
* @return array
*/
private function buildInterfaceConfiguration(array $commands, $objectType)
{
$out = array();
foreach ($commands as $index => $commandId) {
$command = new \stdClass();
$command->id = $commandId;
if (array_key_exists($commandId, self::$commandInformation)) {
$command->shortDescription = sprintf(self::$commandInformation[$commandId][1], $objectType);
$command->longDescription = sprintf(self::$commandInformation[$commandId][0], $objectType);
$command->iconCls =
(isset(self::$commandInformation[$commandId][2]))
? self::$commandInformation[$commandId][2]
: '';
$command->btnCls =
(isset(self::$commandInformation[$commandId][3]))
? self::$commandInformation[$commandId][3]
: '';
}
$out[] = $command;
}
return $out;
}
/**
* Drop commands
* For small interfaces or bypass when full interfaces are needed
* @param array $commands
* @param string $type
* @return array
*/
private function filterInterfaceType(array $commands, $type)
{
if ($type === self::TYPE_FULL) {
return $commands;
}
foreach ($commands as $arrayId => $commandId) {
if (in_array($commandId, self::$commandSmallFilter) === false) {
unset($commands[$arrayId]);
}
}
return $commands;
}
/**
* Get commands for an object
*
* Based on objects and interface type
*
* @param \stdClass $object
* @param $interfaceType
* @param User $user
* @return array
*/
public function getCommandForObject(\stdClass $object, $interfaceType, User $user = null)
{
$objectType = $this->getObjectType($object);
$commands = $this->getCommandsByType($objectType);
$method = $this->getCommandProcessorMethod($objectType);
$commands = $this->$method($object, $commands, $objectType);
$commands = $this->filterInterfaceType($commands, $interfaceType);
$commands = $this->buildInterfaceConfiguration($commands, $objectType);
return $commands;
}
}

View File

@ -0,0 +1,76 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
/**
* Icinga 2 Web - Head for multiple monitoring frontends
* Copyright (C) 2013 Icinga Development Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* @copyright 2013 Icinga Development Team <info@icinga.org>
* @author Icinga Development Team <info@icinga.org>
*/
// {{{ICINGA_LICENSE_HEADER}}}
namespace Icinga\Monitoring\View;
/**
* Class DowntimeView
*/
class DowntimeView extends MonitoringView
{
/**
* Query object
* @var mixed
*/
protected $query;
/**
* Available columns
* @var string[]
*/
protected $availableColumns = array(
'downtime_type',
'downtime_author_name',
'downtime_comment_data',
'downtime_is_fixed',
'downtime_duration',
'downtime_scheduled_start_time',
'downtime_scheduled_end_time',
'downtime_was_started',
'downtime_actual_start_time',
'downtime_actual_start_time_usec',
'downtime_is_in_effect',
'downtime_trigger_time',
'downtime_internal_downtime_id'
);
/**
* Filters
* @var array
*/
protected $specialFilters = array();
/**
* Default sorting of data set
* @var array
*/
protected $sortDefaults = array(
'downtime_is_in_effect' => array(
'default_dir' => self::SORT_DESC
),
'downtime_actual_start_time' => array(
'default_dir' => self::SORT_DESC
)
);
}

View File

@ -0,0 +1,116 @@
<?php
namespace Test\Modules\Monitoring\Application\Views\Helpers;
use Icinga\Monitoring\Command\Meta;
require_once 'Zend/View/Helper/Abstract.php';
require_once 'Zend/View.php';
require_once __DIR__. '/../../../../../application/views/helpers/MonitoringCommands.php';
require_once __DIR__. '/../../../../../library/Monitoring/Command/Meta.php';
require_once __DIR__. '/../../../../../../../library/Icinga/Exception/ProgrammingError.php';
class HostStruct extends \stdClass
{
public $host_name = 'localhost';
public $host_address = '127.0.0.1';
public $host_state = '1';
public $host_handled = '1';
public $host_in_downtime = '1';
public $host_acknowledged = '1';
public $host_check_command = 'check-host-alive';
public $host_last_state_change = '1372937083';
public $host_alias = 'localhost';
public $host_output = 'DDD';
public $host_long_output = '';
public $host_perfdata = '';
public $host_current_check_attempt = '1';
public $host_max_check_attempts = '10';
public $host_attempt = '1/10';
public $host_last_check = '2013-07-04 11:24:42';
public $host_next_check = '2013-07-04 11:29:43';
public $host_check_type = '1';
public $host_last_hard_state_change = '2013-07-04 11:24:43';
public $host_last_hard_state = '0';
public $host_last_time_up = '2013-07-04 11:20:23';
public $host_last_time_down = '2013-07-04 11:24:43';
public $host_last_time_unreachable = '0000-00-00 00:00:00';
public $host_state_type = '1';
public $host_last_notification = '0000-00-00 00:00:00';
public $host_next_notification = '0000-00-00 00:00:00';
public $host_no_more_notifications = '0';
public $host_notifications_enabled = '1';
public $host_problem_has_been_acknowledged = '1';
public $host_acknowledgement_type = '2';
public $host_current_notification_number = '0';
public $host_passive_checks_enabled = '1';
public $host_active_checks_enabled = '0';
public $host_event_handler_enabled = '0';
public $host_flap_detection_enabled = '1';
public $host_is_flapping = '0';
public $host_percent_state_change = '12.36842';
public $host_latency = '0.12041';
public $host_execution_time = '0';
public $host_scheduled_downtime_depth = '1';
public $host_failure_prediction_enabled = '1';
public $host_process_performance_data = '1';
public $host_obsess_over_host = '1';
public $host_modified_host_attributes = '14';
public $host_event_handler = '';
public $host_normal_check_interval = '5';
public $host_retry_check_interval = '1';
public $host_check_timeperiod_object_id = '27';
}
class MonitoringCommandsTest extends \PHPUnit_Framework_TestCase {
public function testOutput1()
{
$helper = new \Zend_View_Helper_MonitoringCommands();
$object = new HostStruct();
$html = $helper->monitoringCommands($object, Meta::TYPE_SMALL);
$this->assertContains('Remove acknowledgement', $html);
$this->assertContains('Recheck', $html);
$this->assertNotContains('Obsess', $html);
$this->assertNotContains('Enable', $html);
$this->assertNotContains('Disable', $html);
}
public function testOutput2()
{
$helper = new \Zend_View_Helper_MonitoringCommands();
$object = new HostStruct();
$html = $helper->monitoringCommands($object, Meta::TYPE_FULL);
$dom = new \DOMDocument('1.0', 'utf-8');
$dom->loadXML($html);
$xpath = new \DOMXPath($dom);
$nodes = $xpath->query('//div[@class=\'command-section pull-left\']');
$this->assertEquals(5, $nodes->length);
$nodes = $xpath->query('//button');
$this->assertEquals(21, $nodes->length);
}
public function testOutput3()
{
$helper = new \Zend_View_Helper_MonitoringCommands();
$object = new HostStruct();
$object->host_state = '0';
$html = $helper->monitoringCommands($object, Meta::TYPE_FULL);
$dom = new \DOMDocument('1.0', 'utf-8');
$dom->loadXML($html);
$xpath = new \DOMXPath($dom);
$nodes = $xpath->query('//button');
$this->assertEquals(20, $nodes->length);
}
}

View File

@ -0,0 +1,116 @@
<?php
namespace Test\Modules\Monitoring\Application\Views\Helpers;
require_once 'Zend/View/Helper/Abstract.php';
require_once 'Zend/View.php';
require_once __DIR__. '/../../../../../application/views/helpers/MonitoringFlags.php';
class MonitoringFlagsTest extends \PHPUnit_Framework_TestCase
{
public function testHosts1()
{
$testArray = array(
'host_passive_checks_enabled' => '0',
'host_active_checks_enabled' => '0',
'host_obsess_over_host' => '1',
'host_notifications_enabled' => '0',
'host_event_handler_enabled' => '1',
'host_flap_detection_enabled' => '1',
);
$monitoringFlags = new \Zend_View_Helper_MonitoringFlags();
$returnArray = $monitoringFlags->monitoringFlags((object)$testArray);
$this->assertCount(6, $returnArray);
$expected = array(
'Passive checks' => false,
'Active checks' => false,
'Obsessing' => true,
'Notifications' => false,
'Event handler' => true,
'Flap detection' => true
);
$this->assertEquals($expected, $returnArray);
}
public function testService1()
{
$testArray = array(
'service_passive_checks_enabled' => '0',
'service_active_checks_enabled' => '1',
'service_obsess_over_host' => '0',
'service_notifications_enabled' => '1',
'service_event_handler_enabled' => '1',
'service_flap_detection_enabled' => '0',
);
$monitoringFlags = new \Zend_View_Helper_MonitoringFlags();
$returnArray = $monitoringFlags->monitoringFlags((object)$testArray);
$this->assertCount(6, $returnArray);
$expected = array(
'Passive checks' => false,
'Active checks' => true,
'Obsessing' => false,
'Notifications' => true,
'Event handler' => true,
'Flap detection' => false
);
$this->assertEquals($expected, $returnArray);
}
public function testUglyConditions1()
{
$testArray = array(
'service_active_checks_enabled' => '1',
'service_obsess_over_host' => '1',
'DING DING' => '$$$',
'DONG DONG' => '###'
);
$monitoringFlags = new \Zend_View_Helper_MonitoringFlags();
$returnArray = $monitoringFlags->monitoringFlags((object)$testArray);
$this->assertCount(6, $returnArray);
$expected = array(
'Passive checks' => false,
'Active checks' => true,
'Obsessing' => true,
'Notifications' => false,
'Event handler' => false,
'Flap detection' => false
);
$this->assertEquals($expected, $returnArray);
}
public function testUglyConditions2()
{
$testArray = array(
'DING DING' => '$$$',
'DONG DONG' => '###'
);
$monitoringFlags = new \Zend_View_Helper_MonitoringFlags();
$returnArray = $monitoringFlags->monitoringFlags((object)$testArray);
$this->assertCount(6, $returnArray);
$expected = array(
'Passive checks' => false,
'Active checks' => false,
'Obsessing' => false,
'Notifications' => false,
'Event handler' => false,
'Flap detection' => false
);
$this->assertEquals($expected, $returnArray);
}
}

View File

@ -0,0 +1,105 @@
<?php
namespace Test\Modules\Monitoring\Application\Views\Helpers;
require_once 'Zend/View/Helper/Abstract.php';
require_once 'Zend/View.php';
require_once __DIR__. '/../../../../../application/views/helpers/MonitoringProperties.php';
class HostStruct4Properties extends \stdClass
{
public $host_name = 'localhost';
public $host_address = '127.0.0.1';
public $host_state = '1';
public $host_handled = '1';
public $host_in_downtime = '1';
public $host_acknowledged = '1';
public $host_check_command = 'check-host-alive';
public $host_last_state_change = '1372937083';
public $host_alias = 'localhost';
public $host_output = 'DDD';
public $host_long_output = '';
public $host_perfdata = '';
public $host_current_check_attempt = '1';
public $host_max_check_attempts = '10';
public $host_attempt = '1/10';
public $host_last_check = '2013-07-04 11:24:42';
public $host_next_check = '2013-07-04 11:29:43';
public $host_check_type = '1';
public $host_last_hard_state_change = '2013-07-04 11:24:43';
public $host_last_hard_state = '0';
public $host_last_time_up = '2013-07-04 11:20:23';
public $host_last_time_down = '2013-07-04 11:24:43';
public $host_last_time_unreachable = '0000-00-00 00:00:00';
public $host_state_type = '1';
public $host_last_notification = '0000-00-00 00:00:00';
public $host_next_notification = '0000-00-00 00:00:00';
public $host_no_more_notifications = '0';
public $host_notifications_enabled = '1';
public $host_problem_has_been_acknowledged = '1';
public $host_acknowledgement_type = '2';
public $host_current_notification_number = '0';
public $host_passive_checks_enabled = '1';
public $host_active_checks_enabled = '0';
public $host_event_handler_enabled = '0';
public $host_flap_detection_enabled = '1';
public $host_is_flapping = '0';
public $host_percent_state_change = '12.36842';
public $host_latency = '0.12041';
public $host_execution_time = '0';
public $host_scheduled_downtime_depth = '1';
public $host_failure_prediction_enabled = '1';
public $host_process_performance_data = '1';
public $host_obsess_over_host = '1';
public $host_modified_host_attributes = '14';
public $host_event_handler = '';
public $host_normal_check_interval = '5';
public $host_retry_check_interval = '1';
public $host_check_timeperiod_object_id = '27';
public $host_status_update_time = '2013-07-08 10:10:10';
}
class MonitoringPropertiesTest extends \PHPUnit_Framework_TestCase
{
public function testOutput1()
{
$host = new HostStruct4Properties();
$host->host_current_check_attempt = '5';
$propertyHelper = new \Zend_View_Helper_MonitoringProperties();
$items = $propertyHelper->monitoringProperties($host);
$this->assertCount(10, $items);
$this->assertEquals('5/10 (HARD state)', $items['Current attempt']);
$this->assertEquals('2013-07-08 10:10:10', $items['Last update']);
}
public function testOutput2()
{
$host = new HostStruct4Properties();
$host->host_current_check_attempt = '5';
$host->host_active_checks_enabled = '1';
$host->host_passive_checks_enabled = '0';
$host->host_is_flapping = '1';
$propertyHelper = new \Zend_View_Helper_MonitoringProperties();
$items = $propertyHelper->monitoringProperties($host);
$this->assertCount(10, $items);
$test = array(
'Current attempt' => "5/10 (HARD state)",
'Last check time' => "2013-07-04 11:24:42",
'Check type' => "ACTIVE",
'Check latency / duration' => "0.1204 / 0.0000 seconds",
'Next scheduled active check' => "2013-07-04 11:29:43",
'Last state change' => "2013-07-04 13:24:43",
'Last notification' => "N/A (notification 0)",
'Is this host flapping?' => "YES (12.37% state change)",
'In scheduled downtime?' => "YES",
'Last update' => "2013-07-08 10:10:10",
);
$this->assertEquals($test, $items);
}
}

View File

@ -0,0 +1,185 @@
<?php
namespace Test\Modules\Monitoring\Library\Command;
require_once __DIR__. '/../../../../library/Monitoring/Command/Meta.php';
require_once __DIR__. '/../../../../../../library/Icinga/Exception/ProgrammingError.php';
use Icinga\Monitoring\Command\Meta;
class HostStruct extends \stdClass
{
public $host_name = 'localhost';
public $host_address = '127.0.0.1';
public $host_state = '1';
public $host_handled = '1';
public $host_in_downtime = '1';
public $host_acknowledged = '1';
public $host_check_command = 'check-host-alive';
public $host_last_state_change = '1372937083';
public $host_alias = 'localhost';
public $host_output = 'DDD';
public $host_long_output = '';
public $host_perfdata = '';
public $host_current_check_attempt = '1';
public $host_max_check_attempts = '10';
public $host_attempt = '1/10';
public $host_last_check = '2013-07-04 11:24:42';
public $host_next_check = '2013-07-04 11:29:43';
public $host_check_type = '1';
public $host_last_hard_state_change = '2013-07-04 11:24:43';
public $host_last_hard_state = '0';
public $host_last_time_up = '2013-07-04 11:20:23';
public $host_last_time_down = '2013-07-04 11:24:43';
public $host_last_time_unreachable = '0000-00-00 00:00:00';
public $host_state_type = '1';
public $host_last_notification = '0000-00-00 00:00:00';
public $host_next_notification = '0000-00-00 00:00:00';
public $host_no_more_notifications = '0';
public $host_notifications_enabled = '1';
public $host_problem_has_been_acknowledged = '1';
public $host_acknowledgement_type = '2';
public $host_current_notification_number = '0';
public $host_passive_checks_enabled = '1';
public $host_active_checks_enabled = '0';
public $host_event_handler_enabled = '0';
public $host_flap_detection_enabled = '1';
public $host_is_flapping = '0';
public $host_percent_state_change = '12.36842';
public $host_latency = '0.12041';
public $host_execution_time = '0';
public $host_scheduled_downtime_depth = '1';
public $host_failure_prediction_enabled = '1';
public $host_process_performance_data = '1';
public $host_obsess_over_host = '1';
public $host_modified_host_attributes = '14';
public $host_event_handler = '';
public $host_normal_check_interval = '5';
public $host_retry_check_interval = '1';
public $host_check_timeperiod_object_id = '27';
}
class MetaTest extends \PHPUnit_Framework_TestCase
{
public function testRawCommands1()
{
$meta = new Meta();
$commands = $meta->getRawCommands();
$this->assertCount(173, $commands);
$this->assertTrue(in_array('SCHEDULE_SERVICEGROUP_SVC_DOWNTIME', $commands));
$this->assertTrue(in_array('SCHEDULE_SVC_CHECK', $commands));
$this->assertTrue(in_array('ENABLE_HOSTGROUP_SVC_CHECKS', $commands));
$this->assertTrue(in_array('PROCESS_HOST_CHECK_RESULT', $commands));
$this->assertTrue(in_array('ACKNOWLEDGE_SVC_PROBLEM', $commands));
$this->assertTrue(in_array('ACKNOWLEDGE_HOST_PROBLEM', $commands));
$this->assertTrue(in_array('SCHEDULE_FORCED_SVC_CHECK', $commands));
$this->assertTrue(in_array('DISABLE_FLAP_DETECTION', $commands));
}
public function testRawCommands2()
{
$meta = new Meta();
$categories = $meta->getRawCategories();
$this->assertCount(7, $categories);
$this->assertEquals(
array(
'comment',
'contact',
'global',
'host',
'hostgroup',
'service',
'servicegroup'
),
$categories
);
}
public function testRawCommands3()
{
$meta = new Meta();
$this->assertCount(9, $meta->getRawCommandsForCategory('hostgroup'));
$this->assertCount(14, $meta->getRawCommandsForCategory('servicegroup'));
$test1 = $meta->getRawCommandsForCategory('global');
$this->count(26, $test1);
$this->assertTrue(in_array('DISABLE_NOTIFICATIONS', $test1));
$this->assertTrue(in_array('RESTART_PROCESS', $test1));
$this->assertTrue(in_array('ENABLE_FLAP_DETECTION', $test1));
$this->assertTrue(in_array('PROCESS_FILE', $test1));
}
/**
* @expectedException Icinga\Exception\ProgrammingError
* @expectedExceptionMessage Category does not exists: DOES_NOT_EXIST
*/
public function testRawCommands4()
{
$meta = new Meta();
$meta->getRawCommandsForCategory('DOES_NOT_EXIST');
}
public function testObjectForCommand1()
{
$meta = new Meta();
$object = new HostStruct();
$commands = $meta->getCommandForObject($object, Meta::TYPE_SMALL);
$this->assertEquals(3, $commands[0]->id);
$this->assertEquals(27, $commands[1]->id);
$object->host_state = '0';
$commands = $meta->getCommandForObject($object, Meta::TYPE_SMALL);
$this->assertEquals(3, $commands[0]->id);
$this->assertFalse(isset($commands[1])); // STATE IS OK AGAIN
$object->host_state = '1';
$object->host_acknowledged = '0';
$commands = $meta->getCommandForObject($object, Meta::TYPE_SMALL);
$this->assertEquals(3, $commands[0]->id);
$this->assertEquals(26, $commands[1]->id);
}
public function testObjectForCommand2()
{
$meta = new Meta();
$object = new HostStruct();
$object->host_obsess_over_host = '0';
$object->host_flap_detection_enabled = '0';
$object->host_active_checks_enabled = '0';
$commands = $meta->getCommandForObject($object, Meta::TYPE_FULL);
$this->assertEquals(2, $commands[0]->id);
$this->assertEquals(6, $commands[3]->id);
}
/**
* @expectedException Icinga\Exception\ProgrammingError
* @expectedExceptionMessage Type has no commands defined: UNKNOWN
*/
public function testObjectForCommand3()
{
$meta = new Meta();
$test = new \stdClass();
$test->UNKNOWN_state = '2';
$test->UNKNOWN_flap_detection_enabled = '1';
$commands = $meta->getCommandForObject($test, Meta::TYPE_FULL);
}
}