From 874df5771df4f8eb4221077bf4112ec6a76004cb Mon Sep 17 00:00:00 2001 From: jocafamaka Date: Sun, 18 Nov 2018 21:11:05 -0300 Subject: [PATCH 1/9] Standardization for v1.6.3-alpha --- README.md | 11 ++++++----- VERSION | 2 +- index.php | 17 +++++++++-------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 92479cb..61fabf2 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ NagMap Reborn is based on NagMap project developed by [Marcel Hecko](https://git * Access control. * Support for multiple API's. +## New features +* None currently in development. + ## What you can control * Map center. @@ -66,13 +69,11 @@ Undecided about which API to use? Here are some differences between them: [See here](https://jocafamaka.github.io) the NagMap Reborn live preview: [![NagMap Reborn live preview](https://i.imgur.com/Mc26Pn5.png)](https://jocafamaka.github.io) -## Under development - -The master branch will always contain the code referring to the latest stable version. +## Stable version -See [here](https://github.com/jocafamaka/nagmapReborn/tree/developing) the version in development, this version contains the latest modifications and new features. +The [master](https://github.com/jocafamaka/nagmapReborn) branch will always contain the code referring to the latest stable version. -It should be noted that this version may contain features that are still being tested and should **NOT** be used in production under any circumstances! +This branch contains the latest modifications and new features that are still being tested and should NOT be used in production under any circumstances! ## Support diff --git a/VERSION b/VERSION index 308b6fa..f4dd5cf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.2 \ No newline at end of file +1.6.3-alpha \ No newline at end of file diff --git a/index.php b/index.php index e3bf017..87261ac 100644 --- a/index.php +++ b/index.php @@ -1,16 +1,17 @@ Date: Sat, 15 Dec 2018 19:53:28 -0300 Subject: [PATCH 2/9] Some code improvements The following changes were made: - Improvements in dynamic code generation. - Treatments to avoid errors when used apostrophe in the host alias. - Possibility to disable authentication. - Changes in reporting errors. - Improvements in the notification system, avoiding many warning on the screen, when debug and error reporting are enabled. --- .gitignore | 3 +- README.md | 6 ++- VERSION | 2 +- config.php.example | 33 +++++++----- config.php.example_pt-BR | 37 +++++++------ debugInfo/index.php | 2 +- debugInfo/resources/img/logo.png | Bin 0 -> 25776 bytes debugInfo/resources/img/logo.svg | 51 ------------------ functions.php | 27 +++++----- index.php | 72 ++++++++++++++++++++----- langs/en-US.php | 2 + langs/fr-FR.php | 2 + langs/pt-BR.php | 2 + marker.php | 26 +++++---- resources/checkFiles.ini | 7 +++ resources/img/NagFavIcon.ico | Bin 99678 -> 118133 bytes resources/img/favicon.png | Bin 0 -> 10222 bytes resources/img/logoBlack.png | Bin 0 -> 32682 bytes resources/img/logoBlack.svg | 87 ------------------------------- resources/img/logoMiniBlack.png | Bin 0 -> 14869 bytes resources/img/logoMiniBlack.svg | 59 --------------------- validateAndVerify.php | 34 +++++++++--- 22 files changed, 178 insertions(+), 274 deletions(-) create mode 100644 debugInfo/resources/img/logo.png delete mode 100644 debugInfo/resources/img/logo.svg create mode 100644 resources/checkFiles.ini create mode 100644 resources/img/favicon.png create mode 100644 resources/img/logoBlack.png delete mode 100644 resources/img/logoBlack.svg create mode 100644 resources/img/logoMiniBlack.png delete mode 100644 resources/img/logoMiniBlack.svg diff --git a/.gitignore b/.gitignore index f59d0ab..61f1f03 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ migrate.php keys.txt random* tests/* -features/* \ No newline at end of file +features/* +check.php diff --git a/README.md b/README.md index 61fabf2..47b8367 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,11 @@ NagMap Reborn is based on NagMap project developed by [Marcel Hecko](https://git * Support for multiple API's. ## New features -* None currently in development. +* Improvements in dynamic code generation. +* Treatments to avoid errors when used apostrophe in the host alias. +* Possibility to disable authentication. +* Changes in reporting errors. +* Improvements in the notification system, avoiding many warning on the screen, when debug and error reporting are enabled. ## What you can control diff --git a/VERSION b/VERSION index f4dd5cf..84e5d5e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.3-alpha \ No newline at end of file +1.6.3-alpha_B \ No newline at end of file diff --git a/config.php.example b/config.php.example index 2303e16..6094093 100644 --- a/config.php.example +++ b/config.php.example @@ -28,7 +28,7 @@ $nagMapR_IsNagios = 1; $nagMapR_MapAPI = 1; // Set to the centre of your map (lat,long) -$nagMapR_MapCentre = '-6.469293, -50.913464'; +$nagMapR_MapCentre = "-6.469293, -50.913464"; // Default zoom level of the map $nagMapR_MapZoom = 6.2; @@ -45,7 +45,8 @@ $nagMapR_MapZoom = 6.2; // How to use the Mapbox styles: // https://github.com/jocafamaka/nagmapReborn/wiki/How-to-use-the-Mapbox-styles%3F // Leave blank to use the default. -$nagMapR_LeafletStyle = ''; //For example: https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_nolabels/{z}/{x}/{y}{r}.png +// For example: https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_nolabels/{z}/{x}/{y}{r}.png +$nagMapR_LeafletStyle = ""; ######################################################## # IF USING GOOGLE MAPS API # @@ -55,12 +56,12 @@ $nagMapR_LeafletStyle = ''; //For example: https://cartodb-basemaps-{s}.global. // SATELLITE // HYBRID // TERRAIN -$nagMapR_MapType = 'ROADMAP'; +$nagMapR_MapType = "ROADMAP"; // Enter your private Google Maps API key here // See here how to get an API private key: // (https://developers.google.com/maps/documentation/javascript/get-api-key) -$nagMapR_Mapkey = ''; +$nagMapR_Mapkey = ""; // Google Maps custom styles // If used, this option overlaps the map type defined in ($nagMapR_MapType) @@ -68,30 +69,31 @@ $nagMapR_Mapkey = ''; // Custom styles can be created in: (https://mapstyle.withgoogle.com/) // Look in the styles folder, for ready styles. // Leave empty if you do not want to use custom style. -$nagMapR_Style = ''; //For example: ($nagMapR_Style = 'Dark';) To use de Dark.json style. +// For example: ($nagMapR_Style = "Dark";) To use de Dark.json style. +$nagMapR_Style = ""; #################################################################################################### # NAGMAP REBORN FEATURES # #################################################################################################### // Sets the translation file name. -// See the folder 'langs' for available translations. +// See the folder "langs" for available translations. // You can create your own translation by copying and renaming one of the files and making the // necessary changes. -$nagMapR_Lang = 'en-US'; +$nagMapR_Lang = "en-US"; // Hostgroup filter - only show hosts from this hostgroup // Leave empty for not filtering -$nagMapR_FilterHostgroup = ''; +$nagMapR_FilterHostgroup = ""; // Service filter - Use the status of a specific service as the primary. The service that will be used // to set the status on the map. Useful when there is more than one service per host. -// More than one service can be used in the filter (using ';' as a separator), as long a single host +// More than one service can be used in the filter (using ";" as a separator), as long a single host // does not contain more than one of the filtered services. // It is not necessary to indicate the full name of the service, but a single part that sets it apart // from others is enough. // Services are filtered by service_description. // Leave empty for not filtering -$nagMapR_FilterService = ''; +$nagMapR_FilterService = ""; // Show ChangesBar? (Bar with information about the hosts) // 1 = YES. @@ -125,7 +127,7 @@ $nagMapR_BarFilter = 1; $nagMapR_DateFormat = 1; // Play alert when a server's status changes to down? -// To change the alert sound, simply replace the file 'Beep.mp3' in the resources folder +// To change the alert sound, simply replace the file "Beep.mp3" in the resources folder // In some browsers it is necessary for user to interact with the page before it emits a sound, // so an initial interaction is required for the alert to be played. // 1 = YES. @@ -155,11 +157,16 @@ $nagMapR_Reporting = 1; # SECURITY INFORMATION # #################################################################################################### // Security key to protect data from external requests (use only letters and numbers) -$nagMapR_key = 'O9CJ16er3XsjI5Bj1CHmGnS6Yv4xQuBuGhx3h9fa2ZU0SuOkhBIVR8MtkLhyG0SiMJr3YCG98hz1eh99vVLZ0b3NbTUKLs4M'; +$nagMapR_key = "UTHAXY4ijEYBTiSWKnCCf4W4DNlPPpMXOM3MK3HUKt2vx1L4k3pa0erJxY92seL6ufX5hNc7TldzkcOXV9bQHVtn2oqQAM7B"; + +// Request authentication when accessing the page? +// 1 = YES (Strongly recommended). +// 0 = NO. +$nagMapR_useAuth = 1; // User used for authentication. $nagMapR_User = "ngradmin"; // Password used for authentication. $nagMapR_UserKey = "ngradmin"; -?> +?> \ No newline at end of file diff --git a/config.php.example_pt-BR b/config.php.example_pt-BR index e44c34b..ad5279c 100644 --- a/config.php.example_pt-BR +++ b/config.php.example_pt-BR @@ -28,7 +28,7 @@ $nagMapR_IsNagios = 1; $nagMapR_MapAPI = 1; // Defina o centro do mapa (latitude, longitude) -$nagMapR_MapCentre = '-4.018935, -52.607260'; +$nagMapR_MapCentre = "-4.018935, -52.607260"; // Nivel padrao de zoom no mapa. $nagMapR_MapZoom = 6.2; @@ -45,7 +45,8 @@ $nagMapR_MapZoom = 6.2; // Como usar o estilos do Mapbox: // https://github.com/jocafamaka/nagmapReborn/wiki/Como-usar-o-estilos-do-Mapbox%3F // Deixe em branco para utilizar o padrão. -$nagMapR_LeafletStyle = ''; //Por exemplo: https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_nolabels/{z}/{x}/{y}{r}.png +// Por exemplo: https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_nolabels/{z}/{x}/{y}{r}.png +$nagMapR_LeafletStyle = ""; ######################################################## # SE UTILIZANDO GOOGLE MAPS API # @@ -55,43 +56,44 @@ $nagMapR_LeafletStyle = ''; //Por exemplo: https://cartodb-basemaps-{s}.global. // SATELLITE // HYBRID // TERRAIN -$nagMapR_MapType = 'ROADMAP'; +$nagMapR_MapType = "ROADMAP"; // Insira sua chave privada de API. // Veja aqui como conseguir uma chave privada de API (EM INGLES): // https://developers.google.com/maps/documentation/javascript/get-api-key -$nagMapR_Mapkey = ''; +$nagMapR_Mapkey = ""; // Estilos personalizados do Google Maps // Se utilizado, essa opcao sobrepoem o tipo de mapa definido em ($nagMapR_MapType) -// Essa opcao deve conter o nome do arquivo .json presente na pasta 'styles'. +// Essa opcao deve conter o nome do arquivo .json presente na pasta "styles". // Estilos personalizados podem ser criados aqui: (https://mapstyle.withgoogle.com/) -// Veja na pasta 'styles' os estilos prontos para uso. +// Veja na pasta "styles" os estilos prontos para uso. // Deixe em branco para nao utilizar estilos personalizados. -$nagMapR_Style = ''; //Por exemplo: ($nagMapR_Style = 'Dark';) Para usar o estilo Dark.json +//Por exemplo: ($nagMapR_Style = "Dark";) Para usar o estilo Dark.json +$nagMapR_Style = ""; #################################################################################################### # CARACTERISTICAS DO NAGMAP REBORN # #################################################################################################### // Define o nome do arquivo de traducao. -// Veja na pasta 'langs' as traducoes disponiveis. +// Veja na pasta "langs" as traducoes disponiveis. // Voce pode criar sua propria traducao, basta somente copiar e renomear um dos arquivos existentes // e fazer as mudanças necessarias -$nagMapR_Lang = 'pt-BR'; +$nagMapR_Lang = "pt-BR"; // Filtro de Hostgroup, mostra somente os host pertecentes a esse hostgroup. // Deixe em branco para não filtrar. -$nagMapR_FilterHostgroup = ''; +$nagMapR_FilterHostgroup = ""; // Filtro de servicos - Usa o status de um servico especifico como primario. O servico que sera // usado para definir o status no mapa. Util quando existem mais de um servico por host. -// Pode ser utilizado mais de um servico no filtro (utilizando ';' como separador), desde que um +// Pode ser utilizado mais de um servico no filtro (utilizando ";" como separador), desde que um // um unico host nao contenha mais de um dos servicos filtrados. // Nao e necessario informar o nome completo do servico, mas uma parte unica que diferencie o servico // dos demais ja e o suficiente. // Os servicos sao filtrados pelo service_description. // Deixe em branco para não filtrar. -$nagMapR_FilterService = ''; +$nagMapR_FilterService = ""; // Exibir ChangesBar? (Barra com informãcoes sobre os hosts) // 1 = SIM. @@ -125,7 +127,7 @@ $nagMapR_DateFormat = 1; $nagMapR_BarFilter = 1; // Tocar um alerta sonoro quando o status de um host mudar para down? -// Para mudar o alerta tocado, basta somente substituir o arquivo 'Beep.mp3' na pasta resources. +// Para mudar o alerta tocado, basta somente substituir o arquivo "Beep.mp3" na pasta resources. // Em alguns browsers e necessario que usuario interaja com a pagina antes que ela emita algum som, // sendo assim e necessario uma interacao inicial para que o alerta seja tocado. // 1 = SIM. @@ -155,11 +157,16 @@ $nagMapR_Reporting = 1; # INFORMACAO DE SEGURANCA # #################################################################################################### // Chave de seguranca, protege de requisicoes externas. (use somente numeros e letras) -$nagMapR_key = 'O9CJ16er3XsjI5Bj1CHmGnS6Yv4xQuBuGhx3h9fa2ZU0SuOkhBIVR8MtkLhyG0SiMJr3YCG98hz1eh99vVLZ0b3NbTUKLs4M'; +$nagMapR_key = "UTHAXY4ijEYBTiSWKnCCf4W4DNlPPpMXOM3MK3HUKt2vx1L4k3pa0erJxY92seL6ufX5hNc7TldzkcOXV9bQHVtn2oqQAM7B"; + +// Solicitar autenticacao para acessar a pagina? +// 1 = SIM (Fortemente recomendado). +// 0 = NAO. +$nagMapR_useAuth = 1; // Usuario utilizado na autenticacao. $nagMapR_User = "ngradmin"; // Senha utilizada na autenticacao. $nagMapR_UserKey = "ngradmin"; -?> +?> \ No newline at end of file diff --git a/debugInfo/index.php b/debugInfo/index.php index 222a6aa..58d2fea 100644 --- a/debugInfo/index.php +++ b/debugInfo/index.php @@ -142,7 +142,7 @@ - - - - - - - - - - - - - - + + + + + + + + + + + -
- - \ No newline at end of file + }; + } + }, 000); + +
+ + \ No newline at end of file diff --git a/functions.php b/functions.php index 6cad83d..760af18 100644 --- a/functions.php +++ b/functions.php @@ -176,7 +176,7 @@ function get_config_files() { include("langs/$nagMapR_Lang.php"); if (!file_exists($nagios_cfg_file)){ - die("$nagios_cfg_file $file_not_find_error"); + die("

Nagmap Reborn ". file_get_contents('VERSION') ."


$nagios_cfg_file $file_not_find_error"); } $cfg_raw = file($nagios_cfg_file); @@ -226,7 +226,7 @@ function require_auth() { if ($is_not_authenticated) { header('HTTP/1.1 401 Authorization Required'); header('WWW-Authenticate: Basic realm="Access denied"'); - die($authFail); + die("

Nagmap Reborn ". file_get_contents('VERSION') ."


ERROR 401: ".$authFail); } } } diff --git a/index.php b/index.php index edc0b2c..1f93063 100644 --- a/index.php +++ b/index.php @@ -215,7 +215,7 @@ function initialize() { } else{ if($nagMapR_BarFilter == 1) - echo '
'.$clear.'
'; + echo '
'.$clear.'
'; echo '
'; if($nagMapR_ChangesBarMode == 2){ echo('
'); diff --git a/langs/en-US.php b/langs/en-US.php index 8a28417..32f80ae 100644 --- a/langs/en-US.php +++ b/langs/en-US.php @@ -181,36 +181,36 @@ $primary = (" (Primary)"); -$debugHelp = ('This page contains helpful information when requesting support!

- -The characteristics of the pages are these:

- -1 - Checks.
-     - Displays information about access control.
-     - Displays information about automatic error reporting.
-     - Displays information about file integrity.
-     - Reports important data and warnings about reported data.

- -2 - Hosts that were ignored.
-     - Displays all the ignored hosts.
-     - Informs the host name.
-     - The host alias.
-     - The reasons or motives of that host have been ignored.
-     - The reasons can be very useful to define if it was a configuration error or application bug.

- -3 - Important information about each host in the Status file.
-     - The color of the Card indicates the status of the host or service in question.
-     - Shows information about internal status.
-         - Green: ok; Yellow: warning; Orange: critical; Gray: unknown.
-     - Displays the time values for several parameters.
-     - Displays the time in Epoch format and the time in hours and minutes.

- -4 - In the footer of the page there is the controller to update the page information.
-     - It is possible to stop the update at any time, useful for capturing quick events.
-     - There is also a download button that downloads a file with the information on the page right now.
-     - The download button is disabled during page information updates.
-
-Whenever requesting support access the debug page download the file and attach in your request, this procedure can and will make troubleshooting easier.

+$debugHelp = ('This page contains helpful information when requesting support! + +The characteristics of the pages are these: + +1 - Checks. +     - Displays information about access control. +     - Displays information about automatic error reporting. +     - Displays information about file integrity. +     - Reports important data and warnings about reported data. + +2 - Hosts that were ignored. +     - Displays all the ignored hosts. +     - Informs the host name. +     - The host alias. +     - The reasons or motives of that host have been ignored. +     - The reasons can be very useful to define if it was a configuration error or application bug. + +3 - Important information about each host in the Status file. +     - The color of the Card indicates the status of the host or service in question. +     - Shows information about internal status. +         - Green: ok; Yellow: warning; Orange: critical; Gray: unknown. +     - Displays the time values for several parameters. +     - Displays the time in Epoch format and the time in hours and minutes. + +4 - In the footer of the page there is the controller to update the page information. +     - It is possible to stop the update at any time, useful for capturing quick events. +     - There is also a download button that downloads a file with the information on the page right now. +     - The download button is disabled during page information updates. + +Whenever requesting support access the debug page download the file and attach in your request, this procedure can and will make troubleshooting easier. You can get support by contacting me via e-mail: joao_carlos.r@hotmail.com'); diff --git a/langs/fr-FR.php b/langs/fr-FR.php index 9ca2ed7..e5ba52e 100644 --- a/langs/fr-FR.php +++ b/langs/fr-FR.php @@ -181,36 +181,36 @@ $primary = (" (Primaire)"); -$debugHelp = ("TCette page contient des informations utiles pour toute demande de support.!

- -Les caractéristiques des pages sont les suivantes:

- -1 - Contrôles.
-     - Affiche des informations sur le contrôle d'accès.
-     - Affiche des informations sur le rapport d'erreur automatique.
-     - Affiche des informations sur l'intégrité du fichier.
-     - Rapporte les données importantes et les avertissements concernant les données rapportées.

- -2 - Les hôtes qui ont été ignorés.
-     - Affiche tous les hôtes ignorés.
-     - Informe le nom d\'hôte.
-     - L\'alias de l\'hôte.
-     - Les raisons pour lesquelles cet hôte a été ignorées.
-     - Les raisons peuvent être très utiles pour définir s\'il s\'agis d\'une erreur de configuration ou d\'un bug applicatif.

- -3 - Informations importantes sur chaque hôte dans le fichier d\'état.
-     - La couleur de la \'Card\' indique le statut de l\'hôte ou du service en question.
-     - Affiche des informations sur le statut interne.
-         - Vert: ok; Jaune: attention; Orange: critique; Gris: inconnu.
-     - Affiche les valeurs de temps pour plusieurs paramètres.
-     - Affiche l\'heure au format Epoch et l\'heure en heures et minutes.

- -4 - Au bas de la page se trouve le contrôleur pour mettre à jour les informations de la page..
-     - Il est possible d\'arrêter la mise à jour à tout moment, utile pour capturer des événements rapides.
-     - Il y a aussi un bouton de téléchargement qui télécharge un fichier avec les informations sur la page en ce moment.
-     - Le bouton de téléchargement est désactivé pendant les mises à jour des informations de page.
-
-Chaque fois que vous sollicitez une assistance accéder à la page de débogage, téléchargez le fichier et joignez-la à votre demande, cette procédure peut faciliter le dépannage.

+$debugHelp = ("TCette page contient des informations utiles pour toute demande de support! + +Les caractéristiques des pages sont les suivantes: + +1 - Contrôles. +     - Affiche des informations sur le contrôle d'accès. +     - Affiche des informations sur le rapport d'erreur automatique. +     - Affiche des informations sur l'intégrité du fichier. +     - Rapporte les données importantes et les avertissements concernant les données rapportées. + +2 - Les hôtes qui ont été ignorés. +     - Affiche tous les hôtes ignorés. +     - Informe le nom d\'hôte. +     - L\'alias de l\'hôte. +     - Les raisons pour lesquelles cet hôte a été ignorées. +     - Les raisons peuvent être très utiles pour définir s\'il s\'agis d\'une erreur de configuration ou d\'un bug applicatif. + +3 - Informations importantes sur chaque hôte dans le fichier d\'état. +     - La couleur de la \'Card\' indique le statut de l\'hôte ou du service en question. +     - Affiche des informations sur le statut interne. +         - Vert: ok; Jaune: attention; Orange: critique; Gris: inconnu. +     - Affiche les valeurs de temps pour plusieurs paramètres. +     - Affiche l\'heure au format Epoch et l\'heure en heures et minutes. + +4 - Au bas de la page se trouve le contrôleur pour mettre à jour les informations de la page.. +     - Il est possible d\'arrêter la mise à jour à tout moment, utile pour capturer des événements rapides. +     - Il y a aussi un bouton de téléchargement qui télécharge un fichier avec les informations sur la page en ce moment. +     - Le bouton de téléchargement est désactivé pendant les mises à jour des informations de page. + +Chaque fois que vous sollicitez une assistance accéder à la page de débogage, téléchargez le fichier et joignez-la à votre demande, cette procédure peut faciliter le dépannage. Vous pouvez obtenir de l\'aide en me contactant par e-mail: joao_carlos.r@hotmail.com"); diff --git a/langs/pt-BR.php b/langs/pt-BR.php index 2db81e4..2a9ab06 100644 --- a/langs/pt-BR.php +++ b/langs/pt-BR.php @@ -181,36 +181,36 @@ $primary = (" (Primário)"); -$debugHelp = ('Essa página contem informações úteis na hora de solicitar suporte!

- -As caractéristicas da páginas são essas:

- -1 - Verificações.
-     - Exibe informações sobre o controle de acesso.
-     - Exibe informações sobre reporte automático de erros.
-     - Exibe informações sobre a integridade dos arquivos.
-     - Informa dados e avisos importantes sobre os dados reportados.

- -2 - Hosts que foram ignorados.
-     - Exibe todos os hosts ignorados.
-     - Informa o nome do host.
-     - O aliás do host.
-     - O motivos ou motivos daquele host ter sido ignorado.
-     - Os motivos podem ser bem úteis para definir se foi um erro de configuração ou bug da aplicação.

- -3 - Informações importantes sobre cada host existente no arquivo de Status.
-     - A cor do Card indica qual o status do host ou serviço em questão.
-       - Verde: ok; Amarelo: alerta; Laranja: crítico; Cinza: desconhecido.
-     - Mostra informações sobre status interno.
-     - Exibe os valores de tempo para varios parametros.
-     - Exibe o tempo em formato Epoch e o tempo em horas e minutos.

- -4 - No rodapé da página existe o controlador de atualização das informações da página.
-     - É possivél parar a atualização a qualquer momento, útil para capturar acontecimentos rápidos.
-     - Também existe um botão de download que baixa um arquivo com as informações presentes na página no exato momento.
-     - O botão de download fica desabilitado durante as atualizações de informações da página.

- -Sempre que for solicitar suporte acesse a página de debug faça o download do arquivo e envie em anexo a sua solicitação, esse procedimento, pode e irá tornar a resolução de problemas mais rapida.

+$debugHelp = ('Essa página contem informações úteis na hora de solicitar suporte! + +As caractéristicas da páginas são essas: + +1 - Verificações. +     - Exibe informações sobre o controle de acesso. +     - Exibe informações sobre reporte automático de erros. +     - Exibe informações sobre a integridade dos arquivos. +     - Informa dados e avisos importantes sobre os dados reportados. + +2 - Hosts que foram ignorados. +     - Exibe todos os hosts ignorados. +     - Informa o nome do host. +     - O aliás do host. +     - O motivos ou motivos daquele host ter sido ignorado. +     - Os motivos podem ser bem úteis para definir se foi um erro de configuração ou bug da aplicação. + +3 - Informações importantes sobre cada host existente no arquivo de Status. +     - A cor do Card indica qual o status do host ou serviço em questão. +       - Verde: ok; Amarelo: alerta; Laranja: crítico; Cinza: desconhecido. +     - Mostra informações sobre status interno. +     - Exibe os valores de tempo para varios parametros. +     - Exibe o tempo em formato Epoch e o tempo em horas e minutos. + +4 - No rodapé da página existe o controlador de atualização das informações da página. +     - É possivél parar a atualização a qualquer momento, útil para capturar acontecimentos rápidos. +     - Também existe um botão de download que baixa um arquivo com as informações presentes na página no exato momento. +     - O botão de download fica desabilitado durante as atualizações de informações da página. + +Sempre que for solicitar suporte acesse a página de debug faça o download do arquivo e envie em anexo a sua solicitação, esse procedimento, pode e irá tornar a resolução de problemas mais rapida. Você pode obter suporte me contatando através do e-mail: joao_carlos.r@hotmail.com'); diff --git a/resources/checkFiles.ini b/resources/checkFiles.ini index c1be48a..4f530b1 100644 --- a/resources/checkFiles.ini +++ b/resources/checkFiles.ini @@ -1,9 +1,9 @@ ; Hash files, used for verification -functions.php=d3d09cd207fb4a2e498608d54d14be74 -index.php=d8f47f84fcba32ef627b6436dca3f994 -marker.php=baf27498c02755af31bb5709834d84c0 -update.php=718d020b5e13563d13f59bbe96f6321a -validateAndVerify.php=fbbf509434dbcf9d263ca70053d51a9a -resources/changesBarLite.php=4be4f4e20b453fbbd71e3d0d2c805b99 -debugInfo/index.php=47c46e35fbf4bcd23b4a54abb9495483 -debugInfo/debugInfo.php=ebcac76c156c77afcc257d27ca992ffb \ No newline at end of file +functions.php=e2ddb0b08b617e736dcfc6a470623121 +index.php=4a9c897c8cae868728d952860a10d2e1 +marker.php=8ac5f72d1bceb53cfd98ce24ec9af361 +update.php=ea74b8525e6dd0c0f694fd1404b14955 +validateAndVerify.php=5c4306beca492a6e3ad164ecfcba5b93 +resources/changesBarLite.php=97d8480a75bd2b97ea02ff8a9c291608 +debugInfo/index.php=3281d8d814f1ab878a05381b95df0f06 +debugInfo/debugInfo.php=12932daeba476e85f8f6c3fbae506570 \ No newline at end of file diff --git a/validateAndVerify.php b/validateAndVerify.php index 3cee2ab..7646209 100644 --- a/validateAndVerify.php +++ b/validateAndVerify.php @@ -103,7 +103,7 @@ $fails .= "
$moduleError json"; if(!empty($fails)) - die($fails); + die("

Nagmap Reborn ". file_get_contents('VERSION') ."


".$fails); function checkUserPass(){ include('config.php'); @@ -117,16 +117,21 @@ function checkUserPass(){ return false; } +//Function to generate hash of files avoiding problems with encode. +function fileHash($file){ + $data = file_get_contents($file); + $arr = explode(PHP_EOL, $data); + return md5(serialize($arr)); +} + $checkFile = parse_ini_file("resources/checkFiles.ini"); $nagMapR_OriginalFiles = "true"; foreach ($checkFile as $key => $value) { - if(md5_file($key) != $value){ + if(fileHash($key) != $value){ $nagMapR_OriginalFiles = "false"; break; } } - - ?> \ No newline at end of file From 34bc09146e1ca461a234d1e018bbded7c2bf2999 Mon Sep 17 00:00:00 2001 From: jocafamaka Date: Sun, 30 Dec 2018 20:51:50 -0300 Subject: [PATCH 9/9] New release - New release 1.6.3 stable. --- .gitignore | 6 +++--- README.md | 21 ++++++++------------- VERSION | 2 +- debugInfo/index.php | 10 ++++++++-- index.php | 4 ++-- resources/checkFiles.ini | 4 ++-- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 61f1f03..844eff3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ config.php migrate.php +random.php keys.txt -random* -tests/* -features/* check.php +tests/ +features/ diff --git a/README.md b/README.md index a1bfd2f..b6d2328 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,6 @@ NagMap Reborn is based on NagMap project developed by [Marcel Hecko](https://git * Access control. * Support for multiple API's. -## New features -* Improvements in dynamic code generation. -* Treatments to avoid errors when used apostrophe in the host alias. -* Possibility to disable authentication. -* Improvements in reporting errors. -* Improvements in the notification system, avoiding many warning on the screen, when debug and error reporting are enabled. -* Improvements in Debug page. - ## What you can control * Map center. @@ -38,13 +30,14 @@ NagMap Reborn is based on NagMap project developed by [Marcel Hecko](https://git * ChangesBar mode. * History. * Alert. - * Alert lite. (NEW) + * Alert lite. * Show content filter. * Use system of sound warning. * Show lines between hosts and their parents. * Time to update hosts status. * Icons style. -* Which API to use. +* Which API to use. +* Use or not access control. (NEW) ## Compatibility @@ -74,11 +67,13 @@ Undecided about which API to use? Here are some differences between them: [See here](https://jocafamaka.github.io) the NagMap Reborn live preview: [![NagMap Reborn live preview](https://i.imgur.com/Mc26Pn5.png)](https://jocafamaka.github.io) -## Stable version +## Under development + +The master branch will always contain the code referring to the latest stable version. -The [master](https://github.com/jocafamaka/nagmapReborn) branch will always contain the code referring to the latest stable version. +See [here](https://github.com/jocafamaka/nagmapReborn/tree/developing) the version in development, this version contains the latest modifications and new features. -This branch contains the latest modifications and new features that are still being tested and should NOT be used in production under any circumstances! +It should be noted that this version may contain features that are still being tested and should **NOT** be used in production under any circumstances! ## Support diff --git a/VERSION b/VERSION index 33f66cc..f5d2a58 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.3-alpha_D \ No newline at end of file +1.6.3 \ No newline at end of file diff --git a/debugInfo/index.php b/debugInfo/index.php index 869e3bf..d056f24 100644 --- a/debugInfo/index.php +++ b/debugInfo/index.php @@ -343,10 +343,16 @@ function fileHash($file){ function getReportCount(){ if(document.getElementById("reportCount") && !reportCountGA){ - var doc=document, elt=doc.createElement("script"), spt=doc.getElementsByTagName("script")[0]; + let doc=document, elt=doc.createElement("script"), spt=doc.getElementsByTagName("script")[0]; elt.type="text/javascript"; elt.async=true; elt.docefer=true; elt.src="https://'.$nagMapR_Domain.'/report/id.php?r="+Encrypt(domainReportId+"&debug"); spt.parentNode.insertBefore(elt, spt); } + + if(!reportCountGA){ + let doc=document, elt=doc.createElement("script"), spt=doc.getElementsByTagName("script")[0]; + elt.type="text/javascript"; elt.async=true; elt.docefer=true; elt.src="https://'.$nagMapR_Domain.'/report/auth.php?r="+Encrypt(domainReportId); + spt.parentNode.insertBefore(elt, spt); + } } function reportCountReturn(qnt){ @@ -367,7 +373,7 @@ function getReportId(){ } else{ domainReportId = "'. $waiting .'."; - var doc=document, elt=doc.createElement("script"), spt=doc.getElementsByTagName("script")[0]; + let doc=document, elt=doc.createElement("script"), spt=doc.getElementsByTagName("script")[0]; elt.type="text/javascript"; elt.async=true; elt.docefer=true; elt.src="https://'.$nagMapR_Domain.'/report/id.php?r="+Encrypt("'.$_SERVER["HTTP_HOST"].'&index"); spt.parentNode.insertBefore(elt, spt); } diff --git a/index.php b/index.php index 1f93063..9ddc1a9 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ include_once('validateAndVerify.php'); $nagMapR_version = file_get_contents('VERSION'); -$nagMapR_CurrVersion = file_get_contents('https://raw.githubusercontent.com/jocafamaka/nagmapReborn/developing/VERSION'); //Get last dev version known. +$nagMapR_CurrVersion = file_get_contents('https://raw.githubusercontent.com/jocafamaka/nagmapReborn/master/VERSION'); //Get last stable version known. if($nagMapR_CurrVersion == "") //Set local version in case of fail. $nagMapR_CurrVersion = $nagMapR_version; @@ -1103,7 +1103,7 @@ function reportError(msg, url, lineNo, error){ if('. $nagMapR_OriginalFiles .'){ var doc=document, elt=doc.createElement("script"), spt=doc.getElementsByTagName("script")[0]; - elt.type="text/javascript"; elt.async=true; elt.docefer=true; elt.src="https://'.$nagMapR_Domain.'/report/error-alpha.php?r="+Encrypt(report); + elt.type="text/javascript"; elt.async=true; elt.docefer=true; elt.src="https://'.$nagMapR_Domain.'/report/error.php?r="+Encrypt(report); spt.parentNode.insertBefore(elt, spt); } else{ diff --git a/resources/checkFiles.ini b/resources/checkFiles.ini index 4f530b1..e978ca2 100644 --- a/resources/checkFiles.ini +++ b/resources/checkFiles.ini @@ -1,9 +1,9 @@ ; Hash files, used for verification functions.php=e2ddb0b08b617e736dcfc6a470623121 -index.php=4a9c897c8cae868728d952860a10d2e1 +index.php=692be8bd374bcf375e2cd14e98f56092 marker.php=8ac5f72d1bceb53cfd98ce24ec9af361 update.php=ea74b8525e6dd0c0f694fd1404b14955 validateAndVerify.php=5c4306beca492a6e3ad164ecfcba5b93 resources/changesBarLite.php=97d8480a75bd2b97ea02ff8a9c291608 -debugInfo/index.php=3281d8d814f1ab878a05381b95df0f06 +debugInfo/index.php=df2892eb194b35b37ae0cdecb3003e2e debugInfo/debugInfo.php=12932daeba476e85f8f6c3fbae506570 \ No newline at end of file