'));
-$conttp->setVariable('IMPORT_INFO_2', '' .translate('Check your configuration after '
+ . 'configurations in a useful order. We recommend to do it like this:
'
- . 'If this values are set by a template, you can save anyway - otherwise you will get an invalid '
+ 'string' => '' . translate('Warning:') . ' ' . translate('You have not filled in some required fields!
'
+ . 'If these values are set by a template, you can save anyway - otherwise you will get an invalid '
. 'configuration!'));
-$arrDescription[] = array('name' => 'LANG_TPLNAME', 'string' => translate('Template name'));
-$arrDescription[] = array('name' => 'LANG_NAGIOS_BASEDIR', 'string' => translate('Nagios base directory'));
-$arrDescription[] = array('name' => 'LANG_WRITE_CONFIG', 'string' => translate('Write config'));
+$arrDescription[] = array('name' => 'LANG_TPLNAME', 'string' => translate('Template name'));
+$arrDescription[] = array('name' => 'LANG_NAGIOS_BASEDIR', 'string' => translate('Nagios base directory'));
+$arrDescription[] = array('name' => 'LANG_WRITE_CONFIG', 'string' => translate('Write config'));
$arrDescription[] = array('name' => 'FILL_ARGUMENTS',
- 'string' => '' .translate('Warning:'). ' ' .translate('You have not filled in all command arguments (ARGx) '
- . 'for your selected command!
If this arguments are optional, you can save anyway - otherwise '
+ 'string' => '' . translate('Warning:') . ' ' . translate('You have not filled in all command arguments (ARGx) '
+ . 'for your selected command!
"
msgstr ""
-"Um Fehler und Fehlkonfigurationen vorzubeugen, sollte der Import soweit "
-"möglich in einer sinnvollen Reihenfolge vorgenommen werden. Wir empfehlen "
-"folgenden Ablauf:
"
+"Um Fehler oder Fehlkonfigurationen zu vermeiden, sollten Sie Ihre "
+"Konfigurationen in einer sinnvollen Reihenfolge importieren. Wir empfehlen "
+"Ihnen, wie folgt vorzugehen:
"
-#: admin/import.php:113
+#: admin/import.php:129
msgid ""
"Check your configuration after import! In cause of an error or an "
"uncomplete configuration, re-importing the wrong configuration can solve the "
@@ -814,21 +815,21 @@ msgstr ""
"eines Fehlers oder einer unvollständigen Konfiguration kann ein erneuter "
"Import der einzelnen fehlerhaften Konfiguration oft Abhilfe schaffen."
-#: admin/info.php:43
+#: admin/info.php:46
msgid "This is relative path of your NagiosQL Installation"
msgstr "Der Pfad aus Sicht des Webservers"
-#: admin/info.php:44
+#: admin/info.php:47
msgid "This is the absolut path to your NagiosQL Installation"
msgstr "Der komplette Pfad zur NagiosQL Installation"
-#: admin/info.php:45
+#: admin/info.php:48
msgid "If you need a secure connection, select HTTPS instead of HTTP"
msgstr ""
"Wenn eine gesicherte Verbindung benutzt werden soll, muss die Installation "
"mit Angabe von https anstatt http erneut ausgeführt werden"
-#: admin/info.php:46
+#: admin/info.php:49
msgid ""
"Please choose a temporary directory with write permissions. The default is "
"the temp directory provided by your OS"
@@ -836,12 +837,12 @@ msgstr ""
"Der Pfad zu einem temporären Verzeichnis das zur Zwischenspeicherung der "
"Daten benötigt wird, normalerweise unter Linux /tmp"
-#: admin/info.php:48
+#: admin/info.php:51
msgid "Please choose your application language for new users and login portal"
msgstr ""
"Bitte wählen Sie die Sprache für neue NagiosQL Benutzer und das Login-Portal"
-#: admin/info.php:49
+#: admin/info.php:52
msgid ""
"Encoding should be set to nothing else than utf-8. Any changes at your own "
"risk"
@@ -849,20 +850,20 @@ msgstr ""
"Die Kodierung sollte auf utf-8 stehen bleiben. Alle Ändeurngen auf Ihr "
"eigenes Risiko"
-#: admin/info.php:50
+#: admin/info.php:53
msgid "IP-Address or hostname of the database server e.g. localhost"
msgstr ""
"Auflösbarer Hostname oder IP-Adresse des Datenbank Servers z.B. localhost"
-#: admin/info.php:51
+#: admin/info.php:54
msgid "MySQL Server Port, default is 3306"
msgstr "MySQL Server Port, Vorgabewert ist 3306"
-#: admin/info.php:52
+#: admin/info.php:55
msgid "Name of the NagiosQL database e.g. db_nagiosql_v3"
msgstr "Name der NagiosQL Datenbank z.B. db_nagiosql_v3"
-#: admin/info.php:53
+#: admin/info.php:56
msgid ""
"User with sufficient permission for the NagiosQL database At least this "
"user should have SELECT, INSERT, UPDATE, DELETE permissions"
@@ -871,11 +872,11 @@ msgstr ""
"Benutzer sollte zumindest SELECT, INSERT, UPDATE und DELETE Berechtigungen "
"haben"
-#: admin/info.php:55
+#: admin/info.php:58
msgid "Password for the above mentioned user"
msgstr "Passwort des o.a. Benutzers"
-#: admin/info.php:56
+#: admin/info.php:59
msgid ""
"After the defined amount of seconds the session will terminate for security "
"reasons"
@@ -883,7 +884,7 @@ msgstr ""
"Aus Sicherheitsgründen wird die Sitzung nach der hier angebeben Anzahl von "
"Sekunden bei Inaktivität beendet"
-#: admin/info.php:58
+#: admin/info.php:61
msgid ""
"Decide between authentication based on your Webserver e.g. Apache "
"configuration (config file or htaccess) or NagiosQL"
@@ -891,14 +892,14 @@ msgstr ""
"Authentizierung auf Basis von NagiosQL oder über den Webserver. Über den "
"Webserver lässt sich z.B. auch eine LDAP Verbindung realisieren"
-#: admin/info.php:60
+#: admin/info.php:63
msgid ""
"Number of entries per side that should be visible (e.g. services or hosts)"
msgstr ""
"Wieviel Einträge pro Seite sollen angezeigt werden (z.B. bei Hosts oder "
"Services)"
-#: admin/info.php:61
+#: admin/info.php:64
msgid ""
"Method of selection of multiple entries by using the new dialog or by "
"holding CTRL + left mouse button, as in NagiosQL 2"
@@ -906,7 +907,7 @@ msgstr ""
"Die Auswahl mehrerer Einträge innerhalb der Dialogfelder wie in NagiosQL 2 "
"durch STRG+ linker Mausclick"
-#: admin/info.php:63
+#: admin/info.php:66
msgid ""
"Enable or disable the warning if a required field contains no data in "
"objects with templates"
@@ -914,11 +915,11 @@ msgstr ""
"Aktiviere oder deaktiviere Warnungen wenn ein Pflichtfeld keine Daten in "
"Objekten mit Vorlagen enthält"
-#: admin/info.php:65
+#: admin/info.php:68
msgid "Enable or disable the automatic online version check."
msgstr "Aktiviere oder Deaktiviere die automatische Versionskontrolle."
-#: admin/info.php:66
+#: admin/info.php:69
msgid ""
"If you require a Proxyserver to connect to the Internet (Port 80), please "
"define one."
@@ -926,79 +927,90 @@ msgstr ""
"Sollten Sie einen Proxyserver für Verbindungen ins Internet (Port 80) "
"benötigen, dann definieren Sie hier einen."
-#: admin/info.php:68
+#: admin/info.php:71
msgid "Address of your Proxyserver e.g. proxy.yourdomain.com:3128"
msgstr "Adresse oder Name des Proxyservers, z.B. proxy.meinedomain.de:3128"
-#: admin/info.php:69
+#: admin/info.php:72
msgid "Username to connect through your proxy (optional)"
msgstr "Benutzername für Proxyverbindungen (optional)"
-#: admin/info.php:70
+#: admin/info.php:73
msgid "Password to connect through your proxy (optional)"
msgstr "Passwort für Proxyverbindungen (optional)"
-#: admin/info.php:92
+#: admin/info.php:74
+msgid ""
+"In environments with a high number of host and service objects, the display "
+"of the parent objects can be disabled to improve performance. Existing "
+"assignments are preserved during modification."
+msgstr ""
+"In Umgebungen mit einer sehr grossen Anzahl von Host und Service Objekten "
+"kann die Anzeige der abhängigen Objekte ausgeschaltet werden um die "
+"Performance zu erhöhen. Bestehende Zuordnungen bleiben dabei bei einer "
+"Modifikation erhalten."
+
+#: admin/info.php:100
msgid "Information PopUp"
msgstr "Information Pop-Up"
# mutdialog.php
-#: admin/info.php:105
+#: admin/info.php:113
msgid "No information available"
msgstr "Keine Information verfügbar"
-#: admin/logbook.php:53 functions/NagDataClass.php:401
-#: functions/NagDataClass.php:436 functions/NagDataClass.php:611
+#: admin/logbook.php:72 functions/NagDataClass.php:798
+#: functions/NagDataClass.php:835 functions/NagDataClass.php:1017
msgid "Dataset successfully deleted. Affected rows:"
msgstr "Daten erfolgreich gelöscht. Betroffene Datensätze:"
# logbook.php
-#: admin/logbook.php:83
+#: admin/logbook.php:102
msgid "View logbook"
msgstr "Logbuch einsehen"
-#: admin/logbook.php:87
+#: admin/logbook.php:106
msgid "Delete logentries between:"
msgstr "Lösche Logbucheinträge zwischen:"
-#: admin/logbook.php:89
+#: admin/logbook.php:108
msgid "Please supply a start or a stop time at least"
msgstr "Bitte mindestens ein Start- oder eine Stop-Datum eintragen"
-#: admin/logbook.php:90
+#: admin/logbook.php:109
msgid ""
"Do you really want to delete all log entries between the selected dates?"
msgstr ""
"Wollen Sie die Logeinträge zwischen den angegebenen Daten wirklich löschen?"
-#: admin/logbook.php:97
+#: admin/logbook.php:116
msgid "previous 20 entries"
msgstr "vorherige 20 Einträge"
-#: admin/logbook.php:104
+#: admin/logbook.php:123
msgid "next 20 entries"
msgstr "nächste 20 Einträge"
-#: admin/menuaccess.php:44 functions/NagDataClass.php:137
-#: functions/NagDataClass.php:290
+#: admin/menuaccess.php:61 functions/NagDataClass.php:199
+#: functions/NagDataClass.php:755
msgid "Error while inserting the data into the database:"
msgstr "Fehler beim Einfügen der Daten in die Datenbank:"
-#: admin/menuaccess.php:47 functions/NagDataClass.php:134
-#: functions/NagDataClass.php:285
+#: admin/menuaccess.php:64 functions/NagDataClass.php:194
+#: functions/NagDataClass.php:752
msgid "Data were successfully inserted to the data base!"
msgstr "Daten wurden erfolgreich in die Datenbank eingetragen!"
-#: admin/menuaccess.php:48
+#: admin/menuaccess.php:65
msgid "Access group set for menu item:"
msgstr "Zugriffsgruppe festgelegt für Menuitem:"
# menuaccess.php
-#: admin/menuaccess.php:55
+#: admin/menuaccess.php:72
msgid "Define Menu Access Rights"
msgstr "Zugriffsrechte für das Menu festlegen"
-#: admin/menuaccess.php:59
+#: admin/menuaccess.php:76
msgid ""
"In order for a user to get access, he needs to be member of the group "
"selected here."
@@ -1006,212 +1018,212 @@ msgstr ""
"Damit ein Benutzer Zugriff hat, muss er Mitglied der hier ausgewählten "
"Gruppe sein."
-#: admin/monitoring.php:36
+#: admin/monitoring.php:45
msgid "Monitoring"
msgstr "Überwachung"
# monitoring.php
-#: admin/monitoring.php:39
+#: admin/monitoring.php:48
msgid ""
"Define host and service supervisions as well as host and service groups."
msgstr ""
"Definieren von Host- und Serviceüberwachungen sowie Host- und Servicegruppen."
-#: admin/monitoring.php:64 admin/serviceescalations.php:557
-#: config/fieldvars.php:248 config/fieldvars.php:305
+#: admin/monitoring.php:73 admin/serviceescalations.php:603
+#: config/fieldvars.php:253 config/fieldvars.php:309
msgid "Services"
msgstr "Services"
-#: admin/monitoring.php:80 config/fieldvars.php:213 config/fieldvars.php:307
+#: admin/monitoring.php:89 config/fieldvars.php:216 config/fieldvars.php:311
msgid "Service groups"
msgstr "Servicegruppen"
-#: admin/monitoring.php:88 config/fieldvars.php:302 config/fieldvars.php:328
+#: admin/monitoring.php:97 config/fieldvars.php:306 config/fieldvars.php:332
msgid "Host templates"
msgstr "Hostvorlagen"
-#: admin/monitoring.php:96 config/fieldvars.php:329
+#: admin/monitoring.php:105 config/fieldvars.php:333
msgid "Service templates"
msgstr "Servicevorlagen"
# mutdialog.php
-#: admin/mutdialog.php:57 admin/versioncheck.php:83
+#: admin/mutdialog.php:58 admin/versioncheck.php:93
msgid "Available"
msgstr "Verfügbar"
-#: admin/mutdialog.php:58
+#: admin/mutdialog.php:59
msgid "Selected"
msgstr "Ausgewählt"
-#: admin/nagioscfg.php:105
+#: admin/nagioscfg.php:121
msgid "Nagios main configuration file"
msgstr "Nagios Hauptkonfigurationsdatei"
-#: admin/password.php:55
+#: admin/password.php:73
msgid "Password successfully modified"
msgstr "Passwort erfolgreich geändert"
-#: admin/password.php:72 admin/user.php:90
+#: admin/password.php:90 admin/user.php:125
msgid "Password too short or password fields do not match!"
msgstr "Passwort zu kurz oder Passwörter ungleich!"
-#: admin/password.php:78
+#: admin/password.php:96
msgid "The old password is invalid"
msgstr "Das alte Passwort ist falsch"
-#: admin/password.php:97 admin/settings.php:310 config/fieldvars.php:58
+#: admin/password.php:115 admin/settings.php:334 config/fieldvars.php:59
msgid "Save"
msgstr "Speichern"
-#: admin/password.php:100
+#: admin/password.php:118
msgid "The new passwords don not match!"
msgstr "Die neuen Passwörter sind ungleich!"
-#: admin/password.php:101
+#: admin/password.php:119
msgid "The new password is too short - use at least 6 characters!"
msgstr "Das neue Passwort ist zu kurz - mindestens 6 Zeichen sind nötig!"
# hosttemplates.php
-#: admin/servicedependencies.php:72
+#: admin/servicedependencies.php:176
msgid "New service dependency inserted:"
msgstr "Neue Serviceabhängigkeit eingefügt:"
-#: admin/servicedependencies.php:75
+#: admin/servicedependencies.php:179
msgid "Service dependency modified:"
msgstr "Serviceabhängigkeit modifiziert:"
-#: admin/servicedependencies.php:313 admin/servicedependencies.php:704
+#: admin/servicedependencies.php:417 admin/servicedependencies.php:758
msgid "Define service dependencies (servicedependencies.cfg)"
msgstr "Serviceanhängigkeiten definieren (servicedependencies.cfg)"
-#: admin/servicedependencies.php:706 config/fieldvars.php:247
+#: admin/servicedependencies.php:760 config/fieldvars.php:252
msgid "Dependent services"
msgstr "Abhängige Services"
# hosttemplates.php
-#: admin/serviceescalations.php:71
+#: admin/serviceescalations.php:157
msgid "New service escalation inserted:"
msgstr "Neue Serviceeskalation eingefügt:"
-#: admin/serviceescalations.php:74
+#: admin/serviceescalations.php:160
msgid "Service escalation modified:"
msgstr "Serviceeskalation modifiziert:"
-#: admin/serviceescalations.php:256 admin/serviceescalations.php:555
+#: admin/serviceescalations.php:342 admin/serviceescalations.php:601
msgid "Define service escalation (serviceescalations.cfg)"
msgstr "Serviceeskalation definieren (serviceescalations.cfg)"
# hosttemplates.php
-#: admin/serviceextinfo.php:64
+#: admin/serviceextinfo.php:108
msgid "New service extended information inserted:"
msgstr "Neue erweiterte Serviceinformation eingefügt:"
-#: admin/serviceextinfo.php:68
+#: admin/serviceextinfo.php:112
msgid "Service extended information modified:"
msgstr "Erweiterte Serviceinformation modifiziert:"
-#: admin/serviceextinfo.php:104 admin/serviceextinfo.php:214
+#: admin/serviceextinfo.php:148 admin/serviceextinfo.php:245
msgid "Define service extended information (serviceextinfo.cfg)"
msgstr "Erweiterte Serviceinformationen definieren (serviceextinfo.cfg)"
-#: admin/serviceextinfo.php:215
+#: admin/serviceextinfo.php:246
msgid "Hostname"
msgstr "Hostname"
-#: admin/serviceextinfo.php:216
+#: admin/serviceextinfo.php:247
msgid "Service"
msgstr "Service"
# hosttemplates.php
-#: admin/servicegroups.php:63
+#: admin/servicegroups.php:118
msgid "New service group inserted:"
msgstr "Neue Servicegruppe eingetragen:"
-#: admin/servicegroups.php:66
+#: admin/servicegroups.php:121
msgid "Service group modified:"
msgstr "Servicegruppe modifiziert:"
-#: admin/servicegroups.php:149 admin/servicegroups.php:229
+#: admin/servicegroups.php:204 admin/servicegroups.php:272
msgid "Define service groups (servicegroups.cfg)"
msgstr "Servicesgruppen definieren (servicegroups.cfg)"
-#: admin/servicegroups.php:170
+#: admin/servicegroups.php:221
msgid "Attention, no services defined!"
msgstr "Achtung, noch keine Services definiert!"
-#: admin/servicegroups.php:230
+#: admin/servicegroups.php:273
msgid "Service group"
msgstr "Servicegruppe"
# hosttemplates.php
-#: admin/services.php:96
+#: admin/services.php:237
msgid "New service inserted:"
msgstr "Neuen Service eingefügt:"
-#: admin/services.php:99
+#: admin/services.php:240
msgid "Service modified:"
msgstr "Service modifiziert:"
-#: admin/services.php:251 admin/services.php:281
-#: functions/prepend_content.php:460
+#: admin/services.php:397 admin/services.php:426
+#: functions/prepend_content.php:505
msgid "Service file deleted:"
msgstr "Servicedatei gelöscht:"
-#: admin/services.php:403 admin/services.php:704
+#: admin/services.php:546 admin/services.php:814
msgid "Define services (services.cfg)"
msgstr "Services definieren"
-#: admin/services.php:488
+#: admin/services.php:626
msgid "Attention, no hosts or hostgroups defined!"
msgstr "Achtung, noch keine Hosts oder Hostgruppen definiert!"
-#: admin/services.php:543
+#: admin/services.php:676
msgid "Attention, no check commands defined!"
msgstr "Achtung, noch keine Prüfbefehle definiert!"
-#: admin/services.php:613
+#: admin/services.php:726
msgid "Attention, no contacts or contact groups defined!"
msgstr "Achtung, noch keine Kontakte oder Kontaktgruppen definiert!"
-#: admin/services.php:706
+#: admin/services.php:816 config/fieldvars.php:221
msgid "Service name"
msgstr "Servicename"
-#: admin/services.php:708 admin/services.php:732
+#: admin/services.php:818 admin/services.php:844
msgid "All configs"
msgstr "Alle Konfigurationen"
# hosttemplates.php
-#: admin/servicetemplates.php:97
+#: admin/servicetemplates.php:229
msgid "New service template inserted:"
msgstr "Neue Servicevorlage eingefügt:"
-#: admin/servicetemplates.php:100
+#: admin/servicetemplates.php:232
msgid "Service template modified:"
msgstr "Servicevorlage modifiziert:"
-#: admin/servicetemplates.php:341 admin/servicetemplates.php:623
+#: admin/servicetemplates.php:472 admin/servicetemplates.php:714
msgid "Define service templates (servicetemplates.cfg)"
msgstr "Servicevorlagen definieren (servicetemplates.cfg)"
-#: admin/servicetemplates.php:624 config/fieldvars.php:124
-#: config/fieldvars.php:225
+#: admin/servicetemplates.php:715 config/fieldvars.php:127
+#: config/fieldvars.php:230
msgid "Template name"
msgstr "Vorlagenname"
-#: admin/servicetemplates.php:625 config/fieldvars.php:212
+#: admin/servicetemplates.php:716 config/fieldvars.php:215
msgid "Service description"
msgstr "Servicebeschreibung"
-#: admin/settings.php:111
+#: admin/settings.php:146
msgid "Curl module not loaded, Proxy will be deactivated!"
msgstr "Curl Modul nicht geladen, der Proxy wird deaktiviert!"
-#: admin/settings.php:136
+#: admin/settings.php:172
msgid "An error occured while writing settings to database:"
msgstr "Beim Schreiben der Einstellungen in die Datenbank trat ein Fehler auf:"
-#: admin/settings.php:187 functions/prepend_adm.php:150
+#: admin/settings.php:223 functions/prepend_adm.php:151
msgid ""
"Error setting the correct locale. Please report this error with the "
"associated output of 'locale -a'"
@@ -1219,124 +1231,132 @@ msgstr ""
"Fehler bei der Erkennung der Umgebungsvariable locale. Bitte diese "
"Fehlermeldung und die Ausgabe von 'locale -a' melden."
-#: admin/settings.php:195
+#: admin/settings.php:231
msgid "Settings were changed"
msgstr "Systemeinstellungen wurden geändert"
-#: admin/settings.php:197
+#: admin/settings.php:233
msgid "An error occured while writing settings.php. Please check permissions!"
msgstr ""
"Beim Schreiben der settings.php trat ein Fehler auf - bitte Berechtigungen "
"prüfen!"
-#: admin/settings.php:201
+#: admin/settings.php:237
msgid "is not writeable, please check permissions!"
msgstr "ist nicht beschreibbar (Berechtigungen prüfen)!"
-#: admin/settings.php:208
+#: admin/settings.php:244
msgid "Configure Settings"
msgstr "NagiosQL Systemeinstellungen konfigurieren"
-#: admin/settings.php:213
+#: admin/settings.php:249
msgid "Change your current NagiosQL settings (e.g. Database user, Language)."
msgstr ""
"Ändern der aktuellen NagiosQL Einstellungen (Datenbankbenutzer, Sprache, "
"usw.)"
-#: admin/settings.php:218
+#: admin/settings.php:252
msgid "Path"
msgstr "Pfad"
-#: admin/settings.php:219
+#: admin/settings.php:253
msgid "Temporary Directory"
msgstr "Temporäres Verzeichnis"
-#: admin/settings.php:221
+#: admin/settings.php:255
msgid "Server protocol"
msgstr "Server Protokoll"
-#: admin/settings.php:244
+#: admin/settings.php:277
msgid "Encoding"
msgstr "Encoding"
-#: admin/settings.php:249
+#: admin/settings.php:280
msgid "Database"
msgstr "Datenbank"
-#: admin/settings.php:250
+#: admin/settings.php:281
msgid "MySQL Server"
msgstr "MySQL Server"
-#: admin/settings.php:252
+#: admin/settings.php:283
msgid "MySQL Server Port"
msgstr "MySQL Server Port"
-#: admin/settings.php:254 install/step2.php:66
+#: admin/settings.php:285 install/step2.php:71
msgid "Database name"
msgstr "Datenbankname"
-#: admin/settings.php:256
+#: admin/settings.php:287
msgid "Database user"
msgstr "Datenbankbenutzer"
-#: admin/settings.php:258
+#: admin/settings.php:289
msgid "Database password"
msgstr "Datenbankpasswort"
-#: admin/settings.php:263
+#: admin/settings.php:292
msgid "Security"
msgstr "Sicherheit"
-#: admin/settings.php:264
+#: admin/settings.php:293
msgid "Session auto logoff time"
msgstr "Automatisches Ausloggen nach"
-#: admin/settings.php:266
+#: admin/settings.php:295
msgid "Authentication type"
msgstr "Authentifikation"
-#: admin/settings.php:271
+#: admin/settings.php:298
msgid "Common"
msgstr "Allgemeines"
-#: admin/settings.php:272
+#: admin/settings.php:299
msgid "Data lines per page"
msgstr "Zeilen pro Seite"
-#: admin/settings.php:274
+#: admin/settings.php:301
msgid "Selection method"
msgstr "Auswahl methode"
-#: admin/settings.php:279
+#: admin/settings.php:304
msgid "Template warn message"
msgstr "Warnungen bei Templatewerten"
-#: admin/settings.php:288
+#: admin/settings.php:311
msgid "Online version check"
msgstr "Online Versionsüberprüfung"
-#: admin/settings.php:296
+#: admin/settings.php:317
msgid "Proxyserver"
msgstr "Proxyserver"
-#: admin/settings.php:301
+#: admin/settings.php:323
msgid "Proxy Address"
msgstr "Proxyadresse"
-#: admin/settings.php:303
+#: admin/settings.php:325
msgid "Proxy Username (optional)"
msgstr "Proxy Benutzername (optional)"
-#: admin/settings.php:305
+#: admin/settings.php:327
msgid "Proxy Password (optional)"
msgstr "Proxy Passwort (optional)"
-#: admin/specials.php:35
+#: admin/settings.php:330
+msgid "Performance options"
+msgstr "Performance Optionen"
+
+#: admin/settings.php:331
+msgid "Show object parents"
+msgstr "Zeige abhängige Objekte"
+
+#: admin/specials.php:44
msgid "Misc commands"
msgstr "Spezialbefehle"
# specials.php
-#: admin/specials.php:38
+#: admin/specials.php:47
msgid ""
"Define host and service dependencies, host and service escalations as well "
"as host and service additional data."
@@ -1344,39 +1364,39 @@ msgstr ""
"Definieren von Host- und Serviceabhängigkeiten, Host- und "
"Serviceeskalationen sowie Host- und Service-Zusatzdaten."
-#: admin/specials.php:56
+#: admin/specials.php:65
msgid "Host dependencies"
msgstr "Host Abhängigkeiten"
-#: admin/specials.php:64
+#: admin/specials.php:73
msgid "Host escalations"
msgstr "Host Eskalationen"
-#: admin/specials.php:72
+#: admin/specials.php:81
msgid "Host ext. info"
msgstr "Host AddOn"
-#: admin/specials.php:80
+#: admin/specials.php:89
msgid "Service dependencies"
msgstr "Service Abhängigkeiten"
-#: admin/specials.php:88
+#: admin/specials.php:97
msgid "Service escalations"
msgstr "Service Eskalationen"
-#: admin/specials.php:96
+#: admin/specials.php:105
msgid "Service ext. info"
msgstr "Service AddOn"
-#: admin/support.php:39
+#: admin/support.php:56
msgid "NagiosQL support page"
msgstr "NagiosQL Supportseite"
-#: admin/support.php:49
+#: admin/support.php:66
msgid "Support contact information"
msgstr "Support- und Kontaktinformationen"
-#: admin/support.php:50
+#: admin/support.php:67
msgid ""
"For questions, the online support forum or contact information visit our "
"website:"
@@ -1384,15 +1404,15 @@ msgstr ""
"Für Fragen, das öffentliche Supportforum oder Kontaktinformationen besuchen "
"Sie unsere Webseite unter:"
-#: admin/support.php:52
+#: admin/support.php:69
msgid "NagiosQL on sourceforge"
msgstr "NagiosQL auf Sourceforge"
-#: admin/support.php:56
+#: admin/support.php:73
msgid "Donate to support NagiosQL"
msgstr "NagiosQL durch Spenden unterstützen"
-#: admin/support.php:57
+#: admin/support.php:74
msgid ""
"If you like NagiosQL and it simplifies your daily work, then you may want to "
"support the project by making a donation. This helps us to keep NagiosQL "
@@ -1403,16 +1423,16 @@ msgstr ""
"uns NagiosQL weiterzuentwickeln und dabei entstehende Kosten zu decken. "
"Vielen Dank für Ihre Spende!"
-#: admin/support.php:60 functions/NagVisualClass.php:230
-#: functions/NagVisualClass.php:231
+#: admin/support.php:77 functions/NagVisualClass.php:134
+#: functions/NagVisualClass.php:135
msgid "Donate for NagiosQL on sourceforge"
msgstr "Für NagiosQL auf Sourceforge spenden"
-#: admin/support.php:64
+#: admin/support.php:81
msgid "Translation services"
msgstr "Übersetzungsdienste"
-#: admin/support.php:65
+#: admin/support.php:82
msgid ""
"NagiosQL was translated into various languages​​. Since some translators are "
"no longer available in later versions, there may be untranslated words or "
@@ -1429,15 +1449,15 @@ msgstr ""
"einfach online bearbeitet werden - wir benutzen einen offenen "
"Übersetzungsdienst bei dem Sie sich jederzeit kostenlos registrieren können:"
-#: admin/support.php:70
+#: admin/support.php:87
msgid "Transifex translation service"
msgstr "Transifex Übersetzungsservice"
-#: admin/support.php:74
+#: admin/support.php:91
msgid "GIT software repository"
msgstr "Git Software Repository"
-#: admin/support.php:75
+#: admin/support.php:92
msgid ""
"The NagiosQL sources are available on GitLab. There you will always find the "
"latest bugfixes and changes as well as older branches."
@@ -1445,15 +1465,15 @@ msgstr ""
"Die NagiosQL Dateien sind auf GitLab verfügbar. Dort finden sie immer sie "
"letzten Fehlerbehebungen, Änderungen sowie auch ältere Versionen."
-#: admin/support.php:77
+#: admin/support.php:94
msgid "GitLab"
msgstr "GitLab"
-#: admin/support.php:81
+#: admin/support.php:98
msgid "Version check"
msgstr "Überprüfung der NagiosQL Version"
-#: admin/support.php:83
+#: admin/support.php:100
msgid ""
"The online version check is not enabled. You can enable it on the settings "
"page."
@@ -1461,7 +1481,7 @@ msgstr ""
"Die Onlineüberprüfung der Version ist nicht eingeschaltet. Sie können diese "
"auf der Einstellungsseite aktivieren."
-#: admin/support.php:86
+#: admin/support.php:103
msgid ""
"The online version check connects the NagiosQL page to find out, if your "
"version is still up to date."
@@ -1469,102 +1489,105 @@ msgstr ""
"Die Onlineüberprüfung öffnet eine Verbindung zur NagiosQL Entwicklerwebseite "
"und prüft, ob Sie die aktuelle Version verwenden."
-#: admin/support.php:98
+#: admin/support.php:112
+msgid "GIT code version"
+msgstr "GIT Codeversion"
+
+#: admin/support.php:117
msgid "Environment check"
msgstr "Umgebungsprüfung"
-#: admin/support.php:100 admin/support.php:109 admin/support.php:121
-#: admin/support.php:129 admin/support.php:138 admin/support.php:148
-#: admin/support.php:163 admin/support.php:176 admin/support.php:185
-#: admin/support.php:194 admin/support.php:203 admin/support.php:213
-#: admin/support.php:263 admin/support.php:278 admin/support.php:299
-#: admin/support.php:337 admin/support.php:360 admin/support.php:366
-#: admin/support.php:392 admin/support.php:396 admin/support.php:415
-#: admin/support.php:418 admin/support.php:421 admin/support.php:435
-#: admin/support.php:440 admin/support.php:443 admin/support.php:448
-#: admin/support.php:460 admin/support.php:465 admin/support.php:484
-#: admin/support.php:492 admin/support.php:589 admin/support.php:592
-#: admin/support.php:613 admin/support.php:642 admin/support.php:677
-#: install/functions/NagInstallClass.php:338
-#: install/functions/NagInstallClass.php:370
-#: install/functions/NagInstallClass.php:406
+#: admin/support.php:119 admin/support.php:128 admin/support.php:140
+#: admin/support.php:148 admin/support.php:157 admin/support.php:167
+#: admin/support.php:182 admin/support.php:195 admin/support.php:204
+#: admin/support.php:213 admin/support.php:222 admin/support.php:232
+#: admin/support.php:283 admin/support.php:298 admin/support.php:319
+#: admin/support.php:354 admin/support.php:385 admin/support.php:415
+#: admin/support.php:434 admin/support.php:437 admin/support.php:440
+#: admin/support.php:454 admin/support.php:459 admin/support.php:462
+#: admin/support.php:467 admin/support.php:479 admin/support.php:484
+#: admin/support.php:501 admin/support.php:509 admin/support.php:606
+#: admin/support.php:609 admin/support.php:630 admin/support.php:659
+#: admin/support.php:694 install/functions/NagInstallClass.php:184
+#: install/functions/NagInstallClass.php:216
+#: install/functions/NagInstallClass.php:252
+#: install/functions/NagInstallClass.php:329
+#: install/functions/NagInstallClass.php:337
+#: install/functions/NagInstallClass.php:359
+#: install/functions/NagInstallClass.php:383
+#: install/functions/NagInstallClass.php:395
+#: install/functions/NagInstallClass.php:462
#: install/functions/NagInstallClass.php:485
-#: install/functions/NagInstallClass.php:493
-#: install/functions/NagInstallClass.php:515
-#: install/functions/NagInstallClass.php:539
+#: install/functions/NagInstallClass.php:494
+#: install/functions/NagInstallClass.php:546
#: install/functions/NagInstallClass.php:551
+#: install/functions/NagInstallClass.php:583
#: install/functions/NagInstallClass.php:618
-#: install/functions/NagInstallClass.php:640
-#: install/functions/NagInstallClass.php:649
-#: install/functions/NagInstallClass.php:701
-#: install/functions/NagInstallClass.php:706
-#: install/functions/NagInstallClass.php:739
-#: install/functions/NagInstallClass.php:777
-#: install/functions/NagInstallClass.php:784
-#: install/functions/NagInstallClass.php:812
-#: install/functions/NagInstallClass.php:872
-#: install/functions/NagInstallClass.php:904
-#: install/functions/NagInstallClass.php:938
-#: install/functions/NagInstallClass.php:971
-#: install/functions/NagInstallClass.php:1010
-#: install/functions/NagInstallClass.php:1019
-#: install/functions/NagInstallClass.php:1062
-#: install/functions/NagInstallClass.php:1071 install/step1.php:229
-#: install/step1.php:242 install/step1.php:246 install/step1.php:255
-#: install/step1.php:264 install/step1.php:273 install/step1.php:282
-#: install/step1.php:291 install/step1.php:300 install/step3.php:90
-#: install/step3.php:179 install/step3.php:204
+#: install/functions/NagInstallClass.php:625
+#: install/functions/NagInstallClass.php:652
+#: install/functions/NagInstallClass.php:714
+#: install/functions/NagInstallClass.php:746
+#: install/functions/NagInstallClass.php:780
+#: install/functions/NagInstallClass.php:813
+#: install/functions/NagInstallClass.php:853
+#: install/functions/NagInstallClass.php:862
+#: install/functions/NagInstallClass.php:905
+#: install/functions/NagInstallClass.php:914 install/step1.php:246
+#: install/step1.php:259 install/step1.php:263 install/step1.php:272
+#: install/step1.php:281 install/step1.php:290 install/step1.php:299
+#: install/step1.php:308 install/step1.php:317 install/step3.php:98
+#: install/step3.php:187 install/step3.php:212
msgid "failed"
msgstr "fehlgeschlagen"
-#: admin/support.php:101 admin/support.php:106 admin/support.php:118
-#: admin/support.php:126 admin/support.php:134 admin/support.php:144
-#: admin/support.php:160 admin/support.php:173 admin/support.php:182
-#: admin/support.php:191 admin/support.php:200 admin/support.php:210
-#: admin/support.php:255 admin/support.php:268 admin/support.php:283
-#: admin/support.php:292 admin/support.php:295 admin/support.php:334
-#: admin/support.php:340 admin/support.php:356 admin/support.php:372
-#: admin/support.php:388 admin/support.php:407 admin/support.php:410
-#: admin/support.php:425 admin/support.php:432 admin/support.php:457
-#: admin/support.php:469 admin/support.php:488 admin/support.php:584
-#: admin/support.php:600 admin/support.php:605 admin/support.php:610
-#: admin/support.php:619 admin/support.php:624 admin/support.php:630
-#: admin/support.php:635
+#: admin/support.php:120 admin/support.php:125 admin/support.php:137
+#: admin/support.php:145 admin/support.php:153 admin/support.php:163
+#: admin/support.php:179 admin/support.php:192 admin/support.php:201
+#: admin/support.php:210 admin/support.php:219 admin/support.php:229
+#: admin/support.php:275 admin/support.php:288 admin/support.php:303
+#: admin/support.php:312 admin/support.php:315 admin/support.php:351
+#: admin/support.php:357 admin/support.php:375 admin/support.php:379
+#: admin/support.php:391 admin/support.php:407 admin/support.php:411
+#: admin/support.php:426 admin/support.php:429 admin/support.php:444
+#: admin/support.php:451 admin/support.php:476 admin/support.php:488
+#: admin/support.php:505 admin/support.php:601 admin/support.php:617
+#: admin/support.php:622 admin/support.php:627 admin/support.php:636
+#: admin/support.php:641 admin/support.php:647 admin/support.php:652
msgid "ok"
msgstr "OK"
-#: admin/support.php:103
+#: admin/support.php:122
msgid "PHP version"
msgstr "PHP Version"
-#: admin/support.php:110 admin/support.php:163
+#: admin/support.php:129 admin/support.php:182
msgid "Required:"
msgstr "Benötigt:"
-#: admin/support.php:115 admin/support.php:123 admin/support.php:131
-#: admin/support.php:141 install/index.php:170 install/index.php:171
-#: install/index.php:172 install/index.php:173
+#: admin/support.php:134 admin/support.php:142 admin/support.php:150
+#: admin/support.php:160 install/index.php:171 install/index.php:172
+#: install/index.php:173 install/index.php:174
msgid "PHP module:"
msgstr "PHP Modul:"
-#: admin/support.php:153
+#: admin/support.php:172
msgid "MySQL version"
msgstr "MySQL Version"
-#: admin/support.php:169 admin/support.php:178 admin/support.php:187
-#: admin/support.php:196
+#: admin/support.php:188 admin/support.php:197 admin/support.php:206
+#: admin/support.php:215
msgid "PHP ini settings:"
msgstr "PHP ini Einstellungen:"
-#: admin/support.php:206
+#: admin/support.php:225
msgid "Read/Write access:"
msgstr "Schreib-/Leserechte:"
-#: admin/support.php:222
+#: admin/support.php:242
msgid "Config domain checks"
msgstr "Überprüfung der Konfigurationsdomäne"
-#: admin/support.php:223
+#: admin/support.php:243
msgid ""
"The checks below are based on your data domain and config domain settings. "
"To change the data domain, use the pull down menu in the upper right corner. "
@@ -1578,181 +1601,184 @@ msgstr ""
"jeweiligen Datendomäne definiert. Wiederholen Sie diese Überprüfungen für "
"alle Konfigurationsdomänen die Sie verwenden."
-#: admin/support.php:229
+#: admin/support.php:249
msgid "Config domain name"
msgstr "Name der Konfigurationsdomäne"
-#: admin/support.php:231
+#: admin/support.php:251
msgid "Connection type"
msgstr "Verbindungstyp"
-#: admin/support.php:252
+#: admin/support.php:272
msgid "Connection check"
msgstr "Verbindungsprüfung"
-#: admin/support.php:295 admin/support.php:340 admin/support.php:418
-#: admin/support.php:436
+#: admin/support.php:315 admin/support.php:357 admin/support.php:437
+#: admin/support.php:455
msgid "readonly"
msgstr "nur lesen"
-#: admin/support.php:346 config/fieldvars.php:45
+#: admin/support.php:363 config/fieldvars.php:46
msgid "Nagios process file"
msgstr "Nagios Prozess Datei"
-#: admin/support.php:361 admin/support.php:392 admin/support.php:415
-#: admin/support.php:444 admin/support.php:448 admin/support.php:465
-#: admin/support.php:493
-msgid "file is missed"
-msgstr "Datei fehlt"
+#: admin/support.php:380 admin/support.php:411
+msgid "file is missed or not used"
+msgstr "Datei fehlt oder wird nicht verwendet"
-#: admin/support.php:367 admin/support.php:397
+#: admin/support.php:386 admin/support.php:416
msgid "Nagios daemon is not running"
msgstr "Demon ist nicht gestartet"
-#: admin/support.php:372 admin/support.php:425 admin/support.php:469
+#: admin/support.php:391 admin/support.php:444 admin/support.php:488
msgid "not used with FTP"
msgstr "Wird nicht benutzt bei FTP"
-#: admin/support.php:396 admin/support.php:410 admin/support.php:440
+#: admin/support.php:415 admin/support.php:429 admin/support.php:459
msgid "demon dead"
msgstr "Demon läuft nicht"
-#: admin/support.php:402 config/fieldvars.php:43
+#: admin/support.php:421 config/fieldvars.php:44
msgid "Nagios command file"
msgstr "Nagios Command Datei"
-#: admin/support.php:452 config/fieldvars.php:44
+#: admin/support.php:434 admin/support.php:463 admin/support.php:467
+#: admin/support.php:484 admin/support.php:510
+msgid "file is missed"
+msgstr "Datei fehlt"
+
+#: admin/support.php:471 config/fieldvars.php:45
msgid "Nagios binary file"
msgstr "Nagios Binary Datei"
# mutdialog.php
-#: admin/support.php:461 admin/support.php:485
+#: admin/support.php:480 admin/support.php:502
msgid "not executable"
msgstr "Nicht ausführbar"
# config_class.php
-#: admin/support.php:501
+#: admin/support.php:517
msgid "Verify configuration files and demon configuration"
msgstr "Überprüfung der Konfigurationsdateien und der Demon Konfiguration"
-#: admin/support.php:502
+#: admin/support.php:518
msgid "Configuration name"
msgstr "Konfigurationsname"
# fieldvars.php
-#: admin/support.php:503
+#: admin/support.php:519
msgid "Used in data domain"
msgstr "Benutzt in der Datendomäne"
-#: admin/support.php:504
+#: admin/support.php:520
msgid "Included in demon configuration"
msgstr "Eingebunden in der Demon Konfiguration"
-#: admin/support.php:587
+#: admin/support.php:604
msgid "not used"
msgstr "Nicht benutzt"
-#: admin/support.php:593
+#: admin/support.php:610
msgid "cfg definition missed"
msgstr "Definition fehlt"
-#: admin/support.php:611 admin/support.php:625 admin/support.php:636
+#: admin/support.php:628 admin/support.php:642 admin/support.php:653
msgid "cfg definition missed, but actually not used"
msgstr "Definition fehlt, wird aber aktuell nicht benutzt"
-#: admin/support.php:614
+#: admin/support.php:631
msgid "wrong base path:"
msgstr "Falscher Basispfad:"
-#: admin/support.php:643
+#: admin/support.php:660
msgid "cfg file not readable"
msgstr "Konfigurationsdatei nicht lesbar"
-#: admin/support.php:676
+#: admin/support.php:693
msgid "Not used"
msgstr "Nicht benutzt"
-#: admin/support.php:678
+#: admin/support.php:695
msgid "unused - please delete!"
msgstr "unbenutzt - bitte löschen!"
-#: admin/templatedefinitions.php:260
+#: admin/templatedefinitions.php:272
msgid "Up"
msgstr "Hinauf"
-#: admin/templatedefinitions.php:264
+#: admin/templatedefinitions.php:278
msgid "Down"
msgstr "Hinunter"
-#: admin/timedefinitions.php:176 admin/variabledefinitions.php:143
-#: config/fieldvars.php:77
+#: admin/timedefinitions.php:177 admin/variabledefinitions.php:156
+#: config/fieldvars.php:79
msgid "Modify"
msgstr "Bearbeiten"
-#: admin/timeperiods.php:62
+#: admin/timeperiods.php:111
msgid "New time period inserted:"
msgstr "Neue Zeitgruppe eingetragen:"
-#: admin/timeperiods.php:65
+#: admin/timeperiods.php:114
msgid "Time period modified:"
msgstr "Zeitgruppe modifiziert:"
-#: admin/timeperiods.php:173 admin/timeperiods.php:252
+#: admin/timeperiods.php:226 admin/timeperiods.php:294
msgid "Time period definitions (timeperiods.cfg)"
msgstr "Zeitperioden (timeperiods.cfg)"
-#: admin/timeperiods.php:230
+#: admin/timeperiods.php:271
msgid "Please insert a time definition and a time range"
msgstr "Bitte eine Zeitdefinition und einen Zeitbereich eintragen"
# timeperiod.php
-#: admin/timeperiods.php:253 config/fieldvars.php:92
+#: admin/timeperiods.php:295 config/fieldvars.php:95
msgid "Time period"
msgstr "Zeitperiode"
# tools.php
-#: admin/tools.php:35
+#: admin/tools.php:37
msgid "Different tools"
msgstr "Verschiedene Werkzeuge"
-#: admin/tools.php:36
+#: admin/tools.php:38
msgid ""
"Useful functions for data import, main configuration, daemon control, etc."
msgstr ""
"Verschiedene nützliche Funktionen wie Datenimport, Nagios Konfiguration, "
"Prozesssteuerung etc."
-#: admin/user.php:74
+#: admin/user.php:109
msgid "New user added:"
msgstr "Neuen Benutzer angelegt:"
-#: admin/user.php:128 admin/user.php:176
+#: admin/user.php:155 admin/user.php:203
msgid "User administration"
msgstr "Benutzeradministration"
-#: admin/user.php:132
+#: admin/user.php:159
msgid "The passwords do not match!"
msgstr "Die Passwörter sind ungleich!"
-#: admin/user.php:133
+#: admin/user.php:160
msgid "Please fill in the password"
msgstr "Bitte ein Passwort eintragen"
-#: admin/user.php:134
+#: admin/user.php:161
msgid "The password is too short - use at least 6 characters!"
msgstr "Passwort ist zu kurz - mindestens 6 Zeichen sind nötig!"
-#: admin/user.php:135
+#: admin/user.php:162
msgid "Webserver authentification"
msgstr "Webserver Authentifikation"
-#: admin/user.php:177 config/fieldvars.php:24 index.php:51
+#: admin/user.php:204 config/fieldvars.php:24 index.php:53
msgid "Username"
msgstr "Benutzername"
-#: admin/verify.php:50 admin/verify.php:157 functions/NagConfigClass.php:1115
-#: functions/NagConfigClass.php:1117 functions/NagConfigClass.php:1357
-#: functions/NagConfigClass.php:1359
+#: admin/verify.php:74 admin/verify.php:173 functions/NagConfigClass.php:1196
+#: functions/NagConfigClass.php:1198 functions/NagConfigClass.php:2506
+#: functions/NagConfigClass.php:2508
msgid ""
"Writing of the configuration failed - no dataset or not activated dataset "
"found"
@@ -1760,94 +1786,84 @@ msgstr ""
"Schreiben der Konfiguration fehlgeschlagen - es wurde kein existierender "
"bzw. kein aktiver Datensatz gefunden"
-#: admin/verify.php:62
+#: admin/verify.php:86
msgid "Write host configurations"
msgstr "Schreibe Hostkonfigurationen"
-#: admin/verify.php:69 admin/verify.php:91
+#: admin/verify.php:93 admin/verify.php:115
msgid "No configuration items defined!"
msgstr "Keine Konfiguration definiert!"
-#: admin/verify.php:84
+#: admin/verify.php:108
msgid "Write service configurations"
msgstr "Schreibe Servicekonfigurationen"
-#: admin/verify.php:102 admin/verify.php:117 admin/verify.php:132
-#: admin/verify.php:147 admin/verify.php:202 admin/verify.php:217
-#: admin/verify.php:232 admin/verify.php:247 admin/verify.php:262
-#: admin/verify.php:277 admin/verify.php:292
+#: admin/verify.php:125 admin/verify.php:138 admin/verify.php:151
+#: admin/verify.php:164 admin/verify.php:217 admin/verify.php:230
+#: admin/verify.php:243 admin/verify.php:256 admin/verify.php:269
+#: admin/verify.php:282 admin/verify.php:295
msgid "No dataset or no activated dataset found - empty configuration written"
msgstr ""
"Kein Datensatz oder kein aktivierter Datensatz gefunden - leere "
"Konfiguration geschrieben"
-#: admin/verify.php:311
+#: admin/verify.php:313
msgid "Cannot find the Nagios binary or no execute permissions!"
msgstr ""
"Nagios Binary Datei nicht gefunden oder keine Rechte dieses auszuführen!"
-#: admin/verify.php:326
+#: admin/verify.php:328
msgid "Remote execution (FTP SITE EXEC) is not supported on your system!"
msgstr ""
"Ihr FTP Server unterstützt nicht die (FTP SITE EXEC) Funktion zum Ausführen "
"von Befehlen!"
-#: admin/verify.php:345
+#: admin/verify.php:346
msgid "Remote execution of nagios verify command failed (remote SSH)!"
msgstr ""
"Entfernte Ausführung des Nagios Prüfbefehls fehlgeschlagen (SSH Verbindung)"
-#: admin/verify.php:350
+#: admin/verify.php:351
msgid "Nagios binary or configuration file not found (remote SSH)!"
msgstr ""
"Nagios Programmdatei oder Konfiguration nicht gefunden (Entfernter Zugriff "
"via SSH/SFTP)!"
-#: admin/verify.php:388
+#: admin/verify.php:387
msgid "Nagios daemon successfully restarted"
msgstr "Nagios wurde erfolgreich neu gestartet"
-#: admin/verify.php:390
+#: admin/verify.php:389
msgid "Restart command successfully send to Nagios"
msgstr "Der Neustart Befehl wurde erfolgreich an Nagios übermittelt"
-#: admin/verify.php:394 admin/verify.php:402
+#: admin/verify.php:393 admin/verify.php:401
msgid ""
"Restart failed - Nagios command file not found or no execute permissions"
msgstr ""
"Nagios Neustart schlug fehl - Die Nagios Commanddatei konnte nicht gefunden "
"werden oder die Dateiberechtigungen sind ungenügend"
-#: admin/verify.php:397
+#: admin/verify.php:396
msgid "Nagios command file not found or no write permissions!"
msgstr ""
"Nagios Command Datei nicht gefunden oder keine Schreibrechte auf die Datei!"
-#: admin/verify.php:404
+#: admin/verify.php:403
msgid "Restart failed - Nagios command file not found or no rights to execute"
msgstr ""
"Neustart von Nagios schlug fehl - Die Nagios Command Datei konnte nicht "
"gefunden werden oder die Datei Berechtigungen reichen nicht aus"
-#: admin/verify.php:408
-msgid "Restart failed - Nagios daemon was not running"
-msgstr "Neustart fehlgeschlagen - Der Nagios Dienst lief nicht"
-
-#: admin/verify.php:410
-msgid "Nagios daemon is not running, cannot send restart command!"
-msgstr ""
-"Der Nagios Dienst läuft nicht, die Aufforderung zum Neustart konnte nicht "
-"gesendet werden!"
-
-#: admin/verify.php:415
+#: admin/verify.php:407
msgid "Restart failed - FTP restrictions"
msgstr "Neustart fehlgeschlagen aufgrund von FTP Fehlern"
-#: admin/verify.php:417
+#: admin/verify.php:409
msgid "Nagios restart is not possible via FTP remote connection!"
msgstr "Nagios Neustart ist nicht möglich über eine FTP Verbindung!"
-#: admin/verify.php:440
+#: admin/verify.php:431
msgid ""
"Restart failed - Nagios command file not found or no rights to execute "
"(remote SSH)!"
@@ -1856,63 +1872,63 @@ msgstr ""
"gefunden werden oder die Datei Berechtigungen reichen nicht aus (Entfernter "
"Zugriff via SSH/SFTP)!"
-#: admin/verify.php:443
+#: admin/verify.php:434
msgid "Nagios daemon successfully restarted (remote SSH)"
msgstr ""
"Nagios wurde erfolgreich neu gestartet (Entfernter Zugriff via SSH/SFTP)"
-#: admin/verify.php:445
+#: admin/verify.php:436
msgid "Restart command successfully send to Nagios (remote SSH)"
msgstr ""
"Der Neustart Befehl wurde erfolgreich an Nagios übermittelt (Entfernter "
"Zugriff via SSH/SFTP)"
-#: admin/verify.php:450
+#: admin/verify.php:441
msgid "Nagios command file not found (remote SSH)!"
msgstr ""
"Nagios command Datei nicht gefunden oder es besteht keine "
"Schreibberechtigung auf die Datei (Entfernter Zugriff via SSH/SFTP)!"
-#: admin/verify.php:458
+#: admin/verify.php:448
msgid "Check written configuration files"
msgstr "Prüfe geschriebene Konfigurationsdateien"
-#: admin/verify.php:459
+#: admin/verify.php:449
msgid "Check configuration files:"
msgstr "Konfigurationsdateien prüfen:"
-#: admin/verify.php:460
+#: admin/verify.php:450
msgid "Restart Nagios:"
msgstr "Nagios neu starten:"
-#: admin/verify.php:461
+#: admin/verify.php:451
msgid "Write monitoring data"
msgstr "Schreibe Überwachungsdaten"
-#: admin/verify.php:462
+#: admin/verify.php:452
msgid "Write additional data"
msgstr "Schreibe zusätzliche Daten"
-#: admin/verify.php:464
+#: admin/verify.php:454
msgid "Warning, always check the configuration files before restarting Nagios!"
msgstr ""
"Achtung, immer die Konfiguration prüfen bevor Nagios neu gestartet wird!"
-#: admin/verify.php:467 config/fieldvars.php:62
+#: admin/verify.php:457 config/fieldvars.php:63
msgid "Do it"
msgstr "Ausführen"
-#: admin/verify.php:498 admin/verify.php:542
+#: admin/verify.php:488 admin/verify.php:532
msgid "Nagios written configuration files checked - Warnings/Errors:"
msgstr "Geschriebene Nagios Konfiguration überprüft - Warnungen/Fehler:"
# config_class.php
-#: admin/verify.php:504 admin/verify.php:547
+#: admin/verify.php:494 admin/verify.php:537
msgid "Written configuration files are valid, Nagios can be restarted!"
msgstr ""
"Die geschriebene Konfiguration ist gültig, Nagios kann neu gestartet werden!"
-#: admin/verify.php:510
+#: admin/verify.php:500
msgid ""
"The configuration could not be tested successfully. The Nagios binary may "
"have crashed during the test. Please repeat the test or try using the "
@@ -1925,42 +1941,46 @@ msgstr ""
"Dienst sollte nicht neu gestartet werden, da die Konfiguration ungültig sein "
"kann."
-#: admin/versioncheck.php:69 admin/versioncheck.php:79
+#: admin/versioncheck.php:90
msgid "check proxy settings"
msgstr "prüfen Sie die Proxyeinstellungen"
-#: admin/versioncheck.php:82
+#: admin/versioncheck.php:92
msgid "Installed"
msgstr "Installiert"
-#: admin/versioncheck.php:84 config/fieldvars.php:187
+#: admin/versioncheck.php:94 config/fieldvars.php:190
msgid "Information"
msgstr "Information"
-#: admin/versioncheck.php:106
+#: admin/versioncheck.php:122 admin/versioncheck.php:125
msgid "You already have the latest version installed"
msgstr "Sie haben bereits die letzte stabile Version installiert"
-#: admin/versioncheck.php:109
+#: admin/versioncheck.php:126
+msgid "new GIT hotfix version available:"
+msgstr "Neue GIT Hotfix Version verfügbar:"
+
+#: admin/versioncheck.php:130
msgid ""
"You are using an old NagiosQL version. Please update to the latest stable "
"version"
msgstr ""
-"You are using an old NagiosQL version. Please update to the latest stable "
-"version"
+"Sie verwenden eine veraltete NagiosQL Version. Bitte aktualisieren sie zur "
+"aktuellen stabilen Version"
-#: admin/versioncheck.php:114
+#: admin/versioncheck.php:135
msgid "You are using a newer development version without official support"
msgstr ""
"Sie verwenden eine neuere Entwicklerversion, welche nicht offiziell "
"unterstützt wird"
# fieldvars.php
-#: config/fieldvars.php:20 functions/prepend_adm.php:538
+#: config/fieldvars.php:20 functions/prepend_adm.php:533
msgid "Domain"
msgstr "Domäne"
-#: config/fieldvars.php:22 config/fieldvars.php:30
+#: config/fieldvars.php:22 config/fieldvars.php:31
msgid "Server name"
msgstr "Servername"
@@ -1968,711 +1988,727 @@ msgstr "Servername"
msgid "Method"
msgstr "Methode"
-#: config/fieldvars.php:25 index.php:52
+#: config/fieldvars.php:25 index.php:54
msgid "Password"
msgstr "Passwort"
-#: config/fieldvars.php:27
+#: config/fieldvars.php:26
+msgid "SSH Port number"
+msgstr "SSH Portnummer"
+
+#: config/fieldvars.php:28
msgid "Directory with SSH key pair"
msgstr "Verzeichnis zum SSH Schlüsselpaar"
-#: config/fieldvars.php:29
+#: config/fieldvars.php:30
msgid "Use encrypted FTP (FTPS)"
msgstr "Verschlüsseltes FTP (FTPS)"
-#: config/fieldvars.php:32
+#: config/fieldvars.php:33
msgid "Configuration directories"
msgstr "Konfigurationsverzeichnisse"
-#: config/fieldvars.php:34
+#: config/fieldvars.php:35
msgid "Nagios configuration files and directories"
msgstr "Nagios Konfigurationdateien und -verzeichnisse"
-#: config/fieldvars.php:35
+#: config/fieldvars.php:36
msgid "Base directory"
msgstr "Basisverzeichnis"
-#: config/fieldvars.php:36
+#: config/fieldvars.php:37
msgid "Host directory"
msgstr "Hostverzeichnis"
-#: config/fieldvars.php:37
+#: config/fieldvars.php:38
msgid "Service directory"
msgstr "Serviceverzeichnis"
-#: config/fieldvars.php:38
+#: config/fieldvars.php:39
msgid "Backup directory"
msgstr "Backupverzeichnis"
-#: config/fieldvars.php:39
+#: config/fieldvars.php:40
msgid "Host backup directory"
msgstr "Host Backupverzeichnis"
-#: config/fieldvars.php:41
+#: config/fieldvars.php:42
msgid "Service backup directory"
msgstr "Service Backupverzeichnis"
-#: config/fieldvars.php:42
+#: config/fieldvars.php:43
msgid "Picture base directory"
msgstr "Nagios Bilderverzeichnis"
-#: config/fieldvars.php:47
+#: config/fieldvars.php:48
msgid "Nagios cgi file"
msgstr "Nagios CGI Datei"
-#: config/fieldvars.php:48
+#: config/fieldvars.php:49
msgid "Nagios resource file"
msgstr "Nagios Ressource Datei"
-#: config/fieldvars.php:50
+#: config/fieldvars.php:51
msgid "Use common domain"
msgstr "Benutze die globale Domäne"
-#: config/fieldvars.php:52
+#: config/fieldvars.php:53
msgid "Decode UTF8 data in config files"
msgstr "Übersetze UTF8 Daten in Konfigurationsdateien"
-#: config/fieldvars.php:53
+#: config/fieldvars.php:54
msgid "Access key holes"
msgstr "Zugriffsschlüssellöcher"
# user.php
-#: config/fieldvars.php:54
+#: config/fieldvars.php:55
msgid "Access keys"
msgstr "Zugriffsschlüssel"
-#: config/fieldvars.php:56
+#: config/fieldvars.php:57
msgid "Registered"
msgstr "Registriert"
-#: config/fieldvars.php:60
+#: config/fieldvars.php:61
msgid "Function"
msgstr "Funktion"
-#: config/fieldvars.php:61
+#: config/fieldvars.php:62
msgid "Marked"
msgstr "Markierte"
-#: config/fieldvars.php:63
+#: config/fieldvars.php:64
msgid "Add"
msgstr "Hinzufügen"
-#: config/fieldvars.php:64
+#: config/fieldvars.php:65
msgid "Form check"
msgstr "Formularprüfung"
-#: config/fieldvars.php:65
+#: config/fieldvars.php:66
msgid "Secure question"
msgstr "Sicherheitsabfrage"
-#: config/fieldvars.php:66 functions/NagContentClass.php:172
-#: functions/NagContentClass.php:177
+#: config/fieldvars.php:67 functions/NagContentClass.php:167
+#: functions/NagContentClass.php:172
msgid "Yes"
msgstr "Ja"
-#: config/fieldvars.php:67 functions/NagContentClass.php:170
-#: functions/NagContentClass.php:175
+#: config/fieldvars.php:68 functions/NagContentClass.php:165
+#: functions/NagContentClass.php:170
msgid "No"
msgstr "Nein"
-#: config/fieldvars.php:68
+#: config/fieldvars.php:69
+msgid "All"
+msgstr "Alle"
+
+#: config/fieldvars.php:70
msgid "Time"
msgstr "Zeit"
-#: config/fieldvars.php:69
+#: config/fieldvars.php:71
msgid "User"
msgstr "Benutzer"
-#: config/fieldvars.php:70
+#: config/fieldvars.php:72
msgid "IP Address"
msgstr "IP Adresse"
-#: config/fieldvars.php:71 functions/NagImportClass.php:350
-#: functions/NagImportClass.php:355 functions/NagImportClass.php:419
-#: functions/NagImportClass.php:425 functions/NagImportClass.php:432
-#: functions/NagImportClass.php:437
+#: config/fieldvars.php:73 functions/NagImportClass.php:354
+#: functions/NagImportClass.php:359 functions/NagImportClass.php:425
+#: functions/NagImportClass.php:431 functions/NagImportClass.php:438
+#: functions/NagImportClass.php:443
msgid "Entry"
msgstr "Eintrag"
-#: config/fieldvars.php:72
+#: config/fieldvars.php:74
msgid "From"
msgstr "Von"
-#: config/fieldvars.php:73
+#: config/fieldvars.php:75
msgid "To"
msgstr "Bis"
-#: config/fieldvars.php:74
+#: config/fieldvars.php:76
msgid "Delete log entries"
msgstr "Lösche Logeinträge"
-#: config/fieldvars.php:75 config/fieldvars.php:88 config/fieldvars.php:184
+#: config/fieldvars.php:77 config/fieldvars.php:90 config/fieldvars.php:187
msgid "Copy"
msgstr "Kopieren"
-#: config/fieldvars.php:78
+#: config/fieldvars.php:80
msgid "Confirm password"
msgstr "Passwort bestätigen"
# password.php
-#: config/fieldvars.php:79
+#: config/fieldvars.php:81
msgid "Old password"
msgstr "Altes Passwort"
-#: config/fieldvars.php:80 config/fieldvars.php:320
+#: config/fieldvars.php:82 config/fieldvars.php:324
msgid "New password"
msgstr "Neues Passwort"
-#: config/fieldvars.php:81
+#: config/fieldvars.php:83
msgid "Change password"
msgstr "Passwort ändern"
-#: config/fieldvars.php:82
+#: config/fieldvars.php:84
msgid "Menu page"
msgstr "Menüseite"
-#: config/fieldvars.php:83
+#: config/fieldvars.php:85
msgid "Search string"
msgstr "Suchbegriff"
-#: config/fieldvars.php:86 config/fieldvars.php:188
+#: config/fieldvars.php:88 config/fieldvars.php:191
msgid "Write config file"
msgstr "Konfigdatei schreiben"
-#: config/fieldvars.php:89
+#: config/fieldvars.php:91
msgid "Command"
msgstr "Befehl"
-#: config/fieldvars.php:91
+#: config/fieldvars.php:93
msgid "Command type"
msgstr "Befehlstyp"
-#: config/fieldvars.php:93
+#: config/fieldvars.php:94
+msgid "Help text"
+msgstr "Hilfetext"
+
+#: config/fieldvars.php:96
msgid "Exclude"
msgstr "Ausschliessen"
-#: config/fieldvars.php:94
+#: config/fieldvars.php:97
msgid "Include"
msgstr "Einschliessen"
-#: config/fieldvars.php:95
+#: config/fieldvars.php:98
msgid "Time definitions"
msgstr "Zeitdefinitionen"
-#: config/fieldvars.php:96
+#: config/fieldvars.php:99
msgid "Weekday"
msgstr "Wochentag"
-#: config/fieldvars.php:97
+#: config/fieldvars.php:100
msgid "Time range"
msgstr "Zeitbereich"
-#: config/fieldvars.php:98
+#: config/fieldvars.php:101
msgid "Time definition"
msgstr "Zeitdefinition"
-#: config/fieldvars.php:99
+#: config/fieldvars.php:102
msgid "Insert"
msgstr "Einfügen"
-#: config/fieldvars.php:100
+#: config/fieldvars.php:103
msgid "Modify selection"
msgstr "Auswahl ändern"
-#: config/fieldvars.php:103
+#: config/fieldvars.php:106
msgid "Minimum importance"
msgstr "Minimale Dringlichkeit"
-#: config/fieldvars.php:104
+#: config/fieldvars.php:107
msgid "Time period hosts"
msgstr "Zeitperiode Hosts"
-#: config/fieldvars.php:105
+#: config/fieldvars.php:108
msgid "Time period services"
msgstr "Zeitperiode Services"
-#: config/fieldvars.php:106
+#: config/fieldvars.php:109
msgid "Host options"
msgstr "Hostoptionen"
-#: config/fieldvars.php:107
+#: config/fieldvars.php:110
msgid "Service options"
msgstr "Serviceoptionen"
-#: config/fieldvars.php:108
+#: config/fieldvars.php:111
msgid "Host command"
msgstr "Hostbefehl"
-#: config/fieldvars.php:109
+#: config/fieldvars.php:112
msgid "Service command"
msgstr "Servicebefehl"
-#: config/fieldvars.php:110
+#: config/fieldvars.php:113
msgid "EMail address"
msgstr "E-Mail Adresse"
-#: config/fieldvars.php:111
+#: config/fieldvars.php:114
msgid "Pager number"
msgstr "Pagernummer"
-#: config/fieldvars.php:112
+#: config/fieldvars.php:115
msgid "Addon address"
msgstr "Zusatzadresse"
-#: config/fieldvars.php:113
+#: config/fieldvars.php:116
msgid "Host notif. enable"
msgstr "Hostalarmierung"
-#: config/fieldvars.php:114
+#: config/fieldvars.php:117
msgid "Service notif. enable"
msgstr "Servicealarmierung"
-#: config/fieldvars.php:115
+#: config/fieldvars.php:118
msgid "Can submit commands"
msgstr "Darf Befehle senden"
-#: config/fieldvars.php:116
+#: config/fieldvars.php:119
msgid "Retain status info"
msgstr "Behält Statusinfo"
-#: config/fieldvars.php:117
+#: config/fieldvars.php:120
msgid "Retain non-status info"
msgstr "Behält Nicht-Status information"
# contactgroups.php
-#: config/fieldvars.php:118
+#: config/fieldvars.php:121
msgid "Members"
msgstr "Mitglieder"
-#: config/fieldvars.php:119
+#: config/fieldvars.php:122
msgid "Group members"
msgstr "Gruppenmitglieder"
-#: config/fieldvars.php:120
+#: config/fieldvars.php:123
msgid "Common settings"
msgstr "Allgemeine Einstellungen"
-#: config/fieldvars.php:121
+#: config/fieldvars.php:124
msgid "Service settings"
msgstr "Serviceeinstellungen"
-#: config/fieldvars.php:123
+#: config/fieldvars.php:126
msgid "Add this host configuration to existing service definitions"
msgstr "Diese Hostkonfiguration bestehenden Services hinzufügen"
-#: config/fieldvars.php:125
+#: config/fieldvars.php:128
msgid "Parents"
msgstr "Vorgeschaltete Hosts"
-#: config/fieldvars.php:126
+#: config/fieldvars.php:129
msgid "Parent services"
msgstr "Abhängige Services"
-#: config/fieldvars.php:128
+#: config/fieldvars.php:131
msgid "Check command"
msgstr "Prüfbefehl"
-#: config/fieldvars.php:129
+#: config/fieldvars.php:132
msgid "Command view"
msgstr "Befehlsübersicht"
-#: config/fieldvars.php:130
+#: config/fieldvars.php:133
msgid "Additional templates"
msgstr "Zusätzliche Vorlagen"
-#: config/fieldvars.php:131
+#: config/fieldvars.php:134
msgid "Check settings"
msgstr "Prüfeinstellungen"
-#: config/fieldvars.php:132
+#: config/fieldvars.php:135
msgid "Initial state"
msgstr "Initialstatus"
-#: config/fieldvars.php:133
+#: config/fieldvars.php:136
msgid "Retry interval"
msgstr "Wiederholintervall"
-#: config/fieldvars.php:134
+#: config/fieldvars.php:137
msgid "Max check attempts"
msgstr "Max. Prüfversuche"
-#: config/fieldvars.php:135
+#: config/fieldvars.php:138
msgid "Check interval"
msgstr "Prüfintervall"
-#: config/fieldvars.php:136
+#: config/fieldvars.php:139
msgid "Active checks enabled"
msgstr "Aktive Prüfungen"
-#: config/fieldvars.php:137
+#: config/fieldvars.php:140
msgid "Passive checks enabled"
msgstr "Passive Prüfungen"
-#: config/fieldvars.php:138
+#: config/fieldvars.php:141
msgid "Check period"
msgstr "Prüfperiode"
-#: config/fieldvars.php:139
+#: config/fieldvars.php:142
msgid "Freshness treshold"
msgstr "Aktualitätsschwelle"
-#: config/fieldvars.php:140
+#: config/fieldvars.php:143
msgid "Check freshness"
msgstr "Aktualitätsprüfung"
-#: config/fieldvars.php:141
+#: config/fieldvars.php:144
msgid "Obsess over host"
msgstr "Hostverfolgung"
-#: config/fieldvars.php:142
+#: config/fieldvars.php:145
msgid "Obsess over service"
msgstr "Serviceverfolgung"
-#: config/fieldvars.php:143
+#: config/fieldvars.php:146
msgid "Event handler"
msgstr "Ereignisbefehl"
-#: config/fieldvars.php:144
+#: config/fieldvars.php:147
msgid "Event handler enabled"
msgstr "Ereignisverarbeitung"
-#: config/fieldvars.php:145
+#: config/fieldvars.php:148
msgid "Low flap threshold"
msgstr "Untere Flatterschwelle"
-#: config/fieldvars.php:146
+#: config/fieldvars.php:149
msgid "High flap threshold"
msgstr "Obere Flatterschwelle"
-#: config/fieldvars.php:147
+#: config/fieldvars.php:150
msgid "Flap detection enabled"
msgstr "Flattererkennung"
-#: config/fieldvars.php:148
+#: config/fieldvars.php:151
msgid "Flap detection options"
msgstr "Flattererkennungsoptionen"
-#: config/fieldvars.php:150
+#: config/fieldvars.php:153
msgid "Retain status information"
msgstr "Behalte Statusinfo"
-#: config/fieldvars.php:152
+#: config/fieldvars.php:155
msgid "Retain non-status information"
msgstr "Behalte Nicht-Status Information"
-#: config/fieldvars.php:153
+#: config/fieldvars.php:156
msgid "Process perf data"
msgstr "Verarbeite Perf. Daten"
-#: config/fieldvars.php:154
+#: config/fieldvars.php:157
msgid "Alarm settings"
msgstr "Alarmeinstellungen"
-#: config/fieldvars.php:155
+#: config/fieldvars.php:158
msgid "Contacts"
msgstr "Kontakte"
-#: config/fieldvars.php:157
+#: config/fieldvars.php:160
msgid "Notification period"
msgstr "Meldungsdauer"
-#: config/fieldvars.php:158
+#: config/fieldvars.php:161
msgid "Notification options"
msgstr "Meldungsoptionen"
-#: config/fieldvars.php:159
+#: config/fieldvars.php:162
msgid "Notification interval"
msgstr "Meldungsinterval"
-#: config/fieldvars.php:161
+#: config/fieldvars.php:164
msgid "First notification delay"
msgstr "Verzögerung erste Meldung"
-#: config/fieldvars.php:162
+#: config/fieldvars.php:165
msgid "Notification enabled"
msgstr "Meldungen"
-#: config/fieldvars.php:163
+#: config/fieldvars.php:166
msgid "Importance"
msgstr "Dringlichkeit"
-#: config/fieldvars.php:164
+#: config/fieldvars.php:167
msgid "Stalking options"
msgstr "Verfolgungsoptionen"
-#: config/fieldvars.php:165
+#: config/fieldvars.php:168
msgid "Addon settings"
msgstr "Zusatzeinstellungen"
-#: config/fieldvars.php:167
+#: config/fieldvars.php:170
msgid "VRML image"
msgstr "VRML Bild"
-#: config/fieldvars.php:168
+#: config/fieldvars.php:171
msgid "Notes URL"
msgstr "Notizen URL"
-#: config/fieldvars.php:169
+#: config/fieldvars.php:172
msgid "Status image"
msgstr "Statusbild"
-#: config/fieldvars.php:170
+#: config/fieldvars.php:173
msgid "Icon image"
msgstr "Icon Bild"
-#: config/fieldvars.php:171
+#: config/fieldvars.php:174
msgid "Action URL"
msgstr "Vorgangs URL"
-#: config/fieldvars.php:172
+#: config/fieldvars.php:175
msgid "2D coords"
msgstr "2D Koordinaten"
-#: config/fieldvars.php:173
+#: config/fieldvars.php:176
msgid "3D coords"
msgstr "3D Koordinaten"
-#: config/fieldvars.php:174
+#: config/fieldvars.php:177
msgid "Icon image ALT text"
msgstr "Icon Bild ALT Text"
-#: config/fieldvars.php:175
+#: config/fieldvars.php:178
msgid "standard"
msgstr "standard"
-#: config/fieldvars.php:176
+#: config/fieldvars.php:179
msgid "on"
msgstr "ein"
-#: config/fieldvars.php:177
+#: config/fieldvars.php:180
msgid "off"
msgstr "aus"
-#: config/fieldvars.php:178
+#: config/fieldvars.php:181
msgid "skip"
msgstr "skip"
-#: config/fieldvars.php:180
+#: config/fieldvars.php:183
msgid "Free variable definitions"
msgstr "Freie Variabel Definitionen"
-#: config/fieldvars.php:181
+#: config/fieldvars.php:184
msgid "Variable name"
msgstr "Variabelname"
-#: config/fieldvars.php:182
+#: config/fieldvars.php:185
msgid "Variable value"
msgstr "Variablen Wert"
-#: config/fieldvars.php:185
+#: config/fieldvars.php:188
msgid "Activate"
msgstr "Aktivieren"
-#: config/fieldvars.php:186
+#: config/fieldvars.php:189
msgid "Deactivate"
msgstr "Deaktivieren"
-#: config/fieldvars.php:190
+#: config/fieldvars.php:193
msgid "Do you really want to delete this database entry:"
msgstr "Soll dieser Datenbankeintrag wirklich gelöscht werden:"
-#: config/fieldvars.php:192
+#: config/fieldvars.php:195
msgid "Do you really want to delete all marked entries?"
msgstr "Sollen die markierten Einträge wirklich gelöscht werden?"
-#: config/fieldvars.php:194
+#: config/fieldvars.php:197
msgid "Mark all shown datasets"
msgstr "Alle angezeigten Datensätze markieren"
-#: config/fieldvars.php:195
+#: config/fieldvars.php:198
msgid "File"
msgstr "Datei"
-#: config/fieldvars.php:196
+#: config/fieldvars.php:199
msgid "Write all config files"
msgstr "Alle Konfigdateien schreiben"
-#: config/fieldvars.php:197
+#: config/fieldvars.php:200
msgid "Address"
msgstr "Hostadresse"
-#: config/fieldvars.php:198
+#: config/fieldvars.php:201
msgid "Display name"
msgstr "Anzeigename"
-#: config/fieldvars.php:200
+#: config/fieldvars.php:203
msgid "Use this configuration as a template"
msgstr "Diese Definition als Vorlage verwenden"
-#: config/fieldvars.php:201
+#: config/fieldvars.php:204
msgid "Generic name"
msgstr "Generischer Name"
-#: config/fieldvars.php:208
+#: config/fieldvars.php:211
msgid "Please check at least one option from:"
msgstr "Bitte mindestens eine Option auswählen bei:"
-#: config/fieldvars.php:209
+#: config/fieldvars.php:212
msgid "Host group name"
msgstr "Hostgruppenname"
-#: config/fieldvars.php:210
+#: config/fieldvars.php:213
msgid "Host group members"
msgstr "Hostgruppenmitglieder"
-#: config/fieldvars.php:214
+#: config/fieldvars.php:217
msgid "Is volatile"
msgstr "Ist unstetig"
-#: config/fieldvars.php:215
+#: config/fieldvars.php:218
msgid "Parallelize checks"
msgstr "Parallele Prüfungen"
-#: config/fieldvars.php:216
+#: config/fieldvars.php:219
msgid "Config name filter"
msgstr "Filter Konfigurationsname"
-#: config/fieldvars.php:218
+#: config/fieldvars.php:220
+msgid "Filter"
+msgstr "Filter"
+
+#: config/fieldvars.php:223
msgid "Import directory"
msgstr "Importverzeichnis"
-#: config/fieldvars.php:220
+#: config/fieldvars.php:225
msgid "Please insert a variable name and a variable definition"
msgstr "Bitte einen Variablennamen und einen Wertbereich eintragen"
-#: config/fieldvars.php:222 config/fieldvars.php:229 config/fieldvars.php:269
+#: config/fieldvars.php:227 config/fieldvars.php:234 config/fieldvars.php:274
msgid "Warning:"
msgstr "Warnung:"
-#: config/fieldvars.php:222
+#: config/fieldvars.php:227
msgid ""
-"You have not filled in some required fields!
If this values are set "
+"You have not filled in some required fields!
If these values are set "
"by a template, you can save anyway - otherwise you will get an invalid "
"configuration!"
msgstr ""
-"Es wurden nicht alls Pflichfelder ausgefüllt!
Sofern diese Werte über "
-"eine Vorlage gesetzt werden kann trotzdem gespeichert werden - andernfalls "
-"wird eine ungültige Konfiguration entstehen!"
+"Sie haben einige Pflichtfelder nicht ausgefüllt!
Wenn diese Werte "
+"durch eine Vorlage vorgegeben sind, können Sie trotzdem speichern - "
+"ansonsten erhalten Sie eine ungültige Konfiguration!"
-#: config/fieldvars.php:227
+#: config/fieldvars.php:232
msgid "Write config"
msgstr "Konfigurationsdatei schreiben"
-#: config/fieldvars.php:229
+#: config/fieldvars.php:234
msgid ""
"You have not filled in all command arguments (ARGx) for your selected "
-"command!
If this arguments are optional, you can save anyway - "
+"command!
If these arguments are optional, you can save anyway - "
"otherwise you will get an invalid configuration!"
msgstr ""
-"Es wurden nicht alle Befehlsargumente (ARGx) für den ausgewählten Befehl "
-"ausgefüllt!
Wenn diese Argumente nicht benötigt werden, speichern Sie "
-"einfach - andernfalls wird eine ungültige Konfiguration entstehen!"
+"Sie haben nicht alle Befehlsargumente (ARGx) für den ausgewählten Befehl "
+"eingegeben!
Wenn diese Argumente optional sind, können Sie trotzdem "
+"speichern - ansonsten erhalten Sie eine ungültige Konfiguration!"
-#: config/fieldvars.php:232
+#: config/fieldvars.php:237
msgid "Service group members"
msgstr "Servicegruppenmitglieder"
-#: config/fieldvars.php:233
+#: config/fieldvars.php:238
msgid "Service group name"
msgstr "Servicegruppenname"
-#: config/fieldvars.php:236
+#: config/fieldvars.php:241
msgid "Hostgroups"
msgstr "Hostgruppen"
-#: config/fieldvars.php:237
+#: config/fieldvars.php:242
msgid "Inherit parents"
msgstr "Vererbung"
-#: config/fieldvars.php:239
+#: config/fieldvars.php:244
msgid "Execution failure criteria"
msgstr "Ausführungsfehlerkriterium"
-#: config/fieldvars.php:241
+#: config/fieldvars.php:246
msgid "Nofification failure criteria"
msgstr "Meldungsfehlerkriterium"
-#: config/fieldvars.php:242
+#: config/fieldvars.php:247
msgid "Dependency period"
msgstr "Abhängigkeitsperiode"
-#: config/fieldvars.php:243
+#: config/fieldvars.php:248
msgid "Escalation period"
msgstr "Eskalationsdauer"
-#: config/fieldvars.php:244
+#: config/fieldvars.php:249
msgid "Escalation options"
msgstr "Eskalationsoptionen"
-#: config/fieldvars.php:245
+#: config/fieldvars.php:250
msgid "First notification"
msgstr "Erste Meldung"
-#: config/fieldvars.php:246
+#: config/fieldvars.php:251
msgid "Last notification"
msgstr "Letzte Meldung"
-#: config/fieldvars.php:250
+#: config/fieldvars.php:255
msgid "Dependent servicegroups"
msgstr "Abhängige Servicegruppen"
-#: config/fieldvars.php:251
+#: config/fieldvars.php:256
msgid "Help"
msgstr "Hilfe"
-#: config/fieldvars.php:252
+#: config/fieldvars.php:257
msgid "Calendar"
msgstr "Kalender"
-#: config/fieldvars.php:253
+#: config/fieldvars.php:258
msgid "Group name"
msgstr "Gruppenname"
-#: config/fieldvars.php:254
+#: config/fieldvars.php:259
msgid "Users"
msgstr "Benutzer"
-#: config/fieldvars.php:255
+#: config/fieldvars.php:260
msgid "Access group"
msgstr "Zugriffsgruppe"
-#: config/fieldvars.php:256
+#: config/fieldvars.php:261
msgid "User definitions"
msgstr "Benutzerdefinitionen"
-#: config/fieldvars.php:257
+#: config/fieldvars.php:262
msgid "User name"
msgstr "Benutzername"
-#: config/fieldvars.php:258
+#: config/fieldvars.php:263
msgid "User rights"
msgstr "Benutzerrechte"
-#: config/fieldvars.php:260
+#: config/fieldvars.php:265
msgid "Object access restrictions"
msgstr "Objektzugriffsrestriktionen"
-#: config/fieldvars.php:262
+#: config/fieldvars.php:267
msgid "Enable group administration"
msgstr "Erlaube Gruppenadministration"
-#: config/fieldvars.php:263
+#: config/fieldvars.php:268
msgid "Show relation data"
msgstr "Zeige verknüpfte Daten"
-#: config/fieldvars.php:264
+#: config/fieldvars.php:269
msgid "Hide relation data"
msgstr "Verstecke verknüpfte Daten"
-#: config/fieldvars.php:266
+#: config/fieldvars.php:271
msgid "User language"
msgstr "Benutzersprache"
-#: config/fieldvars.php:267
+#: config/fieldvars.php:272
msgid "Standard domain"
msgstr "Standarddomäne"
-#: config/fieldvars.php:269
+#: config/fieldvars.php:274
msgid ""
"The associated services must be additionally written to the files. Only "
"writing the host configuration is not sufficient because the modification is "
@@ -2682,276 +2718,239 @@ msgstr ""
"Schreiben der Hostkonfiguration alleine genügt nicht, weil die Änderungen in "
"der Servicekonfiguration eingetragen werden!"
-#: config/fieldvars.php:273
+#: config/fieldvars.php:278
msgid "Monday"
msgstr "Montag"
-#: config/fieldvars.php:274
+#: config/fieldvars.php:279
msgid "Tuesday"
msgstr "Dienstag"
-#: config/fieldvars.php:275
+#: config/fieldvars.php:280
msgid "Wednesday"
msgstr "Mittwoch"
-#: config/fieldvars.php:276
+#: config/fieldvars.php:281
msgid "Thursday"
msgstr "Donnerstag"
-#: config/fieldvars.php:277
+#: config/fieldvars.php:282
msgid "Friday"
msgstr "Freitag"
-#: config/fieldvars.php:278
+#: config/fieldvars.php:283
msgid "Saturday"
msgstr "Samstag"
-#: config/fieldvars.php:279
+#: config/fieldvars.php:284
msgid "Sunday"
msgstr "Sonntag"
-#: config/fieldvars.php:291
+#: config/fieldvars.php:295
msgid "Main page"
msgstr "Hauptseite"
-#: config/fieldvars.php:292
+#: config/fieldvars.php:296
msgid "Supervision"
msgstr "Überwachung"
-#: config/fieldvars.php:295
+#: config/fieldvars.php:299
msgid "Commands"
msgstr "Befehle"
-#: config/fieldvars.php:296
+#: config/fieldvars.php:300
msgid "Specialties"
msgstr "Spezialitäten"
-#: config/fieldvars.php:297
+#: config/fieldvars.php:301
msgid "Tools"
msgstr "Werkzeuge"
-#: config/fieldvars.php:308
+#: config/fieldvars.php:312
msgid "Service dependency"
msgstr "Service Abhängigkeiten"
-#: config/fieldvars.php:309
+#: config/fieldvars.php:313
msgid "Service escalation"
msgstr "Service Eskalationen"
-#: config/fieldvars.php:310
+#: config/fieldvars.php:314
msgid "Host dependency"
msgstr "Host Abhängigk."
-#: config/fieldvars.php:311
+#: config/fieldvars.php:315
msgid "Host escalation"
msgstr "Host Eskalation"
-#: config/fieldvars.php:312
+#: config/fieldvars.php:316
msgid "Extended Host"
msgstr "Host erweitert"
-#: config/fieldvars.php:313
+#: config/fieldvars.php:317
msgid "Extended Service"
msgstr "Service erweitert"
-#: config/fieldvars.php:314
+#: config/fieldvars.php:318
msgid "Data import"
msgstr "Datenimport"
-#: config/fieldvars.php:317
+#: config/fieldvars.php:321
msgid "User admin"
msgstr "Benutzer"
-#: config/fieldvars.php:318
+#: config/fieldvars.php:322
msgid "Group admin"
msgstr "Gruppen"
-#: config/fieldvars.php:319
+#: config/fieldvars.php:323
msgid "Nagios control"
msgstr "Nagios steuern"
-#: config/fieldvars.php:321
+#: config/fieldvars.php:325
msgid "Logbook"
msgstr "Logbuch"
-#: config/fieldvars.php:322
+#: config/fieldvars.php:326
msgid "Nagios config"
msgstr "Nagios Config"
-#: config/fieldvars.php:323
+#: config/fieldvars.php:327
msgid "Settings"
msgstr "Einstellungen"
-#: config/fieldvars.php:324
+#: config/fieldvars.php:328
msgid "Definitions"
msgstr "Definitionen"
-#: config/fieldvars.php:325
+#: config/fieldvars.php:329
msgid "CGI config"
msgstr "CGI Config"
-#: config/fieldvars.php:326
+#: config/fieldvars.php:330
msgid "Menu access"
msgstr "Menu Zugriff"
-#: config/fieldvars.php:327
+#: config/fieldvars.php:331
msgid "Domains"
msgstr "Domänen"
-#: config/fieldvars.php:331
+#: config/fieldvars.php:335
msgid "Help editor"
msgstr "Hilfe Editor"
# fieldvars.php
-#: config/fieldvars.php:332
+#: config/fieldvars.php:336
msgid "Data domains"
msgstr "Datendomäne"
-#: config/fieldvars.php:333
+#: config/fieldvars.php:337
msgid "Config targets"
msgstr "Konfigdomäne"
-#: config/fieldvars.php:334
+#: config/fieldvars.php:338
msgid "Support"
msgstr "Support"
-#: functions/MysqliDbClass.php:291
+#: functions/MysqliDbClass.php:132
msgid "Missing server connection parameter!"
msgstr "Fehlende Parameter für die Serververbindung!"
-#: functions/MysqliDbClass.php:310
+#: functions/MysqliDbClass.php:151
msgid "Connection to the database server has failed by reason:"
msgstr "Die Verbindung zum Datenbankserver erzeugte den folgenden Fehler:"
-#: functions/MysqliDbClass.php:338
+#: functions/MysqliDbClass.php:194
msgid "Missing database connection parameter!"
msgstr "Fehlende Parameter für die Datenbankverbindung!"
-#: functions/MysqliDbClass.php:347
+#: functions/MysqliDbClass.php:206
msgid "Connection to the database has failed by reason:"
msgstr "Die Verbindung zum Datenbankserver erzeugte den folgenden Fehler:"
-#: functions/NagConfigClass.php:336 functions/NagConfigClass.php:338
+#: functions/MysqliDbClass.php:404
+msgid "Missing MySQL SSL parameter!"
+msgstr "Fehlende SSL Parameter für die Serververbindung!"
+
+#: functions/NagConfigClass.php:331 functions/NagConfigClass.php:333
msgid "Connection to remote system failed (FTP connection):"
msgstr "Verbindung zum entfernten System ist fehlgeschlagen (FTP Verbindung):"
-#: functions/NagConfigClass.php:387 functions/NagConfigClass.php:389
+#: functions/NagConfigClass.php:407 functions/NagConfigClass.php:409
msgid "SSH public key does not exist or is not readable"
msgstr "Der SSH Public Key existiert nicht oder ist nicht lesbar"
-#: functions/NagConfigClass.php:394 functions/NagConfigClass.php:396
+#: functions/NagConfigClass.php:414 functions/NagConfigClass.php:416
msgid "SSH private key does not exist or is not readable"
msgstr "Der SSH Private Key existiert nicht oder ist nicht lesbar"
-#: functions/NagConfigClass.php:430 functions/NagConfigClass.php:432
-#: functions/NagConfigClass.php:441 functions/NagConfigClass.php:443
+#: functions/NagConfigClass.php:449 functions/NagConfigClass.php:451
+#: functions/NagConfigClass.php:460 functions/NagConfigClass.php:462
msgid "Connection to remote system failed (SSH2 connection):"
msgstr "Verbindung zum entfernten System ist fehlgeschlagen (SSH2 Verbindung):"
-#: functions/NagConfigClass.php:600
-msgid ""
-"Cannot backup the old file because the permissions are wrong - destination "
-"file: "
-msgstr ""
-"Kann die alte Datei nicht sichern weil die Dateirechte falsch sind - "
-"Zieldatei: "
+#: functions/NagConfigClass.php:450 functions/NagConfigClass.php:452
+#: functions/NagConfigClass.php:461 functions/NagConfigClass.php:463
+msgid "port"
+msgstr "Port"
-#: functions/NagConfigClass.php:605
-msgid ""
-"Cannot backup the old file because the source file is missing - source file: "
-msgstr ""
-"Kann die alte Datei nicht sichern weil die Quelldatei nicht gefunden wurde: "
-
-#: functions/NagConfigClass.php:623
-msgid ""
-"Cannot backup the old file because the source file is missing (remote FTP) - "
-"source file: "
-msgstr ""
-"Kann die alte Datei nicht sichern weil die Quelldatei nicht gefunden wurde "
-"(FTP Zugriff) - Quelldatei: "
-
-#: functions/NagConfigClass.php:629
-msgid ""
-"Cannot backup the old file because the permissions are wrong (remote FTP) - "
-"destination file: "
-msgstr ""
-"Kann die alte Datei nicht sichern weil die Dateirechte falsch sind (FTP "
-"Zugriff) - Zieldatei: "
-
-#: functions/NagConfigClass.php:648
-msgid ""
-"Cannot backup the old file because the source file is missing (remote SFTP) "
-"- source file: "
-msgstr ""
-"Kann die alte Datei nicht sichern weil die Quelldatei nicht gefunden wurde "
-"(SSH/SFTP Zugriff) - Quelldatei: "
-
-#: functions/NagConfigClass.php:654
-msgid ""
-"Cannot backup the old file because the permissions are wrong (remote SFTP) - "
-"destination file: "
-msgstr ""
-"Kann die alte Datei nicht sichern weil die Dateirechte falsch sind (SSH/SFTP "
-"Zugriff) - Zieldatei: "
-
-#: functions/NagConfigClass.php:685
+#: functions/NagConfigClass.php:552
msgid "Cannot delete the file (wrong permissions)!"
msgstr "Datei kann nicht gelöscht werden (Berechtigungen prüfen)!"
-#: functions/NagConfigClass.php:690
+#: functions/NagConfigClass.php:557
msgid "Cannot delete the file (file does not exist)!"
msgstr "Datei kann nicht gelöscht werden (Datei existiert nicht)!"
-#: functions/NagConfigClass.php:706
+#: functions/NagConfigClass.php:573
msgid "Cannot delete file because it does not exists (remote FTP)!"
msgstr ""
"Datei kann nicht gelöscht werden, da sie nicht exisitiert (Entfernter "
"Zugriff via FTP)"
-#: functions/NagConfigClass.php:712
+#: functions/NagConfigClass.php:579
msgid "Cannot delete file because the permissions are incorrect (remote FTP)!"
msgstr ""
"Datei kann aufgrund falscher Dateiberechtigungen nicht gelöscht werden (FTP "
"Remote Dateirechte)"
-#: functions/NagConfigClass.php:724
+#: functions/NagConfigClass.php:591
msgid "Cannot delete file because it does not exists (remote SSH/SFTP)!"
msgstr ""
"Datei kann nicht gelöscht werden, da sie nicht vorhanden ist (Entfernter "
"Zugriff via SSH/SFTP)"
-#: functions/NagConfigClass.php:730
+#: functions/NagConfigClass.php:597
msgid ""
"Cannot delete file because the permissions are incorrect (remote SSH/SFTP)!"
msgstr ""
"Datei kann aufgrund falscher Dateiberechtigungen nicht gelöscht werden "
"(Entfernter Zugriff via SSH/SFTP)"
-#: functions/NagConfigClass.php:822 functions/NagConfigClass.php:846
+#: functions/NagConfigClass.php:692 functions/NagConfigClass.php:716
msgid ""
"Cannot get the remote file (it does not exist or is not readable) - remote "
"file: "
msgstr "Importdatei existiert nicht oder ist nicht lesbar - Importdatei: "
-#: functions/NagConfigClass.php:831
+#: functions/NagConfigClass.php:701
msgid ""
"Cannot write the remote file (remote file is not writeable)- remote file: "
msgstr ""
"Kann die entfernte Datei nicht schreiben (fehlende Schreibrechte) - "
"entfernte Datei: "
-#: functions/NagConfigClass.php:849
+#: functions/NagConfigClass.php:719
msgid "Remote file is not readable - remote file: "
msgstr "Entfernte Datei ist nicht lesbar - entfernte Datei: "
-#: functions/NagConfigClass.php:860
+#: functions/NagConfigClass.php:730
msgid ""
"Cannot write a remote file (remote file is not writeable) - remote file: "
msgstr ""
"Kann eine entfernte Datei nicht schreiben (fehlende Schreibrechte) - "
"entfernte Datei: "
-#: functions/NagConfigClass.php:866
+#: functions/NagConfigClass.php:736
msgid ""
"Cannot copy a local file to remote because the local file does not exist or "
"is not readable - local file: "
@@ -2960,72 +2959,118 @@ msgstr ""
"lokale Datei nicht existiert oder nicht lesbar ist - lokale Datei: "
# contacts.php
-#: functions/NagConfigClass.php:894
+#: functions/NagConfigClass.php:764
msgid "Could not open directory"
msgstr "Kann das Verzeichnis nicht öffnen"
# config_class.php
-#: functions/NagConfigClass.php:1003 functions/NagConfigClass.php:1006
+#: functions/NagConfigClass.php:873 functions/NagConfigClass.php:876
msgid "Warning: configuration file is out of date!"
msgstr "Achtung: Konfigurationsdatei ist veraltet!"
-#: functions/NagConfigClass.php:1010 functions/NagConfigClass.php:1042
-#: functions/NagConfigClass.php:1108
+#: functions/NagConfigClass.php:880 functions/NagConfigClass.php:995
+#: functions/NagConfigClass.php:2499
msgid "Warning: no configuration target defined!"
msgstr "Achtung: kein Konfigurationsziel definiert!"
-#: functions/NagConfigClass.php:1030 functions/NagConfigClass.php:1076
+#: functions/NagConfigClass.php:983 functions/NagConfigClass.php:2466
msgid ""
"It is not possible to write config files directly from the common domain!"
msgstr ""
"Es ist nicht möglich Konfigurationsdateien direkt aus der globalen Domäne zu "
"schreiben!"
-#: functions/NagConfigClass.php:2069
+#: functions/NagConfigClass.php:2288
+msgid ""
+"Cannot backup the old file because the permissions are wrong - destination "
+"file: "
+msgstr ""
+"Kann die alte Datei nicht sichern weil die Dateirechte falsch sind - "
+"Zieldatei: "
+
+#: functions/NagConfigClass.php:2293
+msgid ""
+"Cannot backup the old file because the source file is missing - source file: "
+msgstr ""
+"Kann die alte Datei nicht sichern weil die Quelldatei nicht gefunden wurde: "
+
+#: functions/NagConfigClass.php:2311
+msgid ""
+"Cannot backup the old file because the source file is missing (remote FTP) - "
+"source file: "
+msgstr ""
+"Kann die alte Datei nicht sichern weil die Quelldatei nicht gefunden wurde "
+"(FTP Zugriff) - Quelldatei: "
+
+#: functions/NagConfigClass.php:2317
+msgid ""
+"Cannot backup the old file because the permissions are wrong (remote FTP) - "
+"destination file: "
+msgstr ""
+"Kann die alte Datei nicht sichern weil die Dateirechte falsch sind (FTP "
+"Zugriff) - Zieldatei: "
+
+#: functions/NagConfigClass.php:2336
+msgid ""
+"Cannot backup the old file because the source file is missing (remote SFTP) "
+"- source file: "
+msgstr ""
+"Kann die alte Datei nicht sichern weil die Quelldatei nicht gefunden wurde "
+"(SSH/SFTP Zugriff) - Quelldatei: "
+
+#: functions/NagConfigClass.php:2342
+msgid ""
+"Cannot backup the old file because the permissions are wrong (remote SFTP) - "
+"destination file: "
+msgstr ""
+"Kann die alte Datei nicht sichern weil die Dateirechte falsch sind (SSH/SFTP "
+"Zugriff) - Zieldatei: "
+
+#: functions/NagConfigClass.php:2395
msgid "Cannot open/overwrite the configuration file (FTP connection failed)!"
msgstr ""
"Kann die Konfigurationsdatei nicht schreiben/überschreiben (FTP Verbindung "
"fehlgeschlagen)!"
-#: functions/NagConfigClass.php:2091
+#: functions/NagConfigClass.php:2417
msgid "Cannot open/overwrite the configuration file (remote SFTP)!"
msgstr ""
"Kann Konfigurationsdatei nicht öffnen/überschreiben (Entfernter Zugriff via "
"SSH/SFTP)!"
-#: functions/NagContentClass.php:251
+#: functions/NagContentClass.php:246
msgid "out-of-date"
msgstr "Veraltet"
-#: functions/NagContentClass.php:253
+#: functions/NagContentClass.php:248
msgid "no target"
msgstr "kein Ziel"
-#: functions/NagContentClass.php:256 functions/NagContentClass.php:259
+#: functions/NagContentClass.php:251 functions/NagContentClass.php:254
msgid "missed"
msgstr "fehlt"
-#: functions/NagContentClass.php:262 install/functions/NagInstallClass.php:479
+#: functions/NagContentClass.php:257 install/functions/NagInstallClass.php:323
msgid "up-to-date"
msgstr "Aktuell"
-#: functions/NagContentClass.php:355
+#: functions/NagContentClass.php:476
msgid "Last database update:"
msgstr "Letzte Datenbankänderung:"
-#: functions/NagContentClass.php:359
+#: functions/NagContentClass.php:480
msgid "Last file change of the configuration target "
msgstr "Letzte Dateiänderung beim Konfigurationsziel "
-#: functions/NagDataClass.php:267 functions/NagDataClass.php:269
+#: functions/NagDataClass.php:176 functions/NagDataClass.php:178
msgid "Data set copy failed - table [new name]:"
msgstr "Kopieren fehlgeschlagen - Tabelle [Neuer Name]:"
-#: functions/NagDataClass.php:273 functions/NagDataClass.php:275
+#: functions/NagDataClass.php:182 functions/NagDataClass.php:184
msgid "Data set copied - table [new name]:"
msgstr "Daten in Tabelle kopiert - Tabelle [Neuer Name]:"
-#: functions/NagDataClass.php:295 functions/NagDataClass.php:300
+#: functions/NagDataClass.php:204 functions/NagDataClass.php:209
msgid ""
"No dataset copied. Maybe the dataset does not exist or you do not have write "
"permission."
@@ -3034,11 +3079,11 @@ msgstr ""
"die Schreibrechte fehlen."
# data_class.php
-#: functions/NagDataClass.php:393 functions/NagDataClass.php:422
+#: functions/NagDataClass.php:790 functions/NagDataClass.php:821
msgid "Delete failed because a database error:"
msgstr "Löschen wegen eines Datenbankfehlers fehlgeschlagen:"
-#: functions/NagDataClass.php:397
+#: functions/NagDataClass.php:794
msgid ""
"No data deleted. The dataset probably does not exist or is protected from "
"deletion."
@@ -3046,21 +3091,21 @@ msgstr ""
"Keine Daten gelöscht. Möglicherweise existiert der Datensatz nicht oder er "
"ist Löschgeschützt."
-#: functions/NagDataClass.php:403
+#: functions/NagDataClass.php:800
msgid "Delete dataset id:"
msgstr "Daten gelöscht mit id:"
-#: functions/NagDataClass.php:403
+#: functions/NagDataClass.php:800
msgid "- from table:"
msgstr "- von Tabelle:"
-#: functions/NagDataClass.php:404 functions/NagDataClass.php:439
-#: functions/NagDataClass.php:614 functions/NagDataClass.php:963
-#: functions/NagDataClass.php:1020
+#: functions/NagDataClass.php:801 functions/NagDataClass.php:838
+#: functions/NagDataClass.php:1020 functions/NagDataClass.php:1379
+#: functions/NagDataClass.php:1437
msgid "- with affected rows:"
msgstr "- Anzahl betroffene Datensätze:"
-#: functions/NagDataClass.php:432 functions/NagDataClass.php:443
+#: functions/NagDataClass.php:831 functions/NagDataClass.php:842
msgid ""
"No data deleted. Probably the dataset does not exist or it is protected from "
"delete."
@@ -3068,11 +3113,11 @@ msgstr ""
"Keine Daten gelöscht. Möglicherweise existiert der Datensatz nicht, oder er "
"ist Löschgeschützt."
-#: functions/NagDataClass.php:438 functions/NagDataClass.php:613
+#: functions/NagDataClass.php:837 functions/NagDataClass.php:1019
msgid "Deleted data from table:"
msgstr "Daten gelöscht aus der Tabelle:"
-#: functions/NagDataClass.php:603
+#: functions/NagDataClass.php:1009
msgid ""
"No data deleted. Probably the dataset does not exist, it is protected from "
"deletion, you do not have write permission or it has relations to other "
@@ -3084,7 +3129,7 @@ msgstr ""
"aufgelöste Abhängigkeiten. Benutze die \"info\" Funktion für weitere "
"Informationen über Abhängigkeiten!"
-#: functions/NagDataClass.php:619
+#: functions/NagDataClass.php:1025
msgid ""
"No data deleted. Probably the dataset does not exist, it is protected from "
"deletion or you do not have write permission."
@@ -3092,36 +3137,36 @@ msgstr ""
"Kein Datensatz gelöscht. Möglicherweise existiert der Datensatz nicht, er "
"ist Löschgeschützt oder die Schreibrechte fehlen."
-#: functions/NagDataClass.php:691
+#: functions/NagDataClass.php:1097
msgid "Relation information for "
msgstr "Verknüpfungsinformationen für "
-#: functions/NagDataClass.php:692
+#: functions/NagDataClass.php:1098
msgid " of table "
msgstr " aus der Tabelle "
-#: functions/NagDataClass.php:747 functions/NagDataClass.php:752
-#: functions/NagDataClass.php:759 functions/NagDataClass.php:778
-#: functions/NagDataClass.php:784
+#: functions/NagDataClass.php:1157 functions/NagDataClass.php:1162
+#: functions/NagDataClass.php:1169 functions/NagDataClass.php:1189
+#: functions/NagDataClass.php:1195
msgid "Relation to "
msgstr "Verknüpfung nach "
-#: functions/NagDataClass.php:748 functions/NagDataClass.php:753
-#: functions/NagDataClass.php:760 functions/NagDataClass.php:779
-#: functions/NagDataClass.php:785
+#: functions/NagDataClass.php:1158 functions/NagDataClass.php:1163
+#: functions/NagDataClass.php:1170 functions/NagDataClass.php:1190
+#: functions/NagDataClass.php:1196
msgid ", entry "
msgstr ", Eintrag "
-#: functions/NagDataClass.php:749 functions/NagDataClass.php:761
-#: functions/NagDataClass.php:787
+#: functions/NagDataClass.php:1159 functions/NagDataClass.php:1171
+#: functions/NagDataClass.php:1198
msgid "deletion possible"
msgstr "löschen möglich"
-#: functions/NagDataClass.php:755 functions/NagDataClass.php:781
+#: functions/NagDataClass.php:1165 functions/NagDataClass.php:1192
msgid "deletion not possible"
msgstr "löschen nicht möglich"
-#: functions/NagDataClass.php:954
+#: functions/NagDataClass.php:1370
msgid ""
"No dataset deactivated. Maybe the dataset does not exist, it is protected "
"from deactivation, no dataset was selected or you do not have write "
@@ -3133,15 +3178,15 @@ msgstr ""
"Schreibrechte fehlen. Benutze die \"info\" Funktion für weitere "
"Informationen über Abhängigkeiten!"
-#: functions/NagDataClass.php:960
+#: functions/NagDataClass.php:1376
msgid "Dataset successfully deactivated. Affected rows:"
msgstr "Datensatz erfolgreich deaktiviert. Betroffene Datensätze:"
-#: functions/NagDataClass.php:962
+#: functions/NagDataClass.php:1378
msgid "Deactivate dataset from table:"
msgstr "Datensatz deaktiviert aus der Tabelle:"
-#: functions/NagDataClass.php:967
+#: functions/NagDataClass.php:1383
msgid ""
"No dataset deactivated. Maybe the dataset does not exist or you do not have "
"write permission."
@@ -3149,7 +3194,7 @@ msgstr ""
"Kein Datensatz deaktiviert. Möglicherweise existiert der Datensatz nicht, es "
"wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen."
-#: functions/NagDataClass.php:1013
+#: functions/NagDataClass.php:1430
msgid ""
"No dataset activated. Maybe the dataset does not exist, no dataset was "
"selected or you do not have write permission."
@@ -3157,15 +3202,15 @@ msgstr ""
"Kein Datensatz aktiviert. Möglicherweise existiert der Datensatz nicht, es "
"wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen."
-#: functions/NagDataClass.php:1017
+#: functions/NagDataClass.php:1434
msgid "Dataset successfully activated. Affected rows:"
msgstr "Datensätze erfolgreich aktiviert. Betroffenene Datensätze:"
-#: functions/NagDataClass.php:1019
+#: functions/NagDataClass.php:1436
msgid "Activate dataset from table:"
msgstr "Datensatz aktiviert aus der Tabelle:"
-#: functions/NagDataClass.php:1024
+#: functions/NagDataClass.php:1441
msgid ""
"No dataset activated. Maybe the dataset does not exist or you do not have "
"write permission."
@@ -3173,102 +3218,102 @@ msgstr ""
"Kein Datensatz aktiviert. Möglicherweise existiert der Datensatz nicht, es "
"wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen."
-#: functions/NagImportClass.php:162
+#: functions/NagImportClass.php:158
msgid "No valid configuration found:"
msgstr "Keine gültige Konfiguration gefunden:"
-#: functions/NagImportClass.php:170
+#: functions/NagImportClass.php:166
msgid "Import file does not exist or is not readable:"
msgstr "Importdatei existiert nicht oder ist nicht lesbar:"
-#: functions/NagImportClass.php:202
+#: functions/NagImportClass.php:199
msgid "Unable to get configuration data:"
msgstr "Konfigurationsdaten nicht gefunden:"
-#: functions/NagImportClass.php:229
+#: functions/NagImportClass.php:226
msgid "Cannot receive the configuration file (FTP connection)!"
msgstr ""
"Kann die Konfigurationsdatei nicht empfangen (Entfernter Zugriff via FTP)"
-#: functions/NagImportClass.php:252
+#: functions/NagImportClass.php:249
msgid "Cannot receive the configuration file (SSH connection)!"
msgstr ""
"Kann die Konfigurationsdatei nicht empfangen (Entfernter Zugriff via SSH/"
"SFTP)"
-#: functions/NagImportClass.php:351 functions/NagImportClass.php:356
-#: functions/NagImportClass.php:420 functions/NagImportClass.php:426
-#: functions/NagImportClass.php:433 functions/NagImportClass.php:438
+#: functions/NagImportClass.php:355 functions/NagImportClass.php:360
+#: functions/NagImportClass.php:426 functions/NagImportClass.php:432
+#: functions/NagImportClass.php:439 functions/NagImportClass.php:444
msgid "inside"
msgstr "innerhalb"
-#: functions/NagImportClass.php:352
+#: functions/NagImportClass.php:356
msgid "exists and were not overwritten"
msgstr "existiert bereits und wurden nicht überschrieben"
-#: functions/NagImportClass.php:357
+#: functions/NagImportClass.php:361
msgid "were not written"
msgstr "konnten nicht geschrieben werden"
# contacts.php
-#: functions/NagImportClass.php:421 functions/NagImportClass.php:427
+#: functions/NagImportClass.php:427 functions/NagImportClass.php:433
msgid "could not be inserted:"
msgstr "konnte nicht eingetragen werden:"
-#: functions/NagImportClass.php:434 functions/NagImportClass.php:439
+#: functions/NagImportClass.php:440 functions/NagImportClass.php:445
msgid "successfully inserted"
msgstr "erfolgreich eingetragen"
-#: functions/NagImportClass.php:564
+#: functions/NagImportClass.php:572
msgid "Table for import definition"
msgstr "Tabelle für die Importdefinition"
# mutdialog.php
-#: functions/NagImportClass.php:565
+#: functions/NagImportClass.php:573
msgid "is not available!"
msgstr "ist nicht verfügbar!"
-#: functions/NagImportClass.php:1640
+#: functions/NagImportClass.php:1678
msgid ""
"Error: incorrect number of arguments - cannot import service group members"
msgstr ""
"Fehler: ungültige Anzahl Argumente - kann die Servicegruppenmitglieder nicht "
"importieren"
-#: functions/NagImportClass.php:1868
+#: functions/NagImportClass.php:1918
msgid ""
"Error: incorrect number of arguments - cannot import service parent members"
msgstr ""
"Fehler: ungültige Anzahl Argumente - kann die vorgeschalteten Services der "
"Servicedefinition nicht importieren"
-#: functions/NagImportClass.php:1929 functions/NagImportClass.php:1934
+#: functions/NagImportClass.php:1980 functions/NagImportClass.php:1985
msgid "Error: cannot import the service parent member "
msgstr ""
"Fehler: kann die vorgeschalteten Services der Servicedefinition nicht "
"eintragen "
-#: functions/NagImportClass.php:1931
+#: functions/NagImportClass.php:1982
msgid "This combination is not unique!"
msgstr "Diese Kombination ist nicht eindeutig!"
-#: functions/NagImportClass.php:1936
+#: functions/NagImportClass.php:1987
msgid "This combination is not unique or does not exist!"
msgstr "Diese Kombination ist nicht eindeutig oder nicht vorhanden!"
-#: functions/NagVisualClass.php:227
+#: functions/NagVisualClass.php:131
msgid "Hide menu"
msgstr "Menu ausblenden"
-#: functions/NagVisualClass.php:237
+#: functions/NagVisualClass.php:140
msgid "Show menu"
msgstr "Menu einblenden"
-#: functions/NagVisualClass.php:272
+#: functions/NagVisualClass.php:316
msgid "Page"
msgstr "Seite"
-#: functions/NagVisualClass.php:805
+#: functions/NagVisualClass.php:524
msgid "Unrestricted access"
msgstr "Uneingeschränkter Zugriff"
@@ -3280,7 +3325,7 @@ msgstr ""
"Fehler bei der Erkennung der richtigen Umgebungsvariable locale. Bitte diese "
"Fehlermeldung und die Ausgabe von 'locale -a' an bugs@nagiosql.org schicken"
-#: functions/prepend_adm.php:306
+#: functions/prepend_adm.php:305
msgid "Webserver login successfull"
msgstr "Webserver-Login erfolgreich"
@@ -3296,23 +3341,23 @@ msgstr "Login fehlgeschlagen!"
msgid "Session timeout reached - Seconds:"
msgstr "Session timeout erreicht - Sekunden:"
-#: functions/prepend_adm.php:402
+#: functions/prepend_adm.php:401
msgid "Restricted site accessed:"
msgstr "Unerlaubte Seite aufgerufen:"
-#: functions/prepend_adm.php:419
+#: functions/prepend_adm.php:418
msgid "User not found in database"
msgstr "User in Datenbank nicht gefunden"
-#: functions/prepend_adm.php:548
+#: functions/prepend_adm.php:543
msgid "Logged in:"
msgstr "Eingeloggt:"
-#: functions/prepend_adm.php:550
+#: functions/prepend_adm.php:545
msgid "Logout"
msgstr "Abmelden"
-#: functions/prepend_adm.php:573
+#: functions/prepend_adm.php:568
msgid ""
"Warning - template file not found or not readable, please check your file "
"permissions! - File: "
@@ -3320,8 +3365,8 @@ msgstr ""
"Achtung, das Template konnte nicht gefunden werden oder ist nicht "
"schreibbar, bitte überprüfe die Rechte! - Datei: "
-#: functions/prepend_content.php:258 functions/prepend_content.php:265
-#: functions/prepend_content.php:288 functions/prepend_content.php:295
+#: functions/prepend_content.php:301 functions/prepend_content.php:308
+#: functions/prepend_content.php:331 functions/prepend_content.php:338
msgid ""
"Some configuration files were not written. Dataset not activated, not found "
"or you do not have write permission!"
@@ -3330,71 +3375,71 @@ msgstr ""
"existierender bzw. kein aktiver Datensatz gefunden oder die Schreibrechte "
"fehlen!"
-#: functions/prepend_content.php:262 functions/prepend_content.php:292
+#: functions/prepend_content.php:305 functions/prepend_content.php:335
msgid "Configuration files successfully written!"
msgstr "Konfigurationsdateien erfolgreich geschrieben!"
-#: functions/prepend_content.php:321
+#: functions/prepend_content.php:364
msgid "Admin cannot be deleted"
msgstr "Der Benutzer Admin kann nicht gelöscht werden"
-#: functions/prepend_content.php:325
+#: functions/prepend_content.php:368
msgid "Localhost can't be deleted"
msgstr "Localhost kann nicht gelöscht werden"
-#: functions/prepend_content.php:502
+#: functions/prepend_content.php:548
msgid "No permission to open configuration!"
msgstr "Nicht genügend Rechte um die Konfiguration zu öffnen!"
-#: functions/translator.php:63 install/functions/NagInstallClass.php:99
+#: functions/translator.php:56 install/functions/NagInstallClass.php:111
msgid "English"
msgstr "Englisch"
-#: functions/translator.php:67 install/functions/NagInstallClass.php:103
+#: functions/translator.php:60 install/functions/NagInstallClass.php:115
msgid "German"
msgstr "Deutsch"
-#: functions/translator.php:71 install/functions/NagInstallClass.php:107
+#: functions/translator.php:64 install/functions/NagInstallClass.php:119
msgid "Chinese (Simplified)"
msgstr "Chinese (Simplified)"
-#: functions/translator.php:75 install/functions/NagInstallClass.php:111
+#: functions/translator.php:68 install/functions/NagInstallClass.php:123
msgid "Italian"
msgstr "Italienisch"
-#: functions/translator.php:79 install/functions/NagInstallClass.php:115
+#: functions/translator.php:72 install/functions/NagInstallClass.php:127
msgid "French"
msgstr "Französisch"
-#: functions/translator.php:83 install/functions/NagInstallClass.php:119
+#: functions/translator.php:76 install/functions/NagInstallClass.php:131
msgid "Russian"
msgstr "Russisch"
-#: functions/translator.php:87 install/functions/NagInstallClass.php:123
+#: functions/translator.php:80 install/functions/NagInstallClass.php:135
msgid "Spanish"
msgstr "Spanisch"
-#: functions/translator.php:91 install/functions/NagInstallClass.php:127
+#: functions/translator.php:84 install/functions/NagInstallClass.php:139
msgid "Portuguese (Brazilian)"
msgstr "Portugiesisch (Brasilianisch)"
-#: functions/translator.php:95 install/functions/NagInstallClass.php:131
+#: functions/translator.php:88 install/functions/NagInstallClass.php:143
msgid "Dutch"
msgstr "Niederländisch"
-#: functions/translator.php:99 install/functions/NagInstallClass.php:135
+#: functions/translator.php:92 install/functions/NagInstallClass.php:147
msgid "Danish"
msgstr "Dänisch"
-#: index.php:47
+#: index.php:49
msgid "Welcome to"
msgstr "Willkommen bei"
-#: index.php:48
+#: index.php:50
msgid "Welcome"
msgstr "Willkommen"
-#: index.php:49
+#: index.php:51
msgid ""
"Please enter your username and password to access NagiosQL. If you forgot "
"one of them, please contact your Administrator."
@@ -3403,42 +3448,42 @@ msgstr ""
"Zugriff ein. Sollten Sie keinen Zugang besitzen oder Ihr Passwort "
"vergessen haben, so wenden Sie sich an einen Administrator."
-#: index.php:53
+#: index.php:55
msgid "Login"
msgstr "Login"
-#: install/functions/NagInstallClass.php:75
+#: install/functions/NagInstallClass.php:67
msgid "Template file not found"
msgstr "Vorlagenndatei nicht gefunden"
-#: install/functions/NagInstallClass.php:336
-#: install/functions/NagInstallClass.php:368
+#: install/functions/NagInstallClass.php:182
+#: install/functions/NagInstallClass.php:214
msgid "passed"
msgstr "funktioniert"
# prepend.adm
-#: install/functions/NagInstallClass.php:358
+#: install/functions/NagInstallClass.php:204
msgid "Error while connecting to database:"
msgstr "Fehler beim Verbinden mit der Datenbank:"
-#: install/functions/NagInstallClass.php:399
-#: install/functions/NagInstallClass.php:474
+#: install/functions/NagInstallClass.php:245
+#: install/functions/NagInstallClass.php:318
msgid "supported"
msgstr "unterstützt"
-#: install/functions/NagInstallClass.php:401
+#: install/functions/NagInstallClass.php:247
msgid "not supported"
msgstr "nicht unterstützt"
-#: install/functions/NagInstallClass.php:477
+#: install/functions/NagInstallClass.php:321
msgid ""
"Your NagiosQL installation is up to date - no further actions are needed!"
msgstr ""
"Ihre NagiosQL Installation ist aktuell - es sind keine weiteren Schritte "
"notwendig!"
-#: install/functions/NagInstallClass.php:483
-#: install/functions/NagInstallClass.php:491
+#: install/functions/NagInstallClass.php:327
+#: install/functions/NagInstallClass.php:335
msgid ""
"Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and "
"above!"
@@ -3447,98 +3492,98 @@ msgstr ""
"3.0 unterstützt!"
# prepend.adm
-#: install/functions/NagInstallClass.php:489
+#: install/functions/NagInstallClass.php:333
msgid "Error while selecting settings table."
msgstr "Fehler bei Abrufen der Einstellungstabelle."
-#: install/functions/NagInstallClass.php:511
-#: install/functions/NagInstallClass.php:547
-#: install/functions/NagInstallClass.php:610
-#: install/functions/NagInstallClass.php:614
-#: install/functions/NagInstallClass.php:655
-#: install/functions/NagInstallClass.php:736
-#: install/functions/NagInstallClass.php:819
-#: install/functions/NagInstallClass.php:870
-#: install/functions/NagInstallClass.php:935
-#: install/functions/NagInstallClass.php:945
-#: install/functions/NagInstallClass.php:967
-#: install/functions/NagInstallClass.php:1015
-#: install/functions/NagInstallClass.php:1067
+#: install/functions/NagInstallClass.php:355
+#: install/functions/NagInstallClass.php:391
+#: install/functions/NagInstallClass.php:454
+#: install/functions/NagInstallClass.php:458
+#: install/functions/NagInstallClass.php:500
+#: install/functions/NagInstallClass.php:580
+#: install/functions/NagInstallClass.php:660
+#: install/functions/NagInstallClass.php:712
+#: install/functions/NagInstallClass.php:777
+#: install/functions/NagInstallClass.php:787
+#: install/functions/NagInstallClass.php:809
+#: install/functions/NagInstallClass.php:858
+#: install/functions/NagInstallClass.php:910
msgid "done"
msgstr "erledigt"
-#: install/functions/NagInstallClass.php:538
+#: install/functions/NagInstallClass.php:382
msgid "Unsupported database type."
msgstr "Nicht unterstützter Datenbanktyp."
-#: install/functions/NagInstallClass.php:611
+#: install/functions/NagInstallClass.php:455
msgid "Only added rights to existing user"
msgstr "Nur Rechte zum bestehenden Benutzer hinzugefügt"
# mutdialog.php
-#: install/functions/NagInstallClass.php:641
+#: install/functions/NagInstallClass.php:486
msgid "No SQL update files available"
msgstr "Keine SQL Updatedateien verfügbar"
-#: install/functions/NagInstallClass.php:650
-#: install/functions/NagInstallClass.php:707
+#: install/functions/NagInstallClass.php:495
+#: install/functions/NagInstallClass.php:552
msgid "SQL file is not readable or empty"
msgstr "SQL Datei nicht lesbar oder leer"
-#: install/functions/NagInstallClass.php:778
-#: install/functions/NagInstallClass.php:785
-#: install/functions/NagInstallClass.php:813
+#: install/functions/NagInstallClass.php:619
+#: install/functions/NagInstallClass.php:626
+#: install/functions/NagInstallClass.php:653
msgid "Inserting initial data to settings database has failed:"
msgstr ""
"Das Einfügen der Vorgabewerte in die Einstellungstabelle ist fehlgeschlagen:"
-#: install/functions/NagInstallClass.php:873
-msgid "Connot open/write to config/settings.php"
+#: install/functions/NagInstallClass.php:715
+msgid "Cannot open/write to config/settings.php"
msgstr ""
"Kann die Konfigurationsdatei nicht öffnen/beschreiben (config/settings.php)"
-#: install/functions/NagInstallClass.php:905
+#: install/functions/NagInstallClass.php:747
msgid "Inserting path data to database has failed:"
msgstr "Das Einfügen der Verzeichnisdaten in die Datenbank ist fehlgeschlagen:"
-#: install/functions/NagInstallClass.php:936
+#: install/functions/NagInstallClass.php:778
msgid "Check the permissions of the created paths!"
msgstr "Überprüfen Sie die Rechte der Verzeichnisse!"
-#: install/functions/NagInstallClass.php:939
+#: install/functions/NagInstallClass.php:781
msgid "NagiosQL config path is not writeable - only database values updated"
msgstr ""
"NagiosQL Konfigurationsverzeichnis ist nicht beschreibbar - es wurden nur "
"die Datenbankwerte eingetragen"
# prepend.adm
-#: install/functions/NagInstallClass.php:969
-#: install/functions/NagInstallClass.php:1017
-#: install/functions/NagInstallClass.php:1069
+#: install/functions/NagInstallClass.php:811
+#: install/functions/NagInstallClass.php:860
+#: install/functions/NagInstallClass.php:912
msgid "Database errors while converting to utf-8:"
msgstr "Datenbankfehler während dem Konvertieren nach UTF-8:"
-#: install/functions/NagInstallClass.php:1008
-#: install/functions/NagInstallClass.php:1060 install/step3.php:88
-#: install/step3.php:177
+#: install/functions/NagInstallClass.php:851
+#: install/functions/NagInstallClass.php:903 install/step3.php:96
+#: install/step3.php:185
msgid "Database type not defined!"
msgstr "Datenbanktyp nicht definiert!"
-#: install/index.php:69
+#: install/index.php:74
msgid "Online Documentation"
msgstr "Online Handbuch"
-#: install/index.php:115
+#: install/index.php:119
msgid "Database connection failed. Upgrade not available!"
msgstr "Datenbankverbindung fehlgeschlagen. Upgrade ist nicht verfügbar!"
-#: install/index.php:122
+#: install/index.php:126
msgid "Settings table not available or wrong. Upgrade not available!"
msgstr ""
"Einstellungstabelle nicht vorhanden oder fehlerhaft. Das Upgrade ist nicht "
"verfügbar!"
-#: install/index.php:133
+#: install/index.php:137
msgid ""
"Invalid database type in settings file (config/settings.php). Upgrade not "
"available!"
@@ -3546,7 +3591,7 @@ msgstr ""
"Datenbanktyp in der Konfigurationsdatei ist ungültig (config/settings.php). "
"Upgrade nicht verfügbar!"
-#: install/index.php:137
+#: install/index.php:141
msgid ""
"Database values in settings file are missing (config/settings.php). Upgrade "
"not available!"
@@ -3554,7 +3599,7 @@ msgstr ""
"Datenbankeinstellungen in der Konfigurationsdatei nicht gefunden (config/"
"settings.php). Upgrade nicht verfügbar!"
-#: install/index.php:141
+#: install/index.php:145
msgid ""
"Settings file not found or not readable (config/settings.php). Upgrade not "
"available!"
@@ -3562,7 +3607,7 @@ msgstr ""
"Konfigurationsdatei nicht gefunden oder nicht lesbar (config/settings.php). "
"Upgrade ist nicht verfügbar!"
-#: install/index.php:152
+#: install/index.php:156
msgid ""
"Default values file is not available or not readable (install/functions/"
"initial_settings.php). Installation possible, but without predefined data!"
@@ -3571,24 +3616,24 @@ msgstr ""
"gelesen werden (install/functions/initial_settings.php). Die Installation "
"ist möglich, aber ohne Standardwertvorgaben!"
-#: install/index.php:159
+#: install/index.php:162
msgid "Installation wizard"
msgstr "Installationsassistent"
-#: install/index.php:160
+#: install/index.php:163
msgid "Welcome to the NagiosQL installation wizard"
msgstr "Willkommen zum NagiosQL Installations Assistenten"
-#: install/index.php:161
+#: install/index.php:164
msgid "This wizard will help you to install and configure NagiosQL."
msgstr ""
"Dieser Assistent hilft Ihnen NagiosQL zu installieren und zu konfigurieren."
-#: install/index.php:163
+#: install/index.php:165
msgid "For questions please visit"
msgstr "Für Rückfragen besuchen Sie bitte"
-#: install/index.php:164
+#: install/index.php:166
msgid ""
"First let's check your local environment and find out if everything NagiosQL "
"needs is available."
@@ -3596,122 +3641,126 @@ msgstr ""
"Zuerst prüfen wir die lokale Umgebung und schauen ob NagiosQL alles findet "
"was es benötigt."
-#: install/index.php:166
+#: install/index.php:167
msgid "The basic requirements are:"
msgstr "Die wichtigsten Voraussetzungen sind:"
-#: install/index.php:167
-msgid "PHP 5.5.0 or greater including:"
-msgstr "PHP 5.5.0 oder größer, inklusive:"
-
#: install/index.php:168
+msgid "PHP 7.2.0 or above (PHP 8 is recommended) including:"
+msgstr "PHP 7.2.0 oder höher (PHP8 ist empfohlen) - inklusive:"
+
+#: install/index.php:169
msgid "PHP database module:"
msgstr "PHP Datenbank Modul:"
-#: install/index.php:169
+#: install/index.php:170
msgid "supported types are"
msgstr "unterstützte Typen sind"
-#: install/index.php:174 install/index.php:176
+#: install/index.php:175 install/index.php:177
msgid "(optional)"
msgstr "(optional)"
-#: install/index.php:175
+#: install/index.php:176
msgid "PECL extension:"
msgstr "PECL Erweiterung:"
-#: install/index.php:177
+#: install/index.php:178
msgid "php.ini options"
msgstr "php.ini Einstellungen"
-#: install/index.php:178
+#: install/index.php:179
msgid "file_uploads on (for upload features)"
msgstr "file_uploads on (für Upload Unterstützung)"
-#: install/index.php:179
+#: install/index.php:180
msgid "session.auto_start needs to be off"
msgstr "session.auto_start sollte auf \"off\" stehen"
-#: install/index.php:180
+#: install/index.php:181
+msgid "date.timezone should be set to your local timezone"
+msgstr "date.timezone sollte passend zur lokalen Zeitzone eingestellt sein"
+
+#: install/index.php:182
msgid "A database server"
msgstr "Ein Datenbankserver"
-#: install/index.php:181
+#: install/index.php:183
msgid "Nagios 2.x/3.x/4.x"
msgstr "Nagios 2.x/3.x/4.x"
-#: install/index.php:182
+#: install/index.php:184
msgid "NagiosQL version"
msgstr "NagiosQL Version"
-#: install/index.php:184
+#: install/index.php:186
msgid "Online documentation"
msgstr "Online Handbuch"
-#: install/index.php:188
+#: install/index.php:190
msgid "START INSTALLATION"
msgstr "STARTE NEUINSTALLTION"
-#: install/index.php:189
+#: install/index.php:191
msgid "START UPDATE"
msgstr "STARTE AKTUALISIERUNG"
-#: install/install.php:214
+#: install/install.php:196
msgid "Welcome to the NagiosQL Installation Wizard"
msgstr "Willkommen zum NagiosQL Installations Assistenten"
-#: install/step1.php:74 install/step2.php:34 install/step3.php:38
+#: install/step1.php:79 install/step2.php:39 install/step3.php:47
msgid "Requirements"
msgstr "Voraussetzungen"
-#: install/step1.php:75 install/step1.php:77 install/step2.php:35
-#: install/step2.php:37 install/step3.php:39 install/step3.php:41
+#: install/step1.php:80 install/step1.php:82 install/step2.php:40
+#: install/step2.php:42 install/step3.php:48 install/step3.php:50
msgid "Installation"
msgstr "Installation"
-#: install/step1.php:76 install/step2.php:36 install/step3.php:40
-#: install/step3.php:301
+#: install/step1.php:81 install/step2.php:41 install/step3.php:49
+#: install/step3.php:308
msgid "Finish"
msgstr "Ende"
-#: install/step1.php:78
+#: install/step1.php:83
msgid "Checking requirements"
msgstr "Überprüfe Voraussetzungen"
-#: install/step1.php:79
+#: install/step1.php:84
msgid "Checking Client"
msgstr "Überprüfe Client"
-#: install/step1.php:80
+#: install/step1.php:85
msgid "Checking PHP version"
msgstr "Überprüfe PHP Version"
-#: install/step1.php:81
+#: install/step1.php:86
msgid "Checking PHP extensions"
msgstr "Überprüfe die PHP Erweiterungen"
-#: install/step1.php:82
+#: install/step1.php:87
msgid "Checking available database interfaces"
msgstr "Überprüfe vorhandene Datenbankschnittstellen"
-#: install/step1.php:83
+#: install/step1.php:88
msgid "Checking php.ini/.htaccess settings"
msgstr "Überprüfe php.ini/.htaccess Einstellungen"
-#: install/step1.php:84
+#: install/step1.php:89
msgid "Checking System Permission"
msgstr "Überprüfe Systemberechtigungen"
-#: install/step1.php:85
+#: install/step1.php:90
msgid "The following modules/extensions are required to run NagiosQL"
msgstr ""
"Die folgenden Module/Erweiterungen sind notwendig für NagiosQL"
-#: install/step1.php:87
+#: install/step1.php:91
msgid "The next couple of extensions are optional but recommended"
msgstr "Die nächsten Erweiterungen sind optional aber empfohlen"
-#: install/step1.php:89
+#: install/step1.php:92
msgid ""
"Check which of the supported extensions are installed. At least one of them "
"is required."
@@ -3719,19 +3768,19 @@ msgstr ""
"Überprüfe welche der unterstützten Erweiterungen installiert sind. "
"Wenigstens eine ist notwendig."
-#: install/step1.php:91
+#: install/step1.php:93
msgid "The following settings are required to run NagiosQL"
msgstr "Die folgenden Einstellungen sind notwendig für NagiosQL"
-#: install/step1.php:109
+#: install/step1.php:110
msgid "ENABLED"
msgstr "AKTIVIERT"
-#: install/step1.php:114
+#: install/step1.php:115
msgid "NOT ENABLED"
msgstr "NICHT EINGESCHALTET"
-#: install/step1.php:115
+#: install/step1.php:116
msgid ""
"After enabling Javascript, the page must be updated twice so that the status "
"changes"
@@ -3739,36 +3788,37 @@ msgstr ""
"Nach dem einschalten von JavaScript muss die Seite zweimal neu geladen "
"werden sodass die Statusänderung"
-#: install/step1.php:120
+#: install/step1.php:121
msgid "Version"
msgstr "Version"
-#: install/step1.php:124 install/step1.php:140 install/step1.php:155
-#: install/step1.php:180 install/step1.php:208 install/step1.php:212
-#: install/step1.php:226 install/step1.php:236 install/step1.php:239
-#: install/step1.php:252 install/step1.php:261 install/step1.php:270
-#: install/step1.php:279 install/step1.php:288 install/step1.php:297
+#: install/step1.php:125 install/step1.php:149 install/step1.php:159
+#: install/step1.php:174 install/step1.php:199 install/step1.php:227
+#: install/step1.php:230 install/step1.php:243 install/step1.php:253
+#: install/step1.php:256 install/step1.php:269 install/step1.php:278
+#: install/step1.php:287 install/step1.php:296 install/step1.php:305
+#: install/step1.php:314
msgid "OK"
msgstr "OK"
-#: install/step1.php:125 install/step1.php:129
+#: install/step1.php:126 install/step1.php:130
msgid "detected"
msgstr "erkannt"
-#: install/step1.php:130
+#: install/step1.php:131
msgid "or greater is required"
msgstr "oder größer ist notwendig"
-#: install/step1.php:143 install/step1.php:158 install/step1.php:187
-msgid "Could be loaded. Please add in php.ini"
-msgstr "Kann geladen werden. Bitte zur php.ini hinzufügen"
-
-#: install/step1.php:145 install/step1.php:160 install/step1.php:189
-#: install/step1.php:204
+#: install/step1.php:152 install/step1.php:164 install/step1.php:179
+#: install/step1.php:208 install/step1.php:223
msgid "NOT AVAILABLE"
msgstr "NICHT VERFÜGBAR"
-#: install/step1.php:177
+#: install/step1.php:162 install/step1.php:177 install/step1.php:206
+msgid "Could be loaded. Please add in php.ini"
+msgstr "Kann geladen werden. Bitte zur php.ini hinzufügen"
+
+#: install/step1.php:196
msgid ""
"New installation only - updates are only supported using the same database "
"interface!"
@@ -3776,59 +3826,59 @@ msgstr ""
"Nur Neuinstallation möglich - Upgrades werden nur bei gleichbleibendem "
"Datenbankinterface unterstützt!"
-#: install/step1.php:205
+#: install/step1.php:224
msgid "cannot be empty and needs to be set"
msgstr "Kann nicht leer sein und muss gesetzt werden"
-#: install/step1.php:214
+#: install/step1.php:232
msgid "should be"
msgstr "Sollte auf"
-#: install/step1.php:225 install/step1.php:228
+#: install/step1.php:242 install/step1.php:245
msgid "Read test on settings file (config/settings.php)"
msgstr "Lesezugriff auf die Konfigurationsdatei (config/settings.php)"
-#: install/step1.php:231
+#: install/step1.php:248
msgid "Settings file does not exists (config/settings.php)"
msgstr "Konfigurationsdatei existiert nicht (config/settings.php)"
-#: install/step1.php:232
+#: install/step1.php:249
msgid "will be created"
msgstr "wird später erstellt"
-#: install/step1.php:235 install/step1.php:241
+#: install/step1.php:252 install/step1.php:258
msgid "Write test on settings file (config/settings.php)"
msgstr "Schreibzugriff auf die Konfigurationsdatei (config/settings.php)"
-#: install/step1.php:238 install/step1.php:245
+#: install/step1.php:255 install/step1.php:262
msgid "Write test on settings directory (config/)"
msgstr "Schreibzugriff auf das Konfigurationsverzeichnis (config/)"
-#: install/step1.php:251 install/step1.php:254
+#: install/step1.php:268 install/step1.php:271
msgid "Read test on one class file (functions/NagVisualClass.php)"
msgstr "Lesezugriff auf eine Klassendatei (functions/NagVisualClass.php)"
-#: install/step1.php:260 install/step1.php:263
+#: install/step1.php:277 install/step1.php:280
msgid "Read test on home page file (admin.php)"
msgstr "Lesezugriff auf die Startseite (admin.php)"
-#: install/step1.php:269 install/step1.php:272
+#: install/step1.php:286 install/step1.php:289
msgid "Read test on one template file (templates/index.tpl.htm)"
msgstr "Lesezugriff auf eine Template Datei (templates/index.tpl.htm)"
-#: install/step1.php:278 install/step1.php:281
+#: install/step1.php:295 install/step1.php:298
msgid "Read test on one admin template file (templates/admin/datalist.htm.tpl)"
msgstr "Lesezugriff auf ein Admin-Template (templates/admin/datalist.htm.tpl)"
-#: install/step1.php:287 install/step1.php:290
+#: install/step1.php:304 install/step1.php:307
msgid "Read test on one file template (templates/files/contacts.tpl.dat)"
msgstr "Lesezugriff auf ein File-Template (templates/files/contacts.tpl.da)"
-#: install/step1.php:296 install/step1.php:299
+#: install/step1.php:313 install/step1.php:316
msgid "Read test on one image file (images/pixel.gif)"
msgstr "Lesezugriff auf ein Bild (images/pixel.gif)"
-#: install/step1.php:304
+#: install/step1.php:321
msgid ""
"There are some errors - please check your system settings and read the "
"requirements of NagiosQL!"
@@ -3836,7 +3886,7 @@ msgstr ""
"Es sind Fehler aufgetreten. Bitte überprüfen Sie die Einstellungen und lesen "
"Sie die Dokumentation über die Systemanforderungen!"
-#: install/step1.php:306
+#: install/step1.php:323
msgid ""
"Read the INSTALLATION file in the NagiosQL doc directory or the installation "
"PDF file on our"
@@ -3844,125 +3894,125 @@ msgstr ""
"Lesen sie die INSTALLATION Datei im Nagiosql doc Verzeichnis oder die "
"Installation PDF Datei von unserer"
-#: install/step1.php:310
+#: install/step1.php:327
msgid "online documentation"
msgstr "Online Handbuch"
-#: install/step1.php:311
+#: install/step1.php:328
msgid "site to find out, how to fix them."
msgstr "Webseite um herauszufinden, wie dies zu beheben ist."
-#: install/step1.php:312
+#: install/step1.php:329
msgid "After that - refresh this page to proceed"
msgstr "Nach Änderungen aktualisieren Sie bitte diese Seite um fortzufahren"
-#: install/step1.php:316
+#: install/step1.php:333
msgid "Refresh"
msgstr "Aktualisieren"
-#: install/step1.php:318
+#: install/step1.php:335
msgid "Environment test completed successfully"
msgstr "Umgebungstest erfolgreich abgeschlossen"
-#: install/step1.php:323 install/step2.php:94
+#: install/step1.php:340 install/step2.php:99
msgid "Next"
msgstr "Weiter"
-#: install/step2.php:32
+#: install/step2.php:37
msgid "The NagiosQL first passwords are not equal!"
msgstr "Die NagiosQL Administrationspasswörter sind nicht gleich!"
-#: install/step2.php:38
+#: install/step2.php:43
msgid "Setup"
msgstr "Einrichtung"
-#: install/step2.php:39
+#: install/step2.php:44
msgid "Please complete the form below. Mandatory fields marked *"
msgstr ""
"Bitte vervollständigen Sie das u.a. Formular. Pflichtfelder sind mit einem "
"* markiert"
-#: install/step2.php:41
+#: install/step2.php:46
msgid "Database Configuration"
msgstr "Datenbank Konfiguration"
-#: install/step2.php:42
+#: install/step2.php:47
msgid "Database Type"
msgstr "Datenbanktyp"
-#: install/step2.php:56
+#: install/step2.php:61
msgid "Database Server"
msgstr "Datenbankserver"
-#: install/step2.php:58
+#: install/step2.php:63
msgid "Local hostname or IP address"
msgstr "Lokaler Hostname oder IP-Adresse"
-#: install/step2.php:64
+#: install/step2.php:69
msgid "Database Server Port"
msgstr "Datenbankserver Port"
-#: install/step2.php:68
+#: install/step2.php:73
msgid "NagiosQL DB User"
msgstr "NagiosQL Datenbank Benutzer"
-#: install/step2.php:70
+#: install/step2.php:75
msgid "NagiosQL DB Password"
msgstr "NagiosQL Datenbank Passwort"
-#: install/step2.php:72
+#: install/step2.php:77
msgid "Administrative Database User"
msgstr "Administrativer Datenbankbenutzer"
-#: install/step2.php:74
+#: install/step2.php:79
msgid "Administrative Database Password"
msgstr "Administratives Datenbankpasswort"
-#: install/step2.php:75
+#: install/step2.php:80
msgid "Drop database if already exists?"
msgstr "Lösche Datenbank, sofern sie bereits existiert?"
-#: install/step2.php:81
+#: install/step2.php:86
msgid "NagiosQL User Setup"
msgstr "NagiosQL Benutzer Einrichtung"
-#: install/step2.php:82
+#: install/step2.php:87
msgid "Initial NagiosQL User"
msgstr "Erster NagiosQL Benutzer"
-#: install/step2.php:84
+#: install/step2.php:89
msgid "Initial NagiosQL Password"
msgstr "Erstes NagiosQL Passwort"
-#: install/step2.php:86
+#: install/step2.php:91
msgid "Please repeat the password"
msgstr "Bitte Passwort wiederholen"
-#: install/step2.php:87
+#: install/step2.php:92
msgid "Nagios Configuration"
msgstr "Nagios Konfiguration"
-#: install/step2.php:88
+#: install/step2.php:93
msgid "Import Nagios sample config?"
msgstr "Importiere Nagios Beispiel Konfiguration?"
-#: install/step2.php:95
+#: install/step2.php:100
msgid "NagiosQL path values"
msgstr "NagiosQL Verzeichnisdaten"
-#: install/step2.php:96
+#: install/step2.php:101
msgid "Create NagiosQL config paths?"
msgstr "Erstelle NagiosQL Verzeichnisse?"
-#: install/step2.php:102
+#: install/step2.php:107
msgid "NagiosQL config path"
msgstr "NagiosQL Konfigurationsverzeichnis"
-#: install/step2.php:104
+#: install/step2.php:109
msgid "Nagios config path"
msgstr "Nagios Konfigurationsverzeichnis"
-#: install/step2.php:106
+#: install/step2.php:111
msgid ""
"Both path values were stored in your configuration target settings for "
"localhost."
@@ -3970,7 +4020,7 @@ msgstr ""
"Beide Verzeichnisdefinitionen werden in der Datenbank beim "
"Konfigurationsziel \"localhost\" eingetragen."
-#: install/step2.php:108
+#: install/step2.php:113
msgid ""
"If you select the create path option, be sure that the NagiosQL base path "
"exist and the webserver demon has write access to it. So the installer will "
@@ -3983,103 +4033,103 @@ msgstr ""
"benötigten Unterverzeichnisse im Dateisystem von \"localhost\" erstellen "
"(hosts, services, backup etc.)"
-#: install/step2.php:120
+#: install/step2.php:125
msgid "Please backup your database before proceeding!"
msgstr "Bitte sichern Sie Ihre Datenbank bevor Sie fortfahren!"
-#: install/step3.php:42
+#: install/step3.php:51
msgid "Finishing Setup"
msgstr "Fertigstellen"
-#: install/step3.php:44
+#: install/step3.php:53
msgid "Deploy NagiosQL settings"
msgstr "Setze NagiosQL Einstellungen"
-#: install/step3.php:45
+#: install/step3.php:54
msgid "Database server connection (privileged user)"
msgstr "Datenbankserver Verbindung (privilegierter Benutzer)"
-#: install/step3.php:46
+#: install/step3.php:55
msgid "Database server version"
msgstr "Datenbankserver Version"
-#: install/step3.php:47
+#: install/step3.php:56
msgid "Database server support"
msgstr "Datenbankserver Unterstützung"
-#: install/step3.php:48
+#: install/step3.php:57
msgid "Delete existing NagiosQL database"
msgstr "Bestehende NagiosQL 3 Datenbank löschen"
-#: install/step3.php:49
+#: install/step3.php:58
msgid "Creating new database"
msgstr "Erstelle neue Datenbank"
-#: install/step3.php:50
+#: install/step3.php:59
msgid "Installing NagiosQL database tables"
msgstr "Installiere NagiosQL Datenbanktabellen"
-#: install/step3.php:51
+#: install/step3.php:60
msgid "Create NagiosQL database user"
msgstr "Erstelle NagiosQL Datenbankbenutzer"
-#: install/step3.php:52
+#: install/step3.php:61
msgid "Set initial NagiosQL Administrator"
msgstr "Setze den NagiosQL Administrator"
-#: install/step3.php:53
+#: install/step3.php:62
msgid "Database server connection (NagiosQL user)"
msgstr "Datenbankserver Verbindung (NagiosQL Benutzer)"
-#: install/step3.php:54
+#: install/step3.php:63
msgid "Writing global settings to database"
msgstr "Schreiben der Einstellungen in die Datenbank"
-#: install/step3.php:55
+#: install/step3.php:64
msgid "Writing database configuration to settings.php"
msgstr "Schreibe Datenbank Konfiguration in settings.php"
-#: install/step3.php:56
+#: install/step3.php:65
msgid "Import Nagios sample data"
msgstr "Import Nagios Beispiel Daten"
-#: install/step3.php:57
+#: install/step3.php:66
msgid "Create and/or store NagiosQL path settings"
msgstr "Erstelle und/oder speichere NagiosQL Verzeichnisse"
-#: install/step3.php:80
+#: install/step3.php:88
msgid "Updating existing NagiosQL database"
msgstr "Aktualisiere bestehende NagiosQL Datenbank"
-#: install/step3.php:113
+#: install/step3.php:121
msgid "Installed NagiosQL version"
msgstr "Installierte NagiosQL Version"
-#: install/step3.php:124
+#: install/step3.php:132
msgid "Upgrading from version"
msgstr "Aktualisiere von Version"
-#: install/step3.php:125
+#: install/step3.php:133
msgid "to"
msgstr "nach"
-#: install/step3.php:132
+#: install/step3.php:140
msgid "Converting database to utf8 character set"
msgstr "Konvertiere Datenbank zu UTF8"
-#: install/step3.php:138
+#: install/step3.php:146
msgid "Converting database tables to utf8 character set"
msgstr "Konvertiere Datenbanktabellen zu UTF8"
-#: install/step3.php:145
+#: install/step3.php:153
msgid "Converting database fields to utf8 character set"
msgstr "Konvertiere Datenbankfelder zu UTF8"
-#: install/step3.php:169
+#: install/step3.php:177
msgid "Create new NagiosQL database"
msgstr "Erstelle NagiosQL MySQL Benutzer"
-#: install/step3.php:202
+#: install/step3.php:210
msgid ""
"Database already exists and drop database was not selected, please correct "
"or manage manually"
@@ -4087,18 +4137,26 @@ msgstr ""
"Die Datenbank existiert bereits und das Löschen der Datenbank wurde nicht "
"ausgewählt. Bitte beheben Sie das Problem"
-#: install/step3.php:218
+#: install/step3.php:226
msgid "unknown"
msgstr "unbekannt"
-#: install/step3.php:293
+#: install/step3.php:301
msgid "Back"
msgstr "Zurück"
-#: install/step3.php:298
+#: install/step3.php:305
msgid "Please delete the install directory to continue!"
msgstr "Bitte löschen Sie den Installationsordner bevor Sie fortfahren!"
+#~ msgid "Restart failed - Nagios daemon was not running"
+#~ msgstr "Neustart fehlgeschlagen - Der Nagios Dienst lief nicht"
+
+#~ msgid "Nagios daemon is not running, cannot send restart command!"
+#~ msgstr ""
+#~ "Der Nagios Dienst läuft nicht, die Aufforderung zum Neustart konnte nicht "
+#~ "gesendet werden!"
+
#~ msgid "Cgi config file"
#~ msgstr "CGI Konfigurationsdatei"
@@ -4235,9 +4293,6 @@ msgstr "Bitte löschen Sie den Installationsordner bevor Sie fortfahren!"
#~ "Konfigurationsdatei konnte nicht geschrieben werden (FTP Verbindung "
#~ "fehlgeschlagen)"
-#~ msgid "Missing MySQL SSL parameter!"
-#~ msgstr "Fehlende SSL Parameter für die Serververbindung!"
-
#~ msgid ""
#~ "Installation cannot continue, please make sure you have the mysql "
#~ "extension loaded!"
diff --git a/config/locale/en_GB/LC_MESSAGES/en_GB.mo b/config/locale/en_GB/LC_MESSAGES/en_GB.mo
index 4c182a7..85d8bf6 100644
Binary files a/config/locale/en_GB/LC_MESSAGES/en_GB.mo and b/config/locale/en_GB/LC_MESSAGES/en_GB.mo differ
diff --git a/config/locale/en_GB/LC_MESSAGES/en_GB.po b/config/locale/en_GB/LC_MESSAGES/en_GB.po
index 5fa21cb..bfbd78d 100644
--- a/config/locale/en_GB/LC_MESSAGES/en_GB.po
+++ b/config/locale/en_GB/LC_MESSAGES/en_GB.po
@@ -3,16 +3,16 @@
# # Project : NagiosQL
# # Component : Translation File English
# # Website : https://sourceforge.net/projects/nagiosql/
-# # Version : 3.4.0
+# # Version : 3.5.0
# # GIT Repo : https://gitlab.com/wizonet/NagiosQL
# #
# #############################################################################
msgid ""
msgstr ""
-"Project-Id-Version: NagiosQL 3.4.0\n"
+"Project-Id-Version: NagiosQL 3.5.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2018-05-07 15:58+0200\n"
-"PO-Revision-Date: 2018-05-07 15:59+0200\n"
+"POT-Creation-Date: 2023-01-20 15:07+0100\n"
+"PO-Revision-Date: 2023-01-20 15:09+0100\n"
"Last-Translator: \n"
"Language-Team: NagiosQL\n"
"Language: en_GB\n"
@@ -20,7 +20,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 2.0.6\n"
+"X-Generator: Poedit 3.2.2\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-Basepath: ../../../..\n"
"X-Poedit-KeywordsList: translate\n"
@@ -29,11 +29,11 @@ msgstr ""
"X-Poedit-SearchPathExcluded-1: functions/tinyMCE\n"
"X-Poedit-SearchPathExcluded-2: _archive\n"
-#: admin.php:37
+#: admin.php:40
msgid "NagiosQL Administration"
msgstr "NagiosQL Administration"
-#: admin.php:40
+#: admin.php:43
msgid ""
"Welcome to NagiosQL, the administration module that can be used to easily "
"create, modify and delete configuration files for Nagios. The data is stored "
@@ -45,22 +45,22 @@ msgstr ""
"in a database and can be written directly to the standard files at any time "
"you want."
-#: admin/administration.php:35 config/fieldvars.php:298
-#: functions/prepend_adm.php:460 functions/prepend_adm.php:469
+#: admin/administration.php:37 config/fieldvars.php:302
+#: functions/prepend_adm.php:459 functions/prepend_adm.php:466
msgid "Administration"
msgstr "Administration"
# administration.php
-#: admin/administration.php:38
+#: admin/administration.php:40
msgid "Functions to administrate NagiosQL V3"
msgstr "Functions to administrate NagiosQL V3"
-#: admin/alarming.php:35 config/fieldvars.php:293 config/fieldvars.php:294
+#: admin/alarming.php:44 config/fieldvars.php:297 config/fieldvars.php:298
msgid "Alarming"
msgstr "Alerting"
# alarming.php
-#: admin/alarming.php:36
+#: admin/alarming.php:45
msgid ""
"To define contact data, contact templates and contact groups and time "
"periods."
@@ -68,63 +68,63 @@ msgstr ""
"To define contact data, contact templates and contact groups and time "
"periods."
-#: admin/alarming.php:38 admin/commands.php:38 admin/monitoring.php:40
-#: admin/specials.php:40
+#: admin/alarming.php:47 admin/commands.php:47 admin/monitoring.php:49
+#: admin/specials.php:49
msgid "Statistical datas"
msgstr "Statistical data"
-#: admin/alarming.php:39 admin/commands.php:39 admin/monitoring.php:41
-#: admin/specials.php:41
+#: admin/alarming.php:48 admin/commands.php:48 admin/monitoring.php:50
+#: admin/specials.php:50
msgid "Group"
msgstr "Group"
-#: admin/alarming.php:40 admin/commands.php:40 admin/monitoring.php:42
-#: admin/specials.php:42 config/fieldvars.php:55
+#: admin/alarming.php:49 admin/commands.php:49 admin/monitoring.php:51
+#: admin/specials.php:51 config/fieldvars.php:56
msgid "Active"
msgstr "Active"
-#: admin/alarming.php:41 admin/commands.php:41 admin/monitoring.php:43
-#: admin/specials.php:43
+#: admin/alarming.php:50 admin/commands.php:50 admin/monitoring.php:52
+#: admin/specials.php:52
msgid "Inactive"
msgstr "Inactive"
-#: admin/alarming.php:52 config/fieldvars.php:303
+#: admin/alarming.php:61 config/fieldvars.php:307
msgid "Contact data"
msgstr "Contact data"
-#: admin/alarming.php:60 config/fieldvars.php:156 config/fieldvars.php:304
+#: admin/alarming.php:69 config/fieldvars.php:159 config/fieldvars.php:308
msgid "Contact groups"
msgstr "Contact groups"
-#: admin/alarming.php:68 config/fieldvars.php:301
+#: admin/alarming.php:77 config/fieldvars.php:305
msgid "Time periods"
msgstr "Time periods"
-#: admin/alarming.php:76 config/fieldvars.php:330
+#: admin/alarming.php:85 config/fieldvars.php:334
msgid "Contact templates"
msgstr "Contact templates"
-#: admin/cgicfg.php:65 admin/cgicfg.php:87 admin/nagioscfg.php:65
-#: admin/nagioscfg.php:87 admin/verify.php:63 admin/verify.php:85
-#: functions/NagConfigClass.php:2107
+#: admin/cgicfg.php:85 admin/cgicfg.php:107 admin/nagioscfg.php:82
+#: admin/nagioscfg.php:104 admin/verify.php:87 admin/verify.php:109
+#: functions/NagConfigClass.php:2432
msgid "Configuration file successfully written!"
msgstr "Configuration file successfully written!"
-#: admin/cgicfg.php:67 admin/cgicfg.php:89 admin/nagioscfg.php:67
-#: admin/nagioscfg.php:89 functions/NagConfigClass.php:2106
+#: admin/cgicfg.php:87 admin/cgicfg.php:109 admin/nagioscfg.php:84
+#: admin/nagioscfg.php:106 functions/NagConfigClass.php:2431
msgid "Configuration successfully written:"
msgstr "Configuration successfully written:"
-#: admin/cgicfg.php:69 admin/nagioscfg.php:69 admin/verify.php:65
-#: admin/verify.php:87 functions/NagConfigClass.php:1993
+#: admin/cgicfg.php:89 admin/nagioscfg.php:86 admin/verify.php:89
+#: admin/verify.php:111 functions/NagConfigClass.php:2195
msgid "Cannot open/overwrite the configuration file (check the permissions)!"
msgstr "Cannot open/overwrite the configuration file (check the permissions)!"
-#: admin/cgicfg.php:71 admin/nagioscfg.php:71 functions/NagConfigClass.php:1992
+#: admin/cgicfg.php:91 admin/nagioscfg.php:88 functions/NagConfigClass.php:2194
msgid "Configuration write failed:"
msgstr "Configuration write failed:"
-#: admin/cgicfg.php:92 admin/nagioscfg.php:92
+#: admin/cgicfg.php:111 admin/nagioscfg.php:108
msgid ""
"Cannot open/overwrite the configuration file (check the permissions on "
"remote system)!"
@@ -132,11 +132,11 @@ msgstr ""
"Cannot open/overwrite the configuration file (check the permissions on "
"remote system)!"
-#: admin/cgicfg.php:94 admin/nagioscfg.php:94
+#: admin/cgicfg.php:113 admin/nagioscfg.php:110
msgid "Configuration write failed (remote):"
msgstr "Configuration write failed (remote):"
-#: admin/cgicfg.php:99 admin/nagioscfg.php:99
+#: admin/cgicfg.php:118 admin/nagioscfg.php:115
msgid ""
"There are no nagios configuration files in common domain, please select a "
"valid domain to edit this files!"
@@ -144,139 +144,139 @@ msgstr ""
"There are no nagios configuration files in common domain, please select a "
"valid domain to edit this files!"
-#: admin/cgicfg.php:105
+#: admin/cgicfg.php:124
msgid "CGI configuration file"
msgstr "CGI configuration file"
-#: admin/cgicfg.php:123 admin/nagioscfg.php:123
-#: functions/NagImportClass.php:209
+#: admin/cgicfg.php:142 admin/nagioscfg.php:139
+#: functions/NagImportClass.php:206
msgid "Cannot open the data file (check the permissions)!"
msgstr "Cannot open the data file (check the permissions)!"
-#: admin/cgicfg.php:139 admin/nagioscfg.php:138
+#: admin/cgicfg.php:158 admin/nagioscfg.php:154
msgid "Cannot open the temporary file"
msgstr "Cannot open the temporary file"
-#: admin/cgicfg.php:143 admin/nagioscfg.php:142
+#: admin/cgicfg.php:162 admin/nagioscfg.php:158
msgid "Configuration read failed (remote):"
msgstr "Configuration read failed (remote):"
-#: admin/checkcommands.php:62
+#: admin/checkcommands.php:109
msgid "New command inserted:"
msgstr "New command inserted:"
-#: admin/checkcommands.php:65
+#: admin/checkcommands.php:112
msgid "Command modified:"
msgstr "Command modified:"
-#: admin/checkcommands.php:70 admin/configtargets.php:152
-#: admin/contactgroups.php:123 admin/contacts.php:237
-#: admin/contacttemplates.php:242 admin/datadomain.php:72 admin/group.php:115
-#: admin/hostdependencies.php:182 admin/hostescalations.php:182
-#: admin/hostextinfo.php:72 admin/hostgroups.php:124 admin/hosts.php:380
-#: admin/hosttemplates.php:272 admin/password.php:83
-#: admin/servicedependencies.php:290 admin/serviceescalations.php:233
-#: admin/serviceextinfo.php:81 admin/servicegroups.php:126
-#: admin/services.php:387 admin/servicetemplates.php:318
-#: admin/timeperiods.php:150 admin/user.php:82
+#: admin/checkcommands.php:117 admin/configtargets.php:212
+#: admin/contactgroups.php:174 admin/contacts.php:324
+#: admin/contacttemplates.php:328 admin/datadomain.php:105 admin/group.php:143
+#: admin/hostdependencies.php:256 admin/hostescalations.php:251
+#: admin/hostextinfo.php:117 admin/hostgroups.php:179 admin/hosts.php:510
+#: admin/hosttemplates.php:387 admin/password.php:101
+#: admin/servicedependencies.php:394 admin/serviceescalations.php:319
+#: admin/serviceextinfo.php:125 admin/servicegroups.php:181
+#: admin/services.php:530 admin/servicetemplates.php:449
+#: admin/timeperiods.php:201 admin/user.php:117
msgid "Database entry failed! Not all necessary data filled in!"
msgstr "Database entry failed! Not all necessary data supplied!"
-#: admin/checkcommands.php:75 admin/configtargets.php:157
-#: admin/contactgroups.php:128 admin/contacts.php:242
-#: admin/contacttemplates.php:247 admin/datadomain.php:77 admin/group.php:120
-#: admin/hostdependencies.php:187 admin/hostescalations.php:187
-#: admin/hostextinfo.php:77 admin/hostgroups.php:129 admin/hosts.php:385
-#: admin/hosttemplates.php:277 admin/servicedependencies.php:295
-#: admin/serviceescalations.php:238 admin/serviceextinfo.php:86
-#: admin/servicegroups.php:131 admin/services.php:392
-#: admin/servicetemplates.php:323 admin/timeperiods.php:155 admin/user.php:87
+#: admin/checkcommands.php:122 admin/configtargets.php:217
+#: admin/contactgroups.php:179 admin/contacts.php:329
+#: admin/contacttemplates.php:333 admin/datadomain.php:110 admin/group.php:148
+#: admin/hostdependencies.php:261 admin/hostescalations.php:256
+#: admin/hostextinfo.php:122 admin/hostgroups.php:184 admin/hosts.php:515
+#: admin/hosttemplates.php:392 admin/servicedependencies.php:399
+#: admin/serviceescalations.php:324 admin/serviceextinfo.php:130
+#: admin/servicegroups.php:186 admin/services.php:535
+#: admin/servicetemplates.php:454 admin/timeperiods.php:206 admin/user.php:122
msgid "Database entry failed! No write access!"
msgstr "Database entry failed! No write access!"
-#: admin/checkcommands.php:108 admin/contactgroups.php:199
-#: admin/contacts.php:398 admin/contacttemplates.php:398
-#: admin/datadomain.php:114 admin/hostdependencies.php:301
-#: admin/hostescalations.php:305 admin/hostextinfo.php:122
-#: admin/hostgroups.php:202 admin/hosts.php:596 admin/hosttemplates.php:466
-#: admin/servicedependencies.php:646 admin/serviceescalations.php:500
-#: admin/serviceextinfo.php:173 admin/servicegroups.php:204
-#: admin/services.php:630 admin/servicetemplates.php:551
-#: admin/timeperiods.php:225
+#: admin/checkcommands.php:152 admin/contactgroups.php:239
+#: admin/contacts.php:462 admin/contacttemplates.php:462
+#: admin/datadomain.php:140 admin/hostdependencies.php:351
+#: admin/hostescalations.php:350 admin/hostextinfo.php:159
+#: admin/hostgroups.php:245 admin/hosts.php:695 admin/hosttemplates.php:552
+#: admin/servicedependencies.php:700 admin/serviceescalations.php:546
+#: admin/serviceextinfo.php:204 admin/servicegroups.php:247
+#: admin/services.php:739 admin/servicetemplates.php:641
+#: admin/timeperiods.php:266
msgid "Saving not possible!"
msgstr "Saving not possible!"
# checkcommand.php
-#: admin/checkcommands.php:113 admin/checkcommands.php:144
+#: admin/checkcommands.php:157 admin/checkcommands.php:188
msgid "Command definitions"
msgstr "Command definitions (commands.cfg)"
-#: admin/checkcommands.php:114
+#: admin/checkcommands.php:158
msgid "unclassified"
msgstr "unclassified"
-#: admin/checkcommands.php:115
+#: admin/checkcommands.php:159
msgid "check command"
msgstr "check command"
-#: admin/checkcommands.php:116
+#: admin/checkcommands.php:160
msgid "misc command"
msgstr "misc command"
-#: admin/checkcommands.php:122 admin/contactgroups.php:209
-#: admin/contacts.php:419 admin/contacttemplates.php:418
-#: admin/hostdependencies.php:308 admin/hostescalations.php:312
-#: admin/hostextinfo.php:132 admin/hostgroups.php:212 admin/hosts.php:606
-#: admin/hosttemplates.php:476 admin/servicedependencies.php:679
-#: admin/serviceescalations.php:536 admin/serviceextinfo.php:199
-#: admin/servicegroups.php:214 admin/services.php:637
-#: admin/servicetemplates.php:558 admin/timeperiods.php:236
+#: admin/checkcommands.php:166 admin/contactgroups.php:249
+#: admin/contacts.php:483 admin/contacttemplates.php:482
+#: admin/hostdependencies.php:358 admin/hostescalations.php:357
+#: admin/hostextinfo.php:169 admin/hostgroups.php:255 admin/hosts.php:705
+#: admin/hosttemplates.php:562 admin/servicedependencies.php:733
+#: admin/serviceescalations.php:582 admin/serviceextinfo.php:230
+#: admin/servicegroups.php:257 admin/services.php:746
+#: admin/servicetemplates.php:648 admin/timeperiods.php:277
msgid "Entry cannot be activated because it is used by another configuration"
msgstr "Entry cannot be activated because it is used by another configuration"
-#: admin/checkcommands.php:145
+#: admin/checkcommands.php:189
msgid "Command name"
msgstr "Command name"
-#: admin/checkcommands.php:146 config/fieldvars.php:90
+#: admin/checkcommands.php:190 config/fieldvars.php:92
msgid "Command line"
msgstr "Command line"
# prepend.adm
-#: admin/checkcommands.php:163 admin/checkcommands.php:177
-#: admin/configtargets.php:321 admin/configtargets.php:335
-#: admin/contactgroups.php:242 admin/contactgroups.php:256
-#: admin/contacts.php:477 admin/contacts.php:491 admin/contacttemplates.php:475
-#: admin/contacttemplates.php:489 admin/datadomain.php:162
-#: admin/datadomain.php:176 admin/group.php:177 admin/group.php:190
-#: admin/hostdependencies.php:352 admin/hostdependencies.php:366
-#: admin/hostescalations.php:349 admin/hostescalations.php:363
-#: admin/hostextinfo.php:167 admin/hostextinfo.php:184 admin/hostgroups.php:246
-#: admin/hostgroups.php:260 admin/hosts.php:690 admin/hosts.php:704
-#: admin/hosttemplates.php:558 admin/hosttemplates.php:572 admin/logbook.php:50
-#: admin/logbook.php:77 admin/menuaccess.php:69 admin/password.php:45
-#: admin/password.php:66 admin/servicedependencies.php:723
-#: admin/servicedependencies.php:737 admin/serviceescalations.php:574
-#: admin/serviceescalations.php:588 admin/serviceextinfo.php:235
-#: admin/serviceextinfo.php:253 admin/servicegroups.php:248
-#: admin/servicegroups.php:262 admin/services.php:713 admin/services.php:746
-#: admin/services.php:761 admin/servicetemplates.php:642
-#: admin/servicetemplates.php:656 admin/settings.php:241
-#: admin/timeperiods.php:271 admin/timeperiods.php:285 admin/user.php:188
-#: admin/user.php:201 functions/NagConfigClass.php:1352
-#: functions/NagDataClass.php:191 functions/NagVisualClass.php:841
-#: functions/prepend_adm.php:111 functions/prepend_adm.php:322
-#: functions/prepend_adm.php:381 functions/prepend_adm.php:495
-#: functions/prepend_adm.php:527 functions/prepend_content.php:495
+#: admin/checkcommands.php:211 admin/checkcommands.php:225
+#: admin/configtargets.php:379 admin/configtargets.php:393
+#: admin/contactgroups.php:286 admin/contactgroups.php:300
+#: admin/contacts.php:544 admin/contacts.php:558 admin/contacttemplates.php:542
+#: admin/contacttemplates.php:556 admin/datadomain.php:190
+#: admin/datadomain.php:204 admin/group.php:208 admin/group.php:221
+#: admin/hostdependencies.php:405 admin/hostdependencies.php:419
+#: admin/hostescalations.php:397 admin/hostescalations.php:411
+#: admin/hostextinfo.php:207 admin/hostextinfo.php:224 admin/hostgroups.php:312
+#: admin/hostgroups.php:326 admin/hosts.php:812 admin/hosts.php:826
+#: admin/hosttemplates.php:658 admin/hosttemplates.php:672 admin/logbook.php:69
+#: admin/logbook.php:96 admin/menuaccess.php:86 admin/password.php:63
+#: admin/password.php:84 admin/servicedependencies.php:780
+#: admin/servicedependencies.php:794 admin/serviceescalations.php:623
+#: admin/serviceescalations.php:637 admin/serviceextinfo.php:269
+#: admin/serviceextinfo.php:287 admin/servicegroups.php:314
+#: admin/servicegroups.php:328 admin/services.php:824 admin/services.php:880
+#: admin/services.php:895 admin/servicetemplates.php:747
+#: admin/servicetemplates.php:761 admin/settings.php:274
+#: admin/timeperiods.php:316 admin/timeperiods.php:330 admin/user.php:217
+#: admin/user.php:230 functions/NagConfigClass.php:1191
+#: functions/NagDataClass.php:90 functions/NagVisualClass.php:1365
+#: functions/prepend_adm.php:112 functions/prepend_adm.php:321
+#: functions/prepend_adm.php:381 functions/prepend_adm.php:492
+#: functions/prepend_adm.php:524 functions/prepend_content.php:541
msgid "Error while selecting data from database:"
msgstr "Error while selecting data from database:"
-#: admin/commands.php:35 admin/commands.php:49
+#: admin/commands.php:44 admin/commands.php:58
msgid "Check commands"
msgstr "Check commands"
# commands.php
-#: admin/commands.php:36
+#: admin/commands.php:45
msgid ""
"To define check and misc commands, notification commands and special "
"commands."
@@ -285,516 +285,517 @@ msgstr ""
"commands."
# mutdialog.php
-#: admin/configtargets.php:60 admin/configtargets.php:67
-#: admin/configtargets.php:89 admin/configtargets.php:94
+#: admin/configtargets.php:120 admin/configtargets.php:127
+#: admin/configtargets.php:149 admin/configtargets.php:154
msgid "is not writeable"
msgstr "is not writeable"
-#: admin/configtargets.php:66 admin/configtargets.php:82 admin/support.php:287
-#: config/fieldvars.php:46
+#: admin/configtargets.php:126 admin/configtargets.php:142
+#: admin/support.php:307 config/fieldvars.php:47
msgid "Nagios config file"
msgstr "Nagios config file"
-#: admin/configtargets.php:83
+#: admin/configtargets.php:143
msgid "is not a valid configuration file!"
msgstr "is not a valid configuration file!"
-#: admin/configtargets.php:88 config/fieldvars.php:226
+#: admin/configtargets.php:148 config/fieldvars.php:231
msgid "Nagios base directory"
msgstr "Nagios base directory"
-#: admin/configtargets.php:93
+#: admin/configtargets.php:153
msgid "Nagios cgi config file"
msgstr "Nagios cgi config file"
-#: admin/configtargets.php:98
+#: admin/configtargets.php:158
msgid "Nagios resource config file"
msgstr "Nagios resource config file"
# mutdialog.php
-#: admin/configtargets.php:99
+#: admin/configtargets.php:159
msgid "is not readable"
msgstr "is not readable"
-#: admin/configtargets.php:105 functions/NagConfigClass.php:363
-#: functions/NagConfigClass.php:2083
+#: admin/configtargets.php:165 functions/NagConfigClass.php:375
+#: functions/NagConfigClass.php:2409
msgid "SSH module not loaded!"
msgstr "SSH module not loaded!"
-#: admin/configtargets.php:110 functions/NagConfigClass.php:2061
+#: admin/configtargets.php:170 functions/NagConfigClass.php:2387
msgid "FTP module not loaded!"
msgstr "FTP module not loaded!"
# domain.php
-#: admin/configtargets.php:144 admin/datadomain.php:64
+#: admin/configtargets.php:204 admin/datadomain.php:97
msgid "New Domain inserted:"
msgstr "New Domain inserted:"
-#: admin/configtargets.php:147 admin/datadomain.php:67
+#: admin/configtargets.php:207 admin/datadomain.php:100
msgid "Domain modified:"
msgstr "Domain modified:"
-#: admin/configtargets.php:180 admin/configtargets.php:309
+#: admin/configtargets.php:236 admin/configtargets.php:365
msgid "Configuration domain administration"
msgstr "Configuration domain administration"
-#: admin/configtargets.php:182
+#: admin/configtargets.php:238
msgid "Warning, at least one error occured, please check!"
msgstr "Warning, at least one error occurred. Please check!"
-#: admin/configtargets.php:188 admin/datadomain.php:117 admin/group.php:149
-#: admin/password.php:99 admin/user.php:130 config/fieldvars.php:204
-#: install/step2.php:33
+#: admin/configtargets.php:244 admin/datadomain.php:143 admin/group.php:178
+#: admin/password.php:117 admin/user.php:157 config/fieldvars.php:207
+#: install/step2.php:38
msgid "Please fill in all fields marked with an *"
msgstr "Please fill in all fields marked with an *"
-#: admin/configtargets.php:189 admin/datadomain.php:118 admin/group.php:150
-#: admin/user.php:131 config/fieldvars.php:206
+#: admin/configtargets.php:245 admin/datadomain.php:144 admin/group.php:179
+#: admin/user.php:158 config/fieldvars.php:209
msgid "The following field contains illegal characters:"
msgstr "The following field contains illegal characters:"
-#: admin/configtargets.php:310 config/fieldvars.php:265
+#: admin/configtargets.php:366 config/fieldvars.php:270
msgid "Configuration target"
msgstr "Configuration target"
-#: admin/configtargets.php:311 admin/contactgroups.php:226
-#: admin/contacts.php:456 admin/contacttemplates.php:455
-#: admin/datadomain.php:152 admin/group.php:167 admin/hostgroups.php:229
-#: admin/hosts.php:673 admin/hosttemplates.php:542 admin/servicegroups.php:231
-#: admin/timeperiods.php:254 admin/user.php:178 config/fieldvars.php:21
+#: admin/configtargets.php:367 admin/contactgroups.php:267
+#: admin/contacts.php:522 admin/contacttemplates.php:521
+#: admin/datadomain.php:179 admin/group.php:196 admin/hostgroups.php:272
+#: admin/hosts.php:772 admin/hosttemplates.php:628 admin/servicegroups.php:274
+#: admin/timeperiods.php:296 admin/user.php:205 config/fieldvars.php:21
msgid "Description"
msgstr "Description"
-#: admin/contactgroups.php:62
+#: admin/contactgroups.php:113
msgid "New contact group inserted:"
msgstr "New contact group inserted:"
-#: admin/contactgroups.php:65
+#: admin/contactgroups.php:116
msgid "Contact group modified:"
msgstr "Contact group modified:"
-#: admin/contactgroups.php:146 admin/contactgroups.php:224
+#: admin/contactgroups.php:198 admin/contactgroups.php:265
msgid "Define contact groups (contactgroups.cfg)"
msgstr "Define contact groups (contactgroups.cfg)"
-#: admin/contactgroups.php:165
+#: admin/contactgroups.php:213
msgid "Attention, no contacts defined!"
msgstr "Attention, no contacts defined!"
-#: admin/contactgroups.php:225 config/fieldvars.php:102
+#: admin/contactgroups.php:266 config/fieldvars.php:105
msgid "Contact group"
msgstr "Contact group"
# contacts.php
-#: admin/contacts.php:84
+#: admin/contacts.php:175
msgid "New contact inserted:"
msgstr "New contact inserted:"
-#: admin/contacts.php:87
+#: admin/contacts.php:178
msgid "Contact modified:"
msgstr "Contact modified:"
-#: admin/contacts.php:260 admin/contacts.php:454
+#: admin/contacts.php:348 admin/contacts.php:520
msgid "Define contacts (contacts.cfg)"
msgstr "Define contacts (contacts.cfg)"
-#: admin/contacts.php:329 admin/hosts.php:515 admin/services.php:566
+#: admin/contacts.php:409 admin/hosts.php:630 admin/services.php:691
msgid "Attention, no time periods defined!"
msgstr "Attention, no time periods defined!"
-#: admin/contacts.php:364
+#: admin/contacts.php:436
msgid "Attention, no commands defined!"
msgstr "Attention, no commands defined!"
-#: admin/contacts.php:455 admin/contacttemplates.php:454
-#: config/fieldvars.php:101
+#: admin/contacts.php:521 admin/contacttemplates.php:520
+#: config/fieldvars.php:104
msgid "Contact name"
msgstr "Contact name"
# hosttemplates.php
-#: admin/contacttemplates.php:84
+#: admin/contacttemplates.php:174
msgid "New contact template inserted:"
msgstr "New contact template inserted:"
-#: admin/contacttemplates.php:87
+#: admin/contacttemplates.php:177
msgid "Contact template modified:"
msgstr "Contact template modified:"
-#: admin/contacttemplates.php:265 admin/contacttemplates.php:453
+#: admin/contacttemplates.php:352 admin/contacttemplates.php:519
msgid "Define contact templates (contacttemplates.cfg)"
msgstr "Define contact templates (contacttemplates.cfg)"
-#: admin/datadomain.php:98
+#: admin/datadomain.php:128
msgid "Attention, no configuration targets defined!"
msgstr "Attention, no configuration targets defined!"
-#: admin/datadomain.php:116 admin/datadomain.php:150
+#: admin/datadomain.php:142 admin/datadomain.php:177
msgid "Data domain administration"
msgstr "Data domain administration"
-#: admin/datadomain.php:119 admin/settings.php:280
+#: admin/datadomain.php:145 admin/settings.php:305
msgid "Enable"
msgstr "Enable"
# mutdialog.php
-#: admin/datadomain.php:120 admin/settings.php:281
+#: admin/datadomain.php:146 admin/settings.php:306
msgid "Disable"
msgstr "Disable"
# fieldvars.php
-#: admin/datadomain.php:151
+#: admin/datadomain.php:178
msgid "Data domain"
msgstr "Data domain"
-#: admin/delbackup.php:55 admin/delconfig.php:55
+#: admin/delbackup.php:75 admin/delconfig.php:74
msgid "File deleted"
msgstr "File deleted"
-#: admin/delbackup.php:56 admin/delconfig.php:56
+#: admin/delbackup.php:76 admin/delconfig.php:75
msgid "successfully deleted"
msgstr "successfully deleted"
-#: admin/delbackup.php:65 config/fieldvars.php:316
+#: admin/delbackup.php:85 config/fieldvars.php:320
msgid "Delete backup files"
msgstr "Delete backup files"
-#: admin/delbackup.php:68 admin/delconfig.php:68 admin/import.php:94
+#: admin/delbackup.php:88 admin/delconfig.php:87 admin/import.php:110
msgid "Filter string"
msgstr "Filter string"
-#: admin/delbackup.php:69 admin/delconfig.php:69 admin/import.php:95
-#: config/fieldvars.php:84
+#: admin/delbackup.php:89 admin/delconfig.php:88 admin/import.php:111
+#: config/fieldvars.php:86
msgid "Search"
msgstr "Search"
-#: admin/delbackup.php:70 admin/delbackup.php:75 admin/delconfig.php:70
-#: admin/delconfig.php:75 admin/groupusers.php:166 admin/import.php:96
-#: admin/templatedefinitions.php:268 admin/timedefinitions.php:180
-#: admin/variabledefinitions.php:147 config/fieldvars.php:76
-#: config/fieldvars.php:183
+#: admin/delbackup.php:90 admin/delbackup.php:95 admin/delconfig.php:89
+#: admin/delconfig.php:94 admin/groupusers.php:169 admin/groupusers.php:170
+#: admin/import.php:112 admin/templatedefinitions.php:285
+#: admin/timedefinitions.php:183 admin/variabledefinitions.php:161
+#: admin/variabledefinitions.php:162 config/fieldvars.php:78
+#: config/fieldvars.php:186
msgid "Delete"
msgstr "Delete"
-#: admin/delbackup.php:71 admin/delconfig.php:71 admin/import.php:97
-#: config/fieldvars.php:85
+#: admin/delbackup.php:91 admin/delconfig.php:90 admin/import.php:113
+#: config/fieldvars.php:87
msgid "Reset filter"
msgstr "Reset filter"
-#: admin/delbackup.php:73
+#: admin/delbackup.php:93
msgid "Backup file"
msgstr "Backup file"
-#: admin/delbackup.php:74 admin/delconfig.php:74 admin/settings.php:312
-#: config/fieldvars.php:57
+#: admin/delbackup.php:94 admin/delconfig.php:93 admin/settings.php:336
+#: config/fieldvars.php:58
msgid "required"
msgstr "required"
-#: admin/delbackup.php:76 admin/delconfig.php:76 admin/import.php:104
-#: admin/password.php:98 admin/settings.php:311 config/fieldvars.php:59
+#: admin/delbackup.php:96 admin/delconfig.php:95 admin/import.php:120
+#: admin/password.php:116 admin/settings.php:335 config/fieldvars.php:60
msgid "Abort"
msgstr "Abort"
-#: admin/delbackup.php:77 admin/delconfig.php:77 config/fieldvars.php:282
+#: admin/delbackup.php:97 admin/delconfig.php:96 config/fieldvars.php:287
msgid "Hold CTRL to select more than one entry"
msgstr "Hold down CTRL to select more than one entry"
-#: admin/delbackup.php:120 admin/delbackup.php:156
+#: admin/delbackup.php:140 admin/delbackup.php:176
msgid "No backup files or no permission to read the backup files"
msgstr "No backup files or no permission to read the backup files"
-#: admin/delconfig.php:65 config/fieldvars.php:315
+#: admin/delconfig.php:84 config/fieldvars.php:319
msgid "Delete config files"
msgstr "Delete config files"
-#: admin/delconfig.php:73
+#: admin/delconfig.php:92
msgid "Configuration file"
msgstr "Configuration file"
-#: admin/download.php:61 config/fieldvars.php:87
+#: admin/download.php:66 config/fieldvars.php:89
msgid "Download"
msgstr "Download"
-#: admin/group.php:63
+#: admin/group.php:91
msgid "A new group added:"
msgstr "A new group added:"
-#: admin/group.php:66 admin/user.php:77
+#: admin/group.php:94 admin/user.php:112
msgid "User modified:"
msgstr "User modified:"
-#: admin/group.php:144 admin/group.php:165
+#: admin/group.php:173 admin/group.php:194
msgid "Group administration"
msgstr "Group administration"
-#: admin/group.php:145
+#: admin/group.php:174
msgid "Read"
msgstr "Read"
-#: admin/group.php:146 admin/verify.php:97 admin/verify.php:101
-#: admin/verify.php:112 admin/verify.php:116 admin/verify.php:127
-#: admin/verify.php:131 admin/verify.php:142 admin/verify.php:146
-#: admin/verify.php:161 admin/verify.php:170 admin/verify.php:179
-#: admin/verify.php:188 admin/verify.php:197 admin/verify.php:201
-#: admin/verify.php:212 admin/verify.php:216 admin/verify.php:227
-#: admin/verify.php:231 admin/verify.php:242 admin/verify.php:246
-#: admin/verify.php:257 admin/verify.php:261 admin/verify.php:272
-#: admin/verify.php:276 admin/verify.php:287 admin/verify.php:291
+#: admin/group.php:175 admin/verify.php:121 admin/verify.php:124
+#: admin/verify.php:134 admin/verify.php:137 admin/verify.php:147
+#: admin/verify.php:150 admin/verify.php:160 admin/verify.php:163
+#: admin/verify.php:177 admin/verify.php:186 admin/verify.php:195
+#: admin/verify.php:204 admin/verify.php:213 admin/verify.php:216
+#: admin/verify.php:226 admin/verify.php:229 admin/verify.php:239
+#: admin/verify.php:242 admin/verify.php:252 admin/verify.php:255
+#: admin/verify.php:265 admin/verify.php:268 admin/verify.php:278
+#: admin/verify.php:281 admin/verify.php:291 admin/verify.php:294
msgid "Write"
msgstr "Write"
-#: admin/group.php:147
+#: admin/group.php:176
msgid "Link"
msgstr "Link"
-#: admin/group.php:166
+#: admin/group.php:195
msgid "Groupname"
msgstr "Groupname"
-#: admin/groupusers.php:175 admin/templatedefinitions.php:277
-#: admin/timedefinitions.php:189 admin/variabledefinitions.php:156
-#: functions/NagContentClass.php:136
+#: admin/groupusers.php:181 admin/templatedefinitions.php:295
+#: admin/timedefinitions.php:193 admin/variabledefinitions.php:174
+#: admin/variabledefinitions.php:183 functions/NagContentClass.php:131
msgid "No data"
msgstr "No data"
-#: admin/helpedit.php:83
+#: admin/helpedit.php:94
msgid "Help text editor"
msgstr "Help text editor"
-#: admin/helpedit.php:89
+#: admin/helpedit.php:100
msgid "Main key"
msgstr "Main key"
-#: admin/helpedit.php:90
+#: admin/helpedit.php:101
msgid "Sub key"
msgstr "Sub key"
-#: admin/helpedit.php:91 admin/settings.php:226 admin/settings.php:227
-#: install/index.php:71
+#: admin/helpedit.php:102 admin/settings.php:258 admin/settings.php:259
+#: install/index.php:76
msgid "Language"
msgstr "Language"
-#: admin/helpedit.php:92 config/fieldvars.php:49
+#: admin/helpedit.php:103 config/fieldvars.php:50
msgid "Nagios version"
msgstr "Nagios version"
-#: admin/helpedit.php:93
+#: admin/helpedit.php:104
msgid "Load default text"
msgstr "Load default text"
# hosttemplates.php
-#: admin/hostdependencies.php:70
+#: admin/hostdependencies.php:144
msgid "New host dependency inserted:"
msgstr "New host dependency inserted:"
-#: admin/hostdependencies.php:73
+#: admin/hostdependencies.php:147
msgid "Host dependency modified:"
msgstr "Host dependency modified:"
-#: admin/hostdependencies.php:205 admin/hostdependencies.php:332
+#: admin/hostdependencies.php:279 admin/hostdependencies.php:382
msgid "Define host dependencies (hostdependencies.cfg)"
msgstr "Define host dependencies (hostdependencies.cfg)"
-#: admin/hostdependencies.php:285 admin/hostescalations.php:242
-#: admin/servicedependencies.php:533 admin/serviceescalations.php:369
+#: admin/hostdependencies.php:339 admin/hostescalations.php:303
+#: admin/servicedependencies.php:607 admin/serviceescalations.php:439
msgid "Attention, no hosts and hostgroups defined!"
msgstr "Attention, no hosts and hostgroups defined!"
-#: admin/hostdependencies.php:333 admin/hostescalations.php:331
-#: admin/servicedependencies.php:705 admin/serviceescalations.php:556
-#: admin/services.php:705 config/fieldvars.php:217
+#: admin/hostdependencies.php:383 admin/hostescalations.php:376
+#: admin/servicedependencies.php:759 admin/serviceescalations.php:602
+#: admin/services.php:815 config/fieldvars.php:222
msgid "Config name"
msgstr "Config name"
-#: admin/hostdependencies.php:334 config/fieldvars.php:234
+#: admin/hostdependencies.php:384 config/fieldvars.php:239
msgid "Dependent hosts"
msgstr "Dependent hosts"
-#: admin/hostdependencies.php:334 config/fieldvars.php:235
+#: admin/hostdependencies.php:384 config/fieldvars.php:240
msgid "Dependent hostgroups"
msgstr "Dependent hostgroups"
# hosttemplates.php
-#: admin/hostescalations.php:70
+#: admin/hostescalations.php:139
msgid "New host escalation inserted:"
msgstr "New host escalation inserted:"
-#: admin/hostescalations.php:73
+#: admin/hostescalations.php:142
msgid "Host escalation modified:"
msgstr "Host escalation modified:"
-#: admin/hostescalations.php:205 admin/hostescalations.php:330
+#: admin/hostescalations.php:274 admin/hostescalations.php:375
msgid "Define host escalation (hostescalations.cfg)"
msgstr "Define host escalation (hostescalations.cfg)"
-#: admin/hostescalations.php:289 admin/serviceescalations.php:433
+#: admin/hostescalations.php:338 admin/serviceescalations.php:491
msgid "Attention, no contacts and contactgroups defined!"
msgstr "Attention, no contacts and contactgroups defined!"
-#: admin/hostescalations.php:332 admin/monitoring.php:56
-#: config/fieldvars.php:211 config/fieldvars.php:300
+#: admin/hostescalations.php:377 admin/monitoring.php:65
+#: config/fieldvars.php:214 config/fieldvars.php:304
msgid "Hosts"
msgstr "Hosts"
-#: admin/hostescalations.php:332 admin/monitoring.php:72
-#: config/fieldvars.php:127 config/fieldvars.php:306
+#: admin/hostescalations.php:377 admin/monitoring.php:81
+#: config/fieldvars.php:130 config/fieldvars.php:310
msgid "Host groups"
msgstr "Host groups"
# hosttemplates.php
-#: admin/hostextinfo.php:64
+#: admin/hostextinfo.php:109
msgid "New host extended information inserted:"
msgstr "New host extended information inserted:"
-#: admin/hostextinfo.php:67
+#: admin/hostextinfo.php:112
msgid "Host extended information modified:"
msgstr "Host extended information modified:"
-#: admin/hostextinfo.php:95 admin/hostextinfo.php:147
+#: admin/hostextinfo.php:140 admin/hostextinfo.php:184
msgid "Define host extended information (hostextinfo.cfg)"
msgstr "Define host extended information (hostextinfo.cfg)"
-#: admin/hostextinfo.php:106 admin/hostgroups.php:168
-#: admin/serviceextinfo.php:141
+#: admin/hostextinfo.php:147 admin/hostgroups.php:219
+#: admin/serviceextinfo.php:180
msgid "Attention, no hosts defined!"
msgstr "Attention, no hosts defined!"
-#: admin/hostextinfo.php:148 admin/hosts.php:672 config/fieldvars.php:202
+#: admin/hostextinfo.php:185 admin/hosts.php:771 config/fieldvars.php:205
msgid "Host name"
msgstr "Host name"
-#: admin/hostextinfo.php:149 config/fieldvars.php:166
+#: admin/hostextinfo.php:186 config/fieldvars.php:169
msgid "Notes"
msgstr "Notes"
-#: admin/hostgroups.php:63
+#: admin/hostgroups.php:118
msgid "New host group inserted:"
msgstr "New host group inserted:"
-#: admin/hostgroups.php:66
+#: admin/hostgroups.php:121
msgid "Host group modified:"
msgstr "Host group modified:"
-#: admin/hostgroups.php:147 admin/hostgroups.php:227
+#: admin/hostgroups.php:202 admin/hostgroups.php:270
msgid "Define host groups (hostgroups.cfg)"
msgstr "Define host groups (hostgroups.cfg)"
-#: admin/hostgroups.php:228
+#: admin/hostgroups.php:271
msgid "Host group"
msgstr "Host group"
# contacts.php
-#: admin/hosts.php:95
+#: admin/hosts.php:227
msgid "New host inserted:"
msgstr "New host inserted:"
-#: admin/hosts.php:98
+#: admin/hosts.php:230
msgid "Host modified:"
msgstr "Host modified:"
-#: admin/hosts.php:192 admin/hosts.php:218 admin/services.php:249
-#: admin/services.php:279 functions/NagDataClass.php:556
-#: functions/NagDataClass.php:583 functions/prepend_content.php:415
-#: functions/prepend_content.php:475
+#: admin/hosts.php:328 admin/hosts.php:352 admin/services.php:395
+#: admin/services.php:424 functions/NagDataClass.php:961
+#: functions/NagDataClass.php:988 functions/prepend_content.php:458
+#: functions/prepend_content.php:520
msgid ""
"The assigned, no longer used configuration files were deleted successfully!"
msgstr ""
"The associated, now obsolete, configuration files were deleted successfully!"
-#: admin/hosts.php:194 admin/hosts.php:220 functions/NagDataClass.php:558
-#: functions/NagDataClass.php:586 functions/prepend_content.php:401
+#: admin/hosts.php:330 admin/hosts.php:354 functions/NagDataClass.php:963
+#: functions/NagDataClass.php:991 functions/prepend_content.php:444
msgid "Host file deleted:"
msgstr "Host file deleted:"
-#: admin/hosts.php:197 admin/hosts.php:223 admin/services.php:254
-#: functions/prepend_content.php:424 functions/prepend_content.php:484
+#: admin/hosts.php:332 admin/hosts.php:356 admin/services.php:399
+#: functions/prepend_content.php:467 functions/prepend_content.php:529
msgid ""
"Common files cannot be removed from target systems - please check manually"
msgstr ""
"Common files cannot be removed from target systems - please check manually"
-#: admin/hosts.php:200 admin/hosts.php:226 admin/services.php:257
-#: admin/services.php:283 functions/NagDataClass.php:560
-#: functions/NagDataClass.php:588 functions/prepend_content.php:419
-#: functions/prepend_content.php:479
+#: admin/hosts.php:335 admin/hosts.php:359 admin/services.php:402
+#: admin/services.php:428 functions/NagDataClass.php:965
+#: functions/NagDataClass.php:993 functions/prepend_content.php:462
+#: functions/prepend_content.php:524
msgid "Errors while deleting the old configuration file - please check!:"
msgstr "Error while deleting the old configuration file - please check!:"
-#: admin/hosts.php:396 admin/hosts.php:671
+#: admin/hosts.php:526 admin/hosts.php:770
msgid "Define hosts (hosts.cfg)"
msgstr "Define hosts (hosts.cfg)"
-#: admin/hosts.php:562
+#: admin/hosts.php:665
msgid "Attention, no contact groups defined!"
msgstr "Attention, no contact groups defined!"
# hosttemplates.php
-#: admin/hosttemplates.php:96
+#: admin/hosttemplates.php:212
msgid "New host template inserted:"
msgstr "New host template inserted:"
-#: admin/hosttemplates.php:99
+#: admin/hosttemplates.php:215
msgid "Host template modified:"
msgstr "Host template modified:"
-#: admin/hosttemplates.php:295 admin/hosttemplates.php:540
+#: admin/hosttemplates.php:410 admin/hosttemplates.php:626
msgid "Host template definition (hosttemplates.cfg)"
msgstr "Host template definition (hosttemplates.cfg)"
-#: admin/hosttemplates.php:541
+#: admin/hosttemplates.php:627
msgid "Host template name"
msgstr "Host template name"
-#: admin/import.php:55
+#: admin/import.php:72
msgid "File upload error:"
msgstr "File upload error:"
-#: admin/import.php:67 admin/import.php:83
+#: admin/import.php:84 admin/import.php:99
msgid "File imported - File [overwrite flag]:"
msgstr "File imported - File [overwrite flag]:"
-#: admin/import.php:91
+#: admin/import.php:107
msgid "Configuration import"
msgstr "Configuration import"
-#: admin/import.php:99
+#: admin/import.php:115
msgid "Template definition"
msgstr "Template definition"
-#: admin/import.php:100
+#: admin/import.php:116
msgid "Import file"
msgstr "Import file"
-#: admin/import.php:101
+#: admin/import.php:117
msgid "Local import file"
msgstr "Local import file"
-#: admin/import.php:102
+#: admin/import.php:118
msgid "Overwrite database"
msgstr "Overwrite database"
-#: admin/import.php:103
+#: admin/import.php:119
msgid "Import"
msgstr "Import"
-#: admin/import.php:105
+#: admin/import.php:121
msgid "Hold CTRL to select more than one"
msgstr "Hold down CTRL to select more than one"
-#: admin/import.php:109
+#: admin/import.php:125
msgid ""
"To prevent errors or misconfigurations, you should import your "
-"configurations in an useful order. We recommend to do it like this:"
+"configurations in a useful order. We recommend to do it like this:"
"
"
msgstr ""
"To prevent errors or misconfigurations, you should import your "
-"configurations in an useful order. We recommend to do it like this:"
+"configurations in a useful order. We recommend to do it like this:"
"
"
-#: admin/import.php:113
+#: admin/import.php:129
msgid ""
"Check your configuration after import! In cause of an error or an "
"uncomplete configuration, re-importing the wrong configuration can solve the "
@@ -804,19 +805,19 @@ msgstr ""
"uncomplete configuration, re-importing the wrong configuration can solve the "
"problem."
-#: admin/info.php:43
+#: admin/info.php:46
msgid "This is relative path of your NagiosQL Installation"
msgstr "This is relative path of your NagiosQL Installation"
-#: admin/info.php:44
+#: admin/info.php:47
msgid "This is the absolut path to your NagiosQL Installation"
msgstr "This is the absolut path to your NagiosQL Installation"
-#: admin/info.php:45
+#: admin/info.php:48
msgid "If you need a secure connection, select HTTPS instead of HTTP"
msgstr "If you need a secure connection, select HTTPS instead of HTTP"
-#: admin/info.php:46
+#: admin/info.php:49
msgid ""
"Please choose a temporary directory with write permissions. The default is "
"the temp directory provided by your OS"
@@ -824,11 +825,11 @@ msgstr ""
"Please choose a temporary directory with write permissions. The default is "
"the temp directory provided by your OS"
-#: admin/info.php:48
+#: admin/info.php:51
msgid "Please choose your application language for new users and login portal"
msgstr "Please choose your application language for new users and login portal"
-#: admin/info.php:49
+#: admin/info.php:52
msgid ""
"Encoding should be set to nothing else than utf-8. Any changes at your own "
"risk"
@@ -836,19 +837,19 @@ msgstr ""
"Encoding should be set to nothing else than utf-8. Any changes at your own "
"risk"
-#: admin/info.php:50
+#: admin/info.php:53
msgid "IP-Address or hostname of the database server e.g. localhost"
msgstr "IP-Address or hostname of the database server e.g. localhost"
-#: admin/info.php:51
+#: admin/info.php:54
msgid "MySQL Server Port, default is 3306"
msgstr "MySQL Server Port, default is 3306"
-#: admin/info.php:52
+#: admin/info.php:55
msgid "Name of the NagiosQL database e.g. db_nagiosql_v3"
msgstr "Name of the NagiosQL database e.g. db_nagiosql_v3"
-#: admin/info.php:53
+#: admin/info.php:56
msgid ""
"User with sufficient permission for the NagiosQL database At least this "
"user should have SELECT, INSERT, UPDATE, DELETE permissions"
@@ -856,11 +857,11 @@ msgstr ""
"User with sufficient permission for the NagiosQL database At least this "
"user should have SELECT, INSERT, UPDATE, DELETE permissions"
-#: admin/info.php:55
+#: admin/info.php:58
msgid "Password for the above mentioned user"
msgstr "Password for the above mentioned user"
-#: admin/info.php:56
+#: admin/info.php:59
msgid ""
"After the defined amount of seconds the session will terminate for security "
"reasons"
@@ -868,41 +869,41 @@ msgstr ""
"After the defined amount of seconds the session will terminate for security "
"reasons"
-#: admin/info.php:58
-msgid ""
-"Decide between authentication based on your Webserver e.g. Apache "
-"configuration (config file or htaccess) or NagiosQL"
-msgstr ""
-"Decide between authentication based on your Webserver e.g. Apache "
-"configuration (config file or htaccess) or NagiosQL"
-
-#: admin/info.php:60
-msgid ""
-"Number of entries per side that should be visible (e.g. services or hosts)"
-msgstr ""
-"Number of entries per side that should be visible (e.g. services or hosts)"
-
#: admin/info.php:61
msgid ""
-"Method of selection of multiple entries by using the new dialog or by "
-"holding CTRL + left mouse button, as in NagiosQL 2"
+"Decide between authentication based on your Webserver e.g. Apache "
+"configuration (config file or htaccess) or NagiosQL"
msgstr ""
-"Method of selection of multiple entries by using the new dialog or by "
-"holding CTRL + left mouse button, as in NagiosQL 2"
+"Decide between authentication based on your Webserver e.g. Apache "
+"configuration (config file or htaccess) or NagiosQL"
#: admin/info.php:63
msgid ""
+"Number of entries per side that should be visible (e.g. services or hosts)"
+msgstr ""
+"Number of entries per side that should be visible (e.g. services or hosts)"
+
+#: admin/info.php:64
+msgid ""
+"Method of selection of multiple entries by using the new dialog or by "
+"holding CTRL + left mouse button, as in NagiosQL 2"
+msgstr ""
+"Method of selection of multiple entries by using the new dialog or by "
+"holding CTRL + left mouse button, as in NagiosQL 2"
+
+#: admin/info.php:66
+msgid ""
"Enable or disable the warning if a required field contains no data in "
"objects with templates"
msgstr ""
"Enable or disable the warning if a required field contains no data in "
"objects with templates"
-#: admin/info.php:65
+#: admin/info.php:68
msgid "Enable or disable the automatic online version check."
msgstr "Enable or disable the automatic online version check."
-#: admin/info.php:66
+#: admin/info.php:69
msgid ""
"If you require a Proxyserver to connect to the Internet (Port 80), please "
"define one."
@@ -910,79 +911,89 @@ msgstr ""
"If you require a Proxyserver to connect to the Internet (Port 80), please "
"define one."
-#: admin/info.php:68
+#: admin/info.php:71
msgid "Address of your Proxyserver e.g. proxy.yourdomain.com:3128"
msgstr "Address of your Proxyserver e.g. proxy.yourdomain.com:3128"
-#: admin/info.php:69
+#: admin/info.php:72
msgid "Username to connect through your proxy (optional)"
msgstr "Username to connect through your proxy (optional)"
-#: admin/info.php:70
+#: admin/info.php:73
msgid "Password to connect through your proxy (optional)"
msgstr "Password to connect through your proxy (optional)"
-#: admin/info.php:92
+#: admin/info.php:74
+msgid ""
+"In environments with a high number of host and service objects, the display "
+"of the parent objects can be disabled to improve performance. Existing "
+"assignments are preserved during modification."
+msgstr ""
+"In environments with a high number of host and service objects, the display "
+"of the parent objects can be disabled to improve performance. Existing "
+"assignments are preserved during modification."
+
+#: admin/info.php:100
msgid "Information PopUp"
msgstr "Information PopUp"
# mutdialog.php
-#: admin/info.php:105
+#: admin/info.php:113
msgid "No information available"
msgstr "No information available"
-#: admin/logbook.php:53 functions/NagDataClass.php:401
-#: functions/NagDataClass.php:436 functions/NagDataClass.php:611
+#: admin/logbook.php:72 functions/NagDataClass.php:798
+#: functions/NagDataClass.php:835 functions/NagDataClass.php:1017
msgid "Dataset successfully deleted. Affected rows:"
msgstr "Dataset successfully deleted. Affected rows:"
# logbook.php
-#: admin/logbook.php:83
+#: admin/logbook.php:102
msgid "View logbook"
msgstr "View logbook"
-#: admin/logbook.php:87
+#: admin/logbook.php:106
msgid "Delete logentries between:"
msgstr "Delete log entries between:"
-#: admin/logbook.php:89
+#: admin/logbook.php:108
msgid "Please supply a start or a stop time at least"
msgstr "Please supply a start or a stop time at least"
-#: admin/logbook.php:90
+#: admin/logbook.php:109
msgid ""
"Do you really want to delete all log entries between the selected dates?"
msgstr ""
"Do you really want to delete all log entries between the selected dates?"
-#: admin/logbook.php:97
+#: admin/logbook.php:116
msgid "previous 20 entries"
msgstr "previous 20 entries"
-#: admin/logbook.php:104
+#: admin/logbook.php:123
msgid "next 20 entries"
msgstr "next 20 entries"
-#: admin/menuaccess.php:44 functions/NagDataClass.php:137
-#: functions/NagDataClass.php:290
+#: admin/menuaccess.php:61 functions/NagDataClass.php:199
+#: functions/NagDataClass.php:755
msgid "Error while inserting the data into the database:"
msgstr "Error while inserting the data into the database:"
-#: admin/menuaccess.php:47 functions/NagDataClass.php:134
-#: functions/NagDataClass.php:285
+#: admin/menuaccess.php:64 functions/NagDataClass.php:194
+#: functions/NagDataClass.php:752
msgid "Data were successfully inserted to the data base!"
msgstr "Data successfully inserted into the database!"
-#: admin/menuaccess.php:48
+#: admin/menuaccess.php:65
msgid "Access group set for menu item:"
msgstr "Access group set for menu item:"
# menuaccess.php
-#: admin/menuaccess.php:55
+#: admin/menuaccess.php:72
msgid "Define Menu Access Rights"
msgstr "Define Menu Access Rights"
-#: admin/menuaccess.php:59
+#: admin/menuaccess.php:76
msgid ""
"In order for a user to get access, he needs to be member of the group "
"selected here."
@@ -990,212 +1001,212 @@ msgstr ""
"In order for a user to get access, he needs to be member of the group "
"selected here."
-#: admin/monitoring.php:36
+#: admin/monitoring.php:45
msgid "Monitoring"
msgstr "Monitoring"
# monitoring.php
-#: admin/monitoring.php:39
+#: admin/monitoring.php:48
msgid ""
"Define host and service supervisions as well as host and service groups."
msgstr ""
"Define host and service supervisions as well as host and service groups."
-#: admin/monitoring.php:64 admin/serviceescalations.php:557
-#: config/fieldvars.php:248 config/fieldvars.php:305
+#: admin/monitoring.php:73 admin/serviceescalations.php:603
+#: config/fieldvars.php:253 config/fieldvars.php:309
msgid "Services"
msgstr "Services"
-#: admin/monitoring.php:80 config/fieldvars.php:213 config/fieldvars.php:307
+#: admin/monitoring.php:89 config/fieldvars.php:216 config/fieldvars.php:311
msgid "Service groups"
msgstr "Service groups"
-#: admin/monitoring.php:88 config/fieldvars.php:302 config/fieldvars.php:328
+#: admin/monitoring.php:97 config/fieldvars.php:306 config/fieldvars.php:332
msgid "Host templates"
msgstr "Host templates"
-#: admin/monitoring.php:96 config/fieldvars.php:329
+#: admin/monitoring.php:105 config/fieldvars.php:333
msgid "Service templates"
msgstr "Service templates"
# mutdialog.php
-#: admin/mutdialog.php:57 admin/versioncheck.php:83
+#: admin/mutdialog.php:58 admin/versioncheck.php:93
msgid "Available"
msgstr "Available"
-#: admin/mutdialog.php:58
+#: admin/mutdialog.php:59
msgid "Selected"
msgstr "Selected"
-#: admin/nagioscfg.php:105
+#: admin/nagioscfg.php:121
msgid "Nagios main configuration file"
msgstr "Nagios main configuration file"
-#: admin/password.php:55
+#: admin/password.php:73
msgid "Password successfully modified"
msgstr "Password successfully modified"
-#: admin/password.php:72 admin/user.php:90
+#: admin/password.php:90 admin/user.php:125
msgid "Password too short or password fields do not match!"
msgstr "Password too short or password fields do not match!"
-#: admin/password.php:78
+#: admin/password.php:96
msgid "The old password is invalid"
msgstr "The old password is invalid"
-#: admin/password.php:97 admin/settings.php:310 config/fieldvars.php:58
+#: admin/password.php:115 admin/settings.php:334 config/fieldvars.php:59
msgid "Save"
msgstr "Save"
-#: admin/password.php:100
+#: admin/password.php:118
msgid "The new passwords don not match!"
msgstr "The new passwords don not match!"
-#: admin/password.php:101
+#: admin/password.php:119
msgid "The new password is too short - use at least 6 characters!"
msgstr "The new password is too short - use at least 6 characters!"
# hosttemplates.php
-#: admin/servicedependencies.php:72
+#: admin/servicedependencies.php:176
msgid "New service dependency inserted:"
msgstr "New service dependency inserted:"
-#: admin/servicedependencies.php:75
+#: admin/servicedependencies.php:179
msgid "Service dependency modified:"
msgstr "Service dependency modified:"
-#: admin/servicedependencies.php:313 admin/servicedependencies.php:704
+#: admin/servicedependencies.php:417 admin/servicedependencies.php:758
msgid "Define service dependencies (servicedependencies.cfg)"
msgstr "Define service dependencies (servicedependencies.cfg)"
-#: admin/servicedependencies.php:706 config/fieldvars.php:247
+#: admin/servicedependencies.php:760 config/fieldvars.php:252
msgid "Dependent services"
msgstr "Dependent services"
# hosttemplates.php
-#: admin/serviceescalations.php:71
+#: admin/serviceescalations.php:157
msgid "New service escalation inserted:"
msgstr "New service escalation inserted:"
-#: admin/serviceescalations.php:74
+#: admin/serviceescalations.php:160
msgid "Service escalation modified:"
msgstr "Service escalation modified:"
-#: admin/serviceescalations.php:256 admin/serviceescalations.php:555
+#: admin/serviceescalations.php:342 admin/serviceescalations.php:601
msgid "Define service escalation (serviceescalations.cfg)"
msgstr "Define service escalation (serviceescalations.cfg)"
# hosttemplates.php
-#: admin/serviceextinfo.php:64
+#: admin/serviceextinfo.php:108
msgid "New service extended information inserted:"
msgstr "New service extended information inserted:"
-#: admin/serviceextinfo.php:68
+#: admin/serviceextinfo.php:112
msgid "Service extended information modified:"
msgstr "Service extended information modified:"
-#: admin/serviceextinfo.php:104 admin/serviceextinfo.php:214
+#: admin/serviceextinfo.php:148 admin/serviceextinfo.php:245
msgid "Define service extended information (serviceextinfo.cfg)"
msgstr "Define service extended information (serviceextinfo.cfg)"
-#: admin/serviceextinfo.php:215
+#: admin/serviceextinfo.php:246
msgid "Hostname"
msgstr "Hostname"
-#: admin/serviceextinfo.php:216
+#: admin/serviceextinfo.php:247
msgid "Service"
msgstr "Service"
# hosttemplates.php
-#: admin/servicegroups.php:63
+#: admin/servicegroups.php:118
msgid "New service group inserted:"
msgstr "New service group inserted:"
-#: admin/servicegroups.php:66
+#: admin/servicegroups.php:121
msgid "Service group modified:"
msgstr "Service group modified:"
-#: admin/servicegroups.php:149 admin/servicegroups.php:229
+#: admin/servicegroups.php:204 admin/servicegroups.php:272
msgid "Define service groups (servicegroups.cfg)"
msgstr "Define service groups (servicegroups.cfg)"
-#: admin/servicegroups.php:170
+#: admin/servicegroups.php:221
msgid "Attention, no services defined!"
msgstr "Attention, no services defined!"
-#: admin/servicegroups.php:230
+#: admin/servicegroups.php:273
msgid "Service group"
msgstr "Service group"
# hosttemplates.php
-#: admin/services.php:96
+#: admin/services.php:237
msgid "New service inserted:"
msgstr "New service inserted:"
-#: admin/services.php:99
+#: admin/services.php:240
msgid "Service modified:"
msgstr "Service modified:"
-#: admin/services.php:251 admin/services.php:281
-#: functions/prepend_content.php:460
+#: admin/services.php:397 admin/services.php:426
+#: functions/prepend_content.php:505
msgid "Service file deleted:"
msgstr "Service file deleted:"
-#: admin/services.php:403 admin/services.php:704
+#: admin/services.php:546 admin/services.php:814
msgid "Define services (services.cfg)"
msgstr "Define services (services.cfg)"
-#: admin/services.php:488
+#: admin/services.php:626
msgid "Attention, no hosts or hostgroups defined!"
msgstr "Attention, no hosts or hostgroups defined!"
-#: admin/services.php:543
+#: admin/services.php:676
msgid "Attention, no check commands defined!"
msgstr "Attention, no check commands defined!"
-#: admin/services.php:613
+#: admin/services.php:726
msgid "Attention, no contacts or contact groups defined!"
msgstr "Attention, no contacts or contact groups defined!"
-#: admin/services.php:706
+#: admin/services.php:816 config/fieldvars.php:221
msgid "Service name"
msgstr "Service name"
-#: admin/services.php:708 admin/services.php:732
+#: admin/services.php:818 admin/services.php:844
msgid "All configs"
msgstr "All configs"
# hosttemplates.php
-#: admin/servicetemplates.php:97
+#: admin/servicetemplates.php:229
msgid "New service template inserted:"
msgstr "New service template inserted:"
-#: admin/servicetemplates.php:100
+#: admin/servicetemplates.php:232
msgid "Service template modified:"
msgstr "Service template modified:"
-#: admin/servicetemplates.php:341 admin/servicetemplates.php:623
+#: admin/servicetemplates.php:472 admin/servicetemplates.php:714
msgid "Define service templates (servicetemplates.cfg)"
msgstr "Define service templates (servicetemplates.cfg)"
-#: admin/servicetemplates.php:624 config/fieldvars.php:124
-#: config/fieldvars.php:225
+#: admin/servicetemplates.php:715 config/fieldvars.php:127
+#: config/fieldvars.php:230
msgid "Template name"
msgstr "Template name"
-#: admin/servicetemplates.php:625 config/fieldvars.php:212
+#: admin/servicetemplates.php:716 config/fieldvars.php:215
msgid "Service description"
msgstr "Service description"
-#: admin/settings.php:111
+#: admin/settings.php:146
msgid "Curl module not loaded, Proxy will be deactivated!"
msgstr "Curl module not loaded, Proxy will be deactivated!"
-#: admin/settings.php:136
+#: admin/settings.php:172
msgid "An error occured while writing settings to database:"
msgstr "An error occured while writing settings to database:"
-#: admin/settings.php:187 functions/prepend_adm.php:150
+#: admin/settings.php:223 functions/prepend_adm.php:151
msgid ""
"Error setting the correct locale. Please report this error with the "
"associated output of 'locale -a'"
@@ -1203,120 +1214,128 @@ msgstr ""
"Error setting the correct locale. Please report this error with the "
"associated output of 'locale -a'"
-#: admin/settings.php:195
+#: admin/settings.php:231
msgid "Settings were changed"
msgstr "Settings were changed"
-#: admin/settings.php:197
+#: admin/settings.php:233
msgid "An error occured while writing settings.php. Please check permissions!"
msgstr "An error occured while writing settings.php. Please check permissions!"
-#: admin/settings.php:201
+#: admin/settings.php:237
msgid "is not writeable, please check permissions!"
msgstr "is not writeable, please check permissions!"
-#: admin/settings.php:208
+#: admin/settings.php:244
msgid "Configure Settings"
msgstr "Configure Settings"
-#: admin/settings.php:213
+#: admin/settings.php:249
msgid "Change your current NagiosQL settings (e.g. Database user, Language)."
msgstr "Change your current NagiosQL settings (e.g. Database user, Language)."
-#: admin/settings.php:218
+#: admin/settings.php:252
msgid "Path"
msgstr "Path"
-#: admin/settings.php:219
+#: admin/settings.php:253
msgid "Temporary Directory"
msgstr "Temporary Directory"
-#: admin/settings.php:221
+#: admin/settings.php:255
msgid "Server protocol"
msgstr "Server protocol"
-#: admin/settings.php:244
+#: admin/settings.php:277
msgid "Encoding"
msgstr "Encoding"
-#: admin/settings.php:249
+#: admin/settings.php:280
msgid "Database"
msgstr "Database"
-#: admin/settings.php:250
+#: admin/settings.php:281
msgid "MySQL Server"
msgstr "MySQL Server"
-#: admin/settings.php:252
+#: admin/settings.php:283
msgid "MySQL Server Port"
msgstr "MySQL Server Port"
-#: admin/settings.php:254 install/step2.php:66
+#: admin/settings.php:285 install/step2.php:71
msgid "Database name"
msgstr "Database name"
-#: admin/settings.php:256
+#: admin/settings.php:287
msgid "Database user"
msgstr "Database user"
-#: admin/settings.php:258
+#: admin/settings.php:289
msgid "Database password"
msgstr "Database password"
-#: admin/settings.php:263
+#: admin/settings.php:292
msgid "Security"
msgstr "Security"
-#: admin/settings.php:264
+#: admin/settings.php:293
msgid "Session auto logoff time"
msgstr "Session auto logoff time"
-#: admin/settings.php:266
+#: admin/settings.php:295
msgid "Authentication type"
msgstr "Authentication type"
-#: admin/settings.php:271
+#: admin/settings.php:298
msgid "Common"
msgstr "Common"
-#: admin/settings.php:272
+#: admin/settings.php:299
msgid "Data lines per page"
msgstr "Data lines per page"
-#: admin/settings.php:274
+#: admin/settings.php:301
msgid "Selection method"
msgstr "Selection method"
-#: admin/settings.php:279
+#: admin/settings.php:304
msgid "Template warn message"
msgstr "Template warn message"
-#: admin/settings.php:288
+#: admin/settings.php:311
msgid "Online version check"
msgstr "Online version check"
-#: admin/settings.php:296
+#: admin/settings.php:317
msgid "Proxyserver"
msgstr "Proxyserver"
-#: admin/settings.php:301
+#: admin/settings.php:323
msgid "Proxy Address"
msgstr "Proxy Address"
-#: admin/settings.php:303
+#: admin/settings.php:325
msgid "Proxy Username (optional)"
msgstr "Proxy Username (optional)"
-#: admin/settings.php:305
+#: admin/settings.php:327
msgid "Proxy Password (optional)"
msgstr "Proxy Password (optional)"
-#: admin/specials.php:35
+#: admin/settings.php:330
+msgid "Performance options"
+msgstr "Performance options"
+
+#: admin/settings.php:331
+msgid "Show object parents"
+msgstr "Show object parents"
+
+#: admin/specials.php:44
msgid "Misc commands"
msgstr "Misc commands"
# specials.php
-#: admin/specials.php:38
+#: admin/specials.php:47
msgid ""
"Define host and service dependencies, host and service escalations as well "
"as host and service additional data."
@@ -1324,39 +1343,39 @@ msgstr ""
"Define host and service dependencies, host and service escalations as well "
"as host and service additional data."
-#: admin/specials.php:56
+#: admin/specials.php:65
msgid "Host dependencies"
msgstr "Host dependencies"
-#: admin/specials.php:64
+#: admin/specials.php:73
msgid "Host escalations"
msgstr "Host escalations"
-#: admin/specials.php:72
+#: admin/specials.php:81
msgid "Host ext. info"
msgstr "Host ext. info"
-#: admin/specials.php:80
+#: admin/specials.php:89
msgid "Service dependencies"
msgstr "Service dependencies"
-#: admin/specials.php:88
+#: admin/specials.php:97
msgid "Service escalations"
msgstr "Service escalations"
-#: admin/specials.php:96
+#: admin/specials.php:105
msgid "Service ext. info"
msgstr "Service ext. info"
-#: admin/support.php:39
+#: admin/support.php:56
msgid "NagiosQL support page"
msgstr "NagiosQL support page"
-#: admin/support.php:49
+#: admin/support.php:66
msgid "Support contact information"
msgstr "Support contact information"
-#: admin/support.php:50
+#: admin/support.php:67
msgid ""
"For questions, the online support forum or contact information visit our "
"website:"
@@ -1364,15 +1383,15 @@ msgstr ""
"For questions, the online support forum or contact information visit our "
"website:"
-#: admin/support.php:52
+#: admin/support.php:69
msgid "NagiosQL on sourceforge"
msgstr "NagiosQL on sourceforge"
-#: admin/support.php:56
+#: admin/support.php:73
msgid "Donate to support NagiosQL"
msgstr "Donate to support NagiosQL"
-#: admin/support.php:57
+#: admin/support.php:74
msgid ""
"If you like NagiosQL and it simplifies your daily work, then you may want to "
"support the project by making a donation. This helps us to keep NagiosQL "
@@ -1382,16 +1401,16 @@ msgstr ""
"support the project by making a donation. This helps us to keep NagiosQL "
"alive and to cover our costs. Thank you for your donation!"
-#: admin/support.php:60 functions/NagVisualClass.php:230
-#: functions/NagVisualClass.php:231
+#: admin/support.php:77 functions/NagVisualClass.php:134
+#: functions/NagVisualClass.php:135
msgid "Donate for NagiosQL on sourceforge"
msgstr "Donate for NagiosQL on sourceforge"
-#: admin/support.php:64
+#: admin/support.php:81
msgid "Translation services"
msgstr "Translation services"
-#: admin/support.php:65
+#: admin/support.php:82
msgid ""
"NagiosQL was translated into various languages​​. Since some translators are "
"no longer available in later versions, there may be untranslated words or "
@@ -1407,15 +1426,15 @@ msgstr ""
"simply feasible online - we use an open translation service where you can "
"register for free at any time:"
-#: admin/support.php:70
+#: admin/support.php:87
msgid "Transifex translation service"
msgstr "Transifex translation service"
-#: admin/support.php:74
+#: admin/support.php:91
msgid "GIT software repository"
msgstr "GIT software repository"
-#: admin/support.php:75
+#: admin/support.php:92
msgid ""
"The NagiosQL sources are available on GitLab. There you will always find the "
"latest bugfixes and changes as well as older branches."
@@ -1423,15 +1442,15 @@ msgstr ""
"The NagiosQL sources are available on GitLab. There you will always find the "
"latest bugfixes and changes as well as older branches."
-#: admin/support.php:77
+#: admin/support.php:94
msgid "GitLab"
msgstr "GitLab"
-#: admin/support.php:81
+#: admin/support.php:98
msgid "Version check"
msgstr "Version check"
-#: admin/support.php:83
+#: admin/support.php:100
msgid ""
"The online version check is not enabled. You can enable it on the settings "
"page."
@@ -1439,7 +1458,7 @@ msgstr ""
"The online version check is not enabled. You can enable it on the settings "
"page."
-#: admin/support.php:86
+#: admin/support.php:103
msgid ""
"The online version check connects the NagiosQL page to find out, if your "
"version is still up to date."
@@ -1447,102 +1466,105 @@ msgstr ""
"The online version check connects the NagiosQL page to find out, if your "
"version is still up to date."
-#: admin/support.php:98
+#: admin/support.php:112
+msgid "GIT code version"
+msgstr "GIT code version"
+
+#: admin/support.php:117
msgid "Environment check"
msgstr "Environment check"
-#: admin/support.php:100 admin/support.php:109 admin/support.php:121
-#: admin/support.php:129 admin/support.php:138 admin/support.php:148
-#: admin/support.php:163 admin/support.php:176 admin/support.php:185
-#: admin/support.php:194 admin/support.php:203 admin/support.php:213
-#: admin/support.php:263 admin/support.php:278 admin/support.php:299
-#: admin/support.php:337 admin/support.php:360 admin/support.php:366
-#: admin/support.php:392 admin/support.php:396 admin/support.php:415
-#: admin/support.php:418 admin/support.php:421 admin/support.php:435
-#: admin/support.php:440 admin/support.php:443 admin/support.php:448
-#: admin/support.php:460 admin/support.php:465 admin/support.php:484
-#: admin/support.php:492 admin/support.php:589 admin/support.php:592
-#: admin/support.php:613 admin/support.php:642 admin/support.php:677
-#: install/functions/NagInstallClass.php:338
-#: install/functions/NagInstallClass.php:370
-#: install/functions/NagInstallClass.php:406
+#: admin/support.php:119 admin/support.php:128 admin/support.php:140
+#: admin/support.php:148 admin/support.php:157 admin/support.php:167
+#: admin/support.php:182 admin/support.php:195 admin/support.php:204
+#: admin/support.php:213 admin/support.php:222 admin/support.php:232
+#: admin/support.php:283 admin/support.php:298 admin/support.php:319
+#: admin/support.php:354 admin/support.php:385 admin/support.php:415
+#: admin/support.php:434 admin/support.php:437 admin/support.php:440
+#: admin/support.php:454 admin/support.php:459 admin/support.php:462
+#: admin/support.php:467 admin/support.php:479 admin/support.php:484
+#: admin/support.php:501 admin/support.php:509 admin/support.php:606
+#: admin/support.php:609 admin/support.php:630 admin/support.php:659
+#: admin/support.php:694 install/functions/NagInstallClass.php:184
+#: install/functions/NagInstallClass.php:216
+#: install/functions/NagInstallClass.php:252
+#: install/functions/NagInstallClass.php:329
+#: install/functions/NagInstallClass.php:337
+#: install/functions/NagInstallClass.php:359
+#: install/functions/NagInstallClass.php:383
+#: install/functions/NagInstallClass.php:395
+#: install/functions/NagInstallClass.php:462
#: install/functions/NagInstallClass.php:485
-#: install/functions/NagInstallClass.php:493
-#: install/functions/NagInstallClass.php:515
-#: install/functions/NagInstallClass.php:539
+#: install/functions/NagInstallClass.php:494
+#: install/functions/NagInstallClass.php:546
#: install/functions/NagInstallClass.php:551
+#: install/functions/NagInstallClass.php:583
#: install/functions/NagInstallClass.php:618
-#: install/functions/NagInstallClass.php:640
-#: install/functions/NagInstallClass.php:649
-#: install/functions/NagInstallClass.php:701
-#: install/functions/NagInstallClass.php:706
-#: install/functions/NagInstallClass.php:739
-#: install/functions/NagInstallClass.php:777
-#: install/functions/NagInstallClass.php:784
-#: install/functions/NagInstallClass.php:812
-#: install/functions/NagInstallClass.php:872
-#: install/functions/NagInstallClass.php:904
-#: install/functions/NagInstallClass.php:938
-#: install/functions/NagInstallClass.php:971
-#: install/functions/NagInstallClass.php:1010
-#: install/functions/NagInstallClass.php:1019
-#: install/functions/NagInstallClass.php:1062
-#: install/functions/NagInstallClass.php:1071 install/step1.php:229
-#: install/step1.php:242 install/step1.php:246 install/step1.php:255
-#: install/step1.php:264 install/step1.php:273 install/step1.php:282
-#: install/step1.php:291 install/step1.php:300 install/step3.php:90
-#: install/step3.php:179 install/step3.php:204
+#: install/functions/NagInstallClass.php:625
+#: install/functions/NagInstallClass.php:652
+#: install/functions/NagInstallClass.php:714
+#: install/functions/NagInstallClass.php:746
+#: install/functions/NagInstallClass.php:780
+#: install/functions/NagInstallClass.php:813
+#: install/functions/NagInstallClass.php:853
+#: install/functions/NagInstallClass.php:862
+#: install/functions/NagInstallClass.php:905
+#: install/functions/NagInstallClass.php:914 install/step1.php:246
+#: install/step1.php:259 install/step1.php:263 install/step1.php:272
+#: install/step1.php:281 install/step1.php:290 install/step1.php:299
+#: install/step1.php:308 install/step1.php:317 install/step3.php:98
+#: install/step3.php:187 install/step3.php:212
msgid "failed"
msgstr "failed"
-#: admin/support.php:101 admin/support.php:106 admin/support.php:118
-#: admin/support.php:126 admin/support.php:134 admin/support.php:144
-#: admin/support.php:160 admin/support.php:173 admin/support.php:182
-#: admin/support.php:191 admin/support.php:200 admin/support.php:210
-#: admin/support.php:255 admin/support.php:268 admin/support.php:283
-#: admin/support.php:292 admin/support.php:295 admin/support.php:334
-#: admin/support.php:340 admin/support.php:356 admin/support.php:372
-#: admin/support.php:388 admin/support.php:407 admin/support.php:410
-#: admin/support.php:425 admin/support.php:432 admin/support.php:457
-#: admin/support.php:469 admin/support.php:488 admin/support.php:584
-#: admin/support.php:600 admin/support.php:605 admin/support.php:610
-#: admin/support.php:619 admin/support.php:624 admin/support.php:630
-#: admin/support.php:635
+#: admin/support.php:120 admin/support.php:125 admin/support.php:137
+#: admin/support.php:145 admin/support.php:153 admin/support.php:163
+#: admin/support.php:179 admin/support.php:192 admin/support.php:201
+#: admin/support.php:210 admin/support.php:219 admin/support.php:229
+#: admin/support.php:275 admin/support.php:288 admin/support.php:303
+#: admin/support.php:312 admin/support.php:315 admin/support.php:351
+#: admin/support.php:357 admin/support.php:375 admin/support.php:379
+#: admin/support.php:391 admin/support.php:407 admin/support.php:411
+#: admin/support.php:426 admin/support.php:429 admin/support.php:444
+#: admin/support.php:451 admin/support.php:476 admin/support.php:488
+#: admin/support.php:505 admin/support.php:601 admin/support.php:617
+#: admin/support.php:622 admin/support.php:627 admin/support.php:636
+#: admin/support.php:641 admin/support.php:647 admin/support.php:652
msgid "ok"
msgstr "ok"
-#: admin/support.php:103
+#: admin/support.php:122
msgid "PHP version"
msgstr "PHP version"
-#: admin/support.php:110 admin/support.php:163
+#: admin/support.php:129 admin/support.php:182
msgid "Required:"
msgstr "Required:"
-#: admin/support.php:115 admin/support.php:123 admin/support.php:131
-#: admin/support.php:141 install/index.php:170 install/index.php:171
-#: install/index.php:172 install/index.php:173
+#: admin/support.php:134 admin/support.php:142 admin/support.php:150
+#: admin/support.php:160 install/index.php:171 install/index.php:172
+#: install/index.php:173 install/index.php:174
msgid "PHP module:"
msgstr "PHP module:"
-#: admin/support.php:153
+#: admin/support.php:172
msgid "MySQL version"
msgstr "MySQL version"
-#: admin/support.php:169 admin/support.php:178 admin/support.php:187
-#: admin/support.php:196
+#: admin/support.php:188 admin/support.php:197 admin/support.php:206
+#: admin/support.php:215
msgid "PHP ini settings:"
msgstr "PHP ini settings:"
-#: admin/support.php:206
+#: admin/support.php:225
msgid "Read/Write access:"
msgstr "Read/Write access:"
-#: admin/support.php:222
+#: admin/support.php:242
msgid "Config domain checks"
msgstr "Config domain checks"
-#: admin/support.php:223
+#: admin/support.php:243
msgid ""
"The checks below are based on your data domain and config domain settings. "
"To change the data domain, use the pull down menu in the upper right corner. "
@@ -1556,180 +1578,183 @@ msgstr ""
"config domain, use the data domain menu and select a different config domain "
"value."
-#: admin/support.php:229
+#: admin/support.php:249
msgid "Config domain name"
msgstr "Config domain name"
-#: admin/support.php:231
+#: admin/support.php:251
msgid "Connection type"
msgstr "Connection type"
-#: admin/support.php:252
+#: admin/support.php:272
msgid "Connection check"
msgstr "Connection check"
-#: admin/support.php:295 admin/support.php:340 admin/support.php:418
-#: admin/support.php:436
+#: admin/support.php:315 admin/support.php:357 admin/support.php:437
+#: admin/support.php:455
msgid "readonly"
msgstr "readonly"
-#: admin/support.php:346 config/fieldvars.php:45
+#: admin/support.php:363 config/fieldvars.php:46
msgid "Nagios process file"
msgstr "Nagios process file"
-#: admin/support.php:361 admin/support.php:392 admin/support.php:415
-#: admin/support.php:444 admin/support.php:448 admin/support.php:465
-#: admin/support.php:493
-msgid "file is missed"
-msgstr "file is missed"
+#: admin/support.php:380 admin/support.php:411
+msgid "file is missed or not used"
+msgstr "file is missed or not used"
-#: admin/support.php:367 admin/support.php:397
+#: admin/support.php:386 admin/support.php:416
msgid "Nagios daemon is not running"
msgstr "Nagios daemon is not running"
-#: admin/support.php:372 admin/support.php:425 admin/support.php:469
+#: admin/support.php:391 admin/support.php:444 admin/support.php:488
msgid "not used with FTP"
msgstr "not used with FTP"
-#: admin/support.php:396 admin/support.php:410 admin/support.php:440
+#: admin/support.php:415 admin/support.php:429 admin/support.php:459
msgid "demon dead"
msgstr "demon dead"
-#: admin/support.php:402 config/fieldvars.php:43
+#: admin/support.php:421 config/fieldvars.php:44
msgid "Nagios command file"
msgstr "Nagios command file"
-#: admin/support.php:452 config/fieldvars.php:44
+#: admin/support.php:434 admin/support.php:463 admin/support.php:467
+#: admin/support.php:484 admin/support.php:510
+msgid "file is missed"
+msgstr "file is missed"
+
+#: admin/support.php:471 config/fieldvars.php:45
msgid "Nagios binary file"
msgstr "Nagios binary file"
# mutdialog.php
-#: admin/support.php:461 admin/support.php:485
+#: admin/support.php:480 admin/support.php:502
msgid "not executable"
msgstr "not executable"
# config_class.php
-#: admin/support.php:501
+#: admin/support.php:517
msgid "Verify configuration files and demon configuration"
msgstr "Verify configuration files and demon configuration"
-#: admin/support.php:502
+#: admin/support.php:518
msgid "Configuration name"
msgstr "Configuration name"
# fieldvars.php
-#: admin/support.php:503
+#: admin/support.php:519
msgid "Used in data domain"
msgstr "Used in data domain"
-#: admin/support.php:504
+#: admin/support.php:520
msgid "Included in demon configuration"
msgstr "Included in demon configuration"
-#: admin/support.php:587
+#: admin/support.php:604
msgid "not used"
msgstr "not used"
-#: admin/support.php:593
+#: admin/support.php:610
msgid "cfg definition missed"
msgstr "cfg definition missed"
-#: admin/support.php:611 admin/support.php:625 admin/support.php:636
+#: admin/support.php:628 admin/support.php:642 admin/support.php:653
msgid "cfg definition missed, but actually not used"
msgstr "cfg definition missed, but actually not used"
-#: admin/support.php:614
+#: admin/support.php:631
msgid "wrong base path:"
msgstr "wrong base path:"
-#: admin/support.php:643
+#: admin/support.php:660
msgid "cfg file not readable"
msgstr "cfg file not readable"
-#: admin/support.php:676
+#: admin/support.php:693
msgid "Not used"
msgstr "Not used"
-#: admin/support.php:678
+#: admin/support.php:695
msgid "unused - please delete!"
msgstr "unused - please delete!"
-#: admin/templatedefinitions.php:260
+#: admin/templatedefinitions.php:272
msgid "Up"
msgstr "Up"
-#: admin/templatedefinitions.php:264
+#: admin/templatedefinitions.php:278
msgid "Down"
msgstr "Down"
-#: admin/timedefinitions.php:176 admin/variabledefinitions.php:143
-#: config/fieldvars.php:77
+#: admin/timedefinitions.php:177 admin/variabledefinitions.php:156
+#: config/fieldvars.php:79
msgid "Modify"
msgstr "Modify"
-#: admin/timeperiods.php:62
+#: admin/timeperiods.php:111
msgid "New time period inserted:"
msgstr "New time period inserted:"
-#: admin/timeperiods.php:65
+#: admin/timeperiods.php:114
msgid "Time period modified:"
msgstr "Time period modified:"
-#: admin/timeperiods.php:173 admin/timeperiods.php:252
+#: admin/timeperiods.php:226 admin/timeperiods.php:294
msgid "Time period definitions (timeperiods.cfg)"
msgstr "Time period definitions (timeperiods.cfg)"
-#: admin/timeperiods.php:230
+#: admin/timeperiods.php:271
msgid "Please insert a time definition and a time range"
msgstr "Please insert a time definition and a time range"
# timeperiod.php
-#: admin/timeperiods.php:253 config/fieldvars.php:92
+#: admin/timeperiods.php:295 config/fieldvars.php:95
msgid "Time period"
msgstr "Time period"
# tools.php
-#: admin/tools.php:35
+#: admin/tools.php:37
msgid "Different tools"
msgstr "Different tools"
-#: admin/tools.php:36
+#: admin/tools.php:38
msgid ""
"Useful functions for data import, main configuration, daemon control, etc."
msgstr ""
"Useful functions for data import, main configuration, daemon control, etc."
-#: admin/user.php:74
+#: admin/user.php:109
msgid "New user added:"
msgstr "New user added:"
-#: admin/user.php:128 admin/user.php:176
+#: admin/user.php:155 admin/user.php:203
msgid "User administration"
msgstr "User administration"
-#: admin/user.php:132
+#: admin/user.php:159
msgid "The passwords do not match!"
msgstr "The passwords do not match!"
-#: admin/user.php:133
+#: admin/user.php:160
msgid "Please fill in the password"
msgstr "Please fill in the password"
-#: admin/user.php:134
+#: admin/user.php:161
msgid "The password is too short - use at least 6 characters!"
msgstr "The password is too short - use at least 6 characters!"
-#: admin/user.php:135
+#: admin/user.php:162
msgid "Webserver authentification"
msgstr "Webserver authentification"
-#: admin/user.php:177 config/fieldvars.php:24 index.php:51
+#: admin/user.php:204 config/fieldvars.php:24 index.php:53
msgid "Username"
msgstr "Username"
-#: admin/verify.php:50 admin/verify.php:157 functions/NagConfigClass.php:1115
-#: functions/NagConfigClass.php:1117 functions/NagConfigClass.php:1357
-#: functions/NagConfigClass.php:1359
+#: admin/verify.php:74 admin/verify.php:173 functions/NagConfigClass.php:1196
+#: functions/NagConfigClass.php:1198 functions/NagConfigClass.php:2506
+#: functions/NagConfigClass.php:2508
msgid ""
"Writing of the configuration failed - no dataset or not activated dataset "
"found"
@@ -1737,81 +1762,73 @@ msgstr ""
"Writing of the configuration failed - no dataset or not activated dataset "
"found"
-#: admin/verify.php:62
+#: admin/verify.php:86
msgid "Write host configurations"
msgstr "Write host configurations"
-#: admin/verify.php:69 admin/verify.php:91
+#: admin/verify.php:93 admin/verify.php:115
msgid "No configuration items defined!"
msgstr "No configuration items defined!"
-#: admin/verify.php:84
+#: admin/verify.php:108
msgid "Write service configurations"
msgstr "Write service configurations"
-#: admin/verify.php:102 admin/verify.php:117 admin/verify.php:132
-#: admin/verify.php:147 admin/verify.php:202 admin/verify.php:217
-#: admin/verify.php:232 admin/verify.php:247 admin/verify.php:262
-#: admin/verify.php:277 admin/verify.php:292
+#: admin/verify.php:125 admin/verify.php:138 admin/verify.php:151
+#: admin/verify.php:164 admin/verify.php:217 admin/verify.php:230
+#: admin/verify.php:243 admin/verify.php:256 admin/verify.php:269
+#: admin/verify.php:282 admin/verify.php:295
msgid "No dataset or no activated dataset found - empty configuration written"
msgstr "No dataset or no activated dataset found - empty configuration written"
-#: admin/verify.php:311
+#: admin/verify.php:313
msgid "Cannot find the Nagios binary or no execute permissions!"
msgstr "Cannot find the Nagios binary or no execute permissions!"
-#: admin/verify.php:326
+#: admin/verify.php:328
msgid "Remote execution (FTP SITE EXEC) is not supported on your system!"
msgstr "Remote execution (FTP SITE EXEC) is not supported on your system!"
-#: admin/verify.php:345
+#: admin/verify.php:346
msgid "Remote execution of nagios verify command failed (remote SSH)!"
msgstr "Remote execution of nagios verify command failed (remote SSH)!"
-#: admin/verify.php:350
+#: admin/verify.php:351
msgid "Nagios binary or configuration file not found (remote SSH)!"
msgstr "Nagios binary or configuration file not found (remote SSH)!"
-#: admin/verify.php:388
+#: admin/verify.php:387
msgid "Nagios daemon successfully restarted"
msgstr "Nagios daemon successfully restarted"
-#: admin/verify.php:390
+#: admin/verify.php:389
msgid "Restart command successfully send to Nagios"
msgstr "Restart command successfully sent to Nagios"
-#: admin/verify.php:394 admin/verify.php:402
+#: admin/verify.php:393 admin/verify.php:401
msgid ""
"Restart failed - Nagios command file not found or no execute permissions"
msgstr ""
"Restart failed - Nagios command file not found or no execute permissions"
-#: admin/verify.php:397
+#: admin/verify.php:396
msgid "Nagios command file not found or no write permissions!"
msgstr "Nagios command file not found or no write permissions!"
-#: admin/verify.php:404
+#: admin/verify.php:403
msgid "Restart failed - Nagios command file not found or no rights to execute"
msgstr ""
"Restart failed - Nagios command file not found or no execute permissions"
-#: admin/verify.php:408
-msgid "Restart failed - Nagios daemon was not running"
-msgstr "Restart failed - Nagios daemon was not running"
-
-#: admin/verify.php:410
-msgid "Nagios daemon is not running, cannot send restart command!"
-msgstr "Nagios daemon is not running, cannot send restart command!"
-
-#: admin/verify.php:415
+#: admin/verify.php:407
msgid "Restart failed - FTP restrictions"
msgstr "Restart failed - FTP restrictions"
-#: admin/verify.php:417
+#: admin/verify.php:409
msgid "Nagios restart is not possible via FTP remote connection!"
msgstr "Nagios restart is not possible via FTP remote connection!"
-#: admin/verify.php:440
+#: admin/verify.php:431
msgid ""
"Restart failed - Nagios command file not found or no rights to execute "
"(remote SSH)!"
@@ -1819,57 +1836,57 @@ msgstr ""
"Restart failed - Nagios command file not found or no rights to execute "
"(remote SSH)!"
-#: admin/verify.php:443
+#: admin/verify.php:434
msgid "Nagios daemon successfully restarted (remote SSH)"
msgstr "Nagios daemon successfully restarted (remote SSH)"
-#: admin/verify.php:445
+#: admin/verify.php:436
msgid "Restart command successfully send to Nagios (remote SSH)"
msgstr "Restart command successfully send to Nagios (remote SSH)"
-#: admin/verify.php:450
+#: admin/verify.php:441
msgid "Nagios command file not found (remote SSH)!"
msgstr "Nagios command file not found (remote SSH)!"
-#: admin/verify.php:458
+#: admin/verify.php:448
msgid "Check written configuration files"
msgstr "Check written configuration files"
-#: admin/verify.php:459
+#: admin/verify.php:449
msgid "Check configuration files:"
msgstr "Check configuration files:"
-#: admin/verify.php:460
+#: admin/verify.php:450
msgid "Restart Nagios:"
msgstr "Restart Nagios:"
-#: admin/verify.php:461
+#: admin/verify.php:451
msgid "Write monitoring data"
msgstr "Write monitoring data"
-#: admin/verify.php:462
+#: admin/verify.php:452
msgid "Write additional data"
msgstr "Write additional data"
-#: admin/verify.php:464
+#: admin/verify.php:454
msgid "Warning, always check the configuration files before restarting Nagios!"
msgstr ""
"Warning, always check the configuration files before restarting Nagios!"
-#: admin/verify.php:467 config/fieldvars.php:62
+#: admin/verify.php:457 config/fieldvars.php:63
msgid "Do it"
msgstr "Do it"
-#: admin/verify.php:498 admin/verify.php:542
+#: admin/verify.php:488 admin/verify.php:532
msgid "Nagios written configuration files checked - Warnings/Errors:"
msgstr "Nagios written configuration files checked - Warnings/Errors:"
# config_class.php
-#: admin/verify.php:504 admin/verify.php:547
+#: admin/verify.php:494 admin/verify.php:537
msgid "Written configuration files are valid, Nagios can be restarted!"
msgstr "Written configuration files are valid. Nagios can be restarted!"
-#: admin/verify.php:510
+#: admin/verify.php:500
msgid ""
"The configuration could not be tested successfully. The Nagios binary may "
"have crashed during the test. Please repeat the test or try using the "
@@ -1881,23 +1898,27 @@ msgstr ""
"commandline to test. A running Nagios service should not be restarted "
"because the configuration may be invalid."
-#: admin/versioncheck.php:69 admin/versioncheck.php:79
+#: admin/versioncheck.php:90
msgid "check proxy settings"
msgstr "check proxy settings"
-#: admin/versioncheck.php:82
+#: admin/versioncheck.php:92
msgid "Installed"
msgstr "Installed"
-#: admin/versioncheck.php:84 config/fieldvars.php:187
+#: admin/versioncheck.php:94 config/fieldvars.php:190
msgid "Information"
msgstr "Information"
-#: admin/versioncheck.php:106
+#: admin/versioncheck.php:122 admin/versioncheck.php:125
msgid "You already have the latest version installed"
msgstr "You already have the latest version installed"
-#: admin/versioncheck.php:109
+#: admin/versioncheck.php:126
+msgid "new GIT hotfix version available:"
+msgstr "new GIT hotfix version available:"
+
+#: admin/versioncheck.php:130
msgid ""
"You are using an old NagiosQL version. Please update to the latest stable "
"version"
@@ -1905,16 +1926,16 @@ msgstr ""
"You are using an old NagiosQL version. Please update to the latest stable "
"version"
-#: admin/versioncheck.php:114
+#: admin/versioncheck.php:135
msgid "You are using a newer development version without official support"
msgstr "You are using a newer development version without official support"
# fieldvars.php
-#: config/fieldvars.php:20 functions/prepend_adm.php:538
+#: config/fieldvars.php:20 functions/prepend_adm.php:533
msgid "Domain"
msgstr "Domain"
-#: config/fieldvars.php:22 config/fieldvars.php:30
+#: config/fieldvars.php:22 config/fieldvars.php:31
msgid "Server name"
msgstr "Server name"
@@ -1922,711 +1943,727 @@ msgstr "Server name"
msgid "Method"
msgstr "Method"
-#: config/fieldvars.php:25 index.php:52
+#: config/fieldvars.php:25 index.php:54
msgid "Password"
msgstr "Password"
-#: config/fieldvars.php:27
+#: config/fieldvars.php:26
+msgid "SSH Port number"
+msgstr "SSH Port number"
+
+#: config/fieldvars.php:28
msgid "Directory with SSH key pair"
msgstr "Directory with SSH key pair"
-#: config/fieldvars.php:29
+#: config/fieldvars.php:30
msgid "Use encrypted FTP (FTPS)"
msgstr "Use encrypted FTP (FTPS)"
-#: config/fieldvars.php:32
+#: config/fieldvars.php:33
msgid "Configuration directories"
msgstr "Configuration directories"
-#: config/fieldvars.php:34
+#: config/fieldvars.php:35
msgid "Nagios configuration files and directories"
msgstr "Nagios configuration files and directories"
-#: config/fieldvars.php:35
+#: config/fieldvars.php:36
msgid "Base directory"
msgstr "Base directory"
-#: config/fieldvars.php:36
+#: config/fieldvars.php:37
msgid "Host directory"
msgstr "Host directory"
-#: config/fieldvars.php:37
+#: config/fieldvars.php:38
msgid "Service directory"
msgstr "Service directory"
-#: config/fieldvars.php:38
+#: config/fieldvars.php:39
msgid "Backup directory"
msgstr "Backup directory"
-#: config/fieldvars.php:39
+#: config/fieldvars.php:40
msgid "Host backup directory"
msgstr "Host backup directory"
-#: config/fieldvars.php:41
+#: config/fieldvars.php:42
msgid "Service backup directory"
msgstr "Service backup directory"
-#: config/fieldvars.php:42
+#: config/fieldvars.php:43
msgid "Picture base directory"
msgstr "Picture base directory"
-#: config/fieldvars.php:47
+#: config/fieldvars.php:48
msgid "Nagios cgi file"
msgstr "Nagios cgi file"
-#: config/fieldvars.php:48
+#: config/fieldvars.php:49
msgid "Nagios resource file"
msgstr "Nagios resource file"
-#: config/fieldvars.php:50
+#: config/fieldvars.php:51
msgid "Use common domain"
msgstr "Use common domain"
-#: config/fieldvars.php:52
+#: config/fieldvars.php:53
msgid "Decode UTF8 data in config files"
msgstr "Decode UTF8 data in config files"
-#: config/fieldvars.php:53
+#: config/fieldvars.php:54
msgid "Access key holes"
msgstr "Access keyholes"
# user.php
-#: config/fieldvars.php:54
+#: config/fieldvars.php:55
msgid "Access keys"
msgstr "Access keys"
-#: config/fieldvars.php:56
+#: config/fieldvars.php:57
msgid "Registered"
msgstr "Registered"
-#: config/fieldvars.php:60
+#: config/fieldvars.php:61
msgid "Function"
msgstr "Function"
-#: config/fieldvars.php:61
+#: config/fieldvars.php:62
msgid "Marked"
msgstr "Marked"
-#: config/fieldvars.php:63
+#: config/fieldvars.php:64
msgid "Add"
msgstr "Add"
-#: config/fieldvars.php:64
+#: config/fieldvars.php:65
msgid "Form check"
msgstr "Form check"
-#: config/fieldvars.php:65
+#: config/fieldvars.php:66
msgid "Secure question"
msgstr "Secure question"
-#: config/fieldvars.php:66 functions/NagContentClass.php:172
-#: functions/NagContentClass.php:177
+#: config/fieldvars.php:67 functions/NagContentClass.php:167
+#: functions/NagContentClass.php:172
msgid "Yes"
msgstr "Yes"
-#: config/fieldvars.php:67 functions/NagContentClass.php:170
-#: functions/NagContentClass.php:175
+#: config/fieldvars.php:68 functions/NagContentClass.php:165
+#: functions/NagContentClass.php:170
msgid "No"
msgstr "No"
-#: config/fieldvars.php:68
+#: config/fieldvars.php:69
+msgid "All"
+msgstr "All"
+
+#: config/fieldvars.php:70
msgid "Time"
msgstr "Time"
-#: config/fieldvars.php:69
+#: config/fieldvars.php:71
msgid "User"
msgstr "User"
-#: config/fieldvars.php:70
+#: config/fieldvars.php:72
msgid "IP Address"
msgstr "IP Address"
-#: config/fieldvars.php:71 functions/NagImportClass.php:350
-#: functions/NagImportClass.php:355 functions/NagImportClass.php:419
-#: functions/NagImportClass.php:425 functions/NagImportClass.php:432
-#: functions/NagImportClass.php:437
+#: config/fieldvars.php:73 functions/NagImportClass.php:354
+#: functions/NagImportClass.php:359 functions/NagImportClass.php:425
+#: functions/NagImportClass.php:431 functions/NagImportClass.php:438
+#: functions/NagImportClass.php:443
msgid "Entry"
msgstr "Entry"
-#: config/fieldvars.php:72
+#: config/fieldvars.php:74
msgid "From"
msgstr "From"
-#: config/fieldvars.php:73
+#: config/fieldvars.php:75
msgid "To"
msgstr "To"
-#: config/fieldvars.php:74
+#: config/fieldvars.php:76
msgid "Delete log entries"
msgstr "Delete log entries"
-#: config/fieldvars.php:75 config/fieldvars.php:88 config/fieldvars.php:184
+#: config/fieldvars.php:77 config/fieldvars.php:90 config/fieldvars.php:187
msgid "Copy"
msgstr "Copy"
-#: config/fieldvars.php:78
+#: config/fieldvars.php:80
msgid "Confirm password"
msgstr "Confirm password"
# password.php
-#: config/fieldvars.php:79
+#: config/fieldvars.php:81
msgid "Old password"
msgstr "Old password"
-#: config/fieldvars.php:80 config/fieldvars.php:320
+#: config/fieldvars.php:82 config/fieldvars.php:324
msgid "New password"
msgstr "New password"
-#: config/fieldvars.php:81
+#: config/fieldvars.php:83
msgid "Change password"
msgstr "Change password"
-#: config/fieldvars.php:82
+#: config/fieldvars.php:84
msgid "Menu page"
msgstr "Menu page"
-#: config/fieldvars.php:83
+#: config/fieldvars.php:85
msgid "Search string"
msgstr "Search string"
-#: config/fieldvars.php:86 config/fieldvars.php:188
+#: config/fieldvars.php:88 config/fieldvars.php:191
msgid "Write config file"
msgstr "Write config file"
-#: config/fieldvars.php:89
+#: config/fieldvars.php:91
msgid "Command"
msgstr "Command"
-#: config/fieldvars.php:91
+#: config/fieldvars.php:93
msgid "Command type"
msgstr "Command type"
-#: config/fieldvars.php:93
+#: config/fieldvars.php:94
+msgid "Help text"
+msgstr "Help text"
+
+#: config/fieldvars.php:96
msgid "Exclude"
msgstr "Exclude"
-#: config/fieldvars.php:94
+#: config/fieldvars.php:97
msgid "Include"
msgstr "Include"
-#: config/fieldvars.php:95
+#: config/fieldvars.php:98
msgid "Time definitions"
msgstr "Time definitions"
-#: config/fieldvars.php:96
+#: config/fieldvars.php:99
msgid "Weekday"
msgstr "Weekday"
-#: config/fieldvars.php:97
+#: config/fieldvars.php:100
msgid "Time range"
msgstr "Time range"
-#: config/fieldvars.php:98
+#: config/fieldvars.php:101
msgid "Time definition"
msgstr "Time definition"
-#: config/fieldvars.php:99
+#: config/fieldvars.php:102
msgid "Insert"
msgstr "Insert"
-#: config/fieldvars.php:100
+#: config/fieldvars.php:103
msgid "Modify selection"
msgstr "Modify selection"
-#: config/fieldvars.php:103
+#: config/fieldvars.php:106
msgid "Minimum importance"
msgstr "Minimum importance"
-#: config/fieldvars.php:104
+#: config/fieldvars.php:107
msgid "Time period hosts"
msgstr "Time period hosts"
-#: config/fieldvars.php:105
+#: config/fieldvars.php:108
msgid "Time period services"
msgstr "Time period services"
-#: config/fieldvars.php:106
+#: config/fieldvars.php:109
msgid "Host options"
msgstr "Host options"
-#: config/fieldvars.php:107
+#: config/fieldvars.php:110
msgid "Service options"
msgstr "Service options"
-#: config/fieldvars.php:108
+#: config/fieldvars.php:111
msgid "Host command"
msgstr "Host command"
-#: config/fieldvars.php:109
+#: config/fieldvars.php:112
msgid "Service command"
msgstr "Service command"
-#: config/fieldvars.php:110
+#: config/fieldvars.php:113
msgid "EMail address"
msgstr "E-Mail address"
-#: config/fieldvars.php:111
+#: config/fieldvars.php:114
msgid "Pager number"
msgstr "Pager number"
-#: config/fieldvars.php:112
+#: config/fieldvars.php:115
msgid "Addon address"
msgstr "Addon address"
-#: config/fieldvars.php:113
+#: config/fieldvars.php:116
msgid "Host notif. enable"
msgstr "Host notif. enable"
-#: config/fieldvars.php:114
+#: config/fieldvars.php:117
msgid "Service notif. enable"
msgstr "Service notif. enable"
-#: config/fieldvars.php:115
+#: config/fieldvars.php:118
msgid "Can submit commands"
msgstr "Can submit commands"
-#: config/fieldvars.php:116
+#: config/fieldvars.php:119
msgid "Retain status info"
msgstr "Retain status info"
-#: config/fieldvars.php:117
+#: config/fieldvars.php:120
msgid "Retain non-status info"
msgstr "Retain non-status info"
# contactgroups.php
-#: config/fieldvars.php:118
+#: config/fieldvars.php:121
msgid "Members"
msgstr "Members"
-#: config/fieldvars.php:119
+#: config/fieldvars.php:122
msgid "Group members"
msgstr "Group members"
-#: config/fieldvars.php:120
+#: config/fieldvars.php:123
msgid "Common settings"
msgstr "Common settings"
-#: config/fieldvars.php:121
+#: config/fieldvars.php:124
msgid "Service settings"
msgstr "Service settings"
-#: config/fieldvars.php:123
+#: config/fieldvars.php:126
msgid "Add this host configuration to existing service definitions"
msgstr "Add this host configuration to existing service definitions"
-#: config/fieldvars.php:125
+#: config/fieldvars.php:128
msgid "Parents"
msgstr "Parents"
-#: config/fieldvars.php:126
+#: config/fieldvars.php:129
msgid "Parent services"
msgstr "Parent services"
-#: config/fieldvars.php:128
+#: config/fieldvars.php:131
msgid "Check command"
msgstr "Check command"
-#: config/fieldvars.php:129
+#: config/fieldvars.php:132
msgid "Command view"
msgstr "Command view"
-#: config/fieldvars.php:130
+#: config/fieldvars.php:133
msgid "Additional templates"
msgstr "Additional templates"
-#: config/fieldvars.php:131
+#: config/fieldvars.php:134
msgid "Check settings"
msgstr "Check settings"
-#: config/fieldvars.php:132
+#: config/fieldvars.php:135
msgid "Initial state"
msgstr "Initial state"
-#: config/fieldvars.php:133
+#: config/fieldvars.php:136
msgid "Retry interval"
msgstr "Retry interval"
-#: config/fieldvars.php:134
+#: config/fieldvars.php:137
msgid "Max check attempts"
msgstr "Max. check attempts"
-#: config/fieldvars.php:135
+#: config/fieldvars.php:138
msgid "Check interval"
msgstr "Check interval"
-#: config/fieldvars.php:136
+#: config/fieldvars.php:139
msgid "Active checks enabled"
msgstr "Active checks enabled"
-#: config/fieldvars.php:137
+#: config/fieldvars.php:140
msgid "Passive checks enabled"
msgstr "Passive checks enabled"
-#: config/fieldvars.php:138
+#: config/fieldvars.php:141
msgid "Check period"
msgstr "Check period"
-#: config/fieldvars.php:139
+#: config/fieldvars.php:142
msgid "Freshness treshold"
msgstr "Freshness threshold"
-#: config/fieldvars.php:140
+#: config/fieldvars.php:143
msgid "Check freshness"
msgstr "Check freshness"
-#: config/fieldvars.php:141
+#: config/fieldvars.php:144
msgid "Obsess over host"
msgstr "Obsess over host"
-#: config/fieldvars.php:142
+#: config/fieldvars.php:145
msgid "Obsess over service"
msgstr "Obsess over service"
-#: config/fieldvars.php:143
+#: config/fieldvars.php:146
msgid "Event handler"
msgstr "Event handler"
-#: config/fieldvars.php:144
+#: config/fieldvars.php:147
msgid "Event handler enabled"
msgstr "Event handler enabled"
-#: config/fieldvars.php:145
+#: config/fieldvars.php:148
msgid "Low flap threshold"
msgstr "Low flap threshold"
-#: config/fieldvars.php:146
+#: config/fieldvars.php:149
msgid "High flap threshold"
msgstr "High flap threshold"
-#: config/fieldvars.php:147
+#: config/fieldvars.php:150
msgid "Flap detection enabled"
msgstr "Flap detection enabled"
-#: config/fieldvars.php:148
+#: config/fieldvars.php:151
msgid "Flap detection options"
msgstr "Flap detection options"
-#: config/fieldvars.php:150
+#: config/fieldvars.php:153
msgid "Retain status information"
msgstr "Retain status information"
-#: config/fieldvars.php:152
+#: config/fieldvars.php:155
msgid "Retain non-status information"
msgstr "Retain non-status information"
-#: config/fieldvars.php:153
+#: config/fieldvars.php:156
msgid "Process perf data"
msgstr "Process perf data"
-#: config/fieldvars.php:154
+#: config/fieldvars.php:157
msgid "Alarm settings"
msgstr "Alarm settings"
-#: config/fieldvars.php:155
+#: config/fieldvars.php:158
msgid "Contacts"
msgstr "Contacts"
-#: config/fieldvars.php:157
+#: config/fieldvars.php:160
msgid "Notification period"
msgstr "Notification period"
-#: config/fieldvars.php:158
+#: config/fieldvars.php:161
msgid "Notification options"
msgstr "Notification options"
-#: config/fieldvars.php:159
+#: config/fieldvars.php:162
msgid "Notification interval"
msgstr "Notification interval"
-#: config/fieldvars.php:161
+#: config/fieldvars.php:164
msgid "First notification delay"
msgstr "First notification delay"
-#: config/fieldvars.php:162
+#: config/fieldvars.php:165
msgid "Notification enabled"
msgstr "Notification enabled"
-#: config/fieldvars.php:163
+#: config/fieldvars.php:166
msgid "Importance"
msgstr "Importance"
-#: config/fieldvars.php:164
+#: config/fieldvars.php:167
msgid "Stalking options"
msgstr "Stalking options"
-#: config/fieldvars.php:165
+#: config/fieldvars.php:168
msgid "Addon settings"
msgstr "Addon settings"
-#: config/fieldvars.php:167
+#: config/fieldvars.php:170
msgid "VRML image"
msgstr "VRML image"
-#: config/fieldvars.php:168
+#: config/fieldvars.php:171
msgid "Notes URL"
msgstr "Notes URL"
-#: config/fieldvars.php:169
+#: config/fieldvars.php:172
msgid "Status image"
msgstr "Status image"
-#: config/fieldvars.php:170
+#: config/fieldvars.php:173
msgid "Icon image"
msgstr "Icon image"
-#: config/fieldvars.php:171
+#: config/fieldvars.php:174
msgid "Action URL"
msgstr "Action URL"
-#: config/fieldvars.php:172
+#: config/fieldvars.php:175
msgid "2D coords"
msgstr "2D coords"
-#: config/fieldvars.php:173
+#: config/fieldvars.php:176
msgid "3D coords"
msgstr "3D coords"
-#: config/fieldvars.php:174
+#: config/fieldvars.php:177
msgid "Icon image ALT text"
msgstr "Icon image ALT text"
-#: config/fieldvars.php:175
+#: config/fieldvars.php:178
msgid "standard"
msgstr "standard"
-#: config/fieldvars.php:176
+#: config/fieldvars.php:179
msgid "on"
msgstr "on"
-#: config/fieldvars.php:177
+#: config/fieldvars.php:180
msgid "off"
msgstr "off"
-#: config/fieldvars.php:178
+#: config/fieldvars.php:181
msgid "skip"
msgstr "skip"
-#: config/fieldvars.php:180
+#: config/fieldvars.php:183
msgid "Free variable definitions"
msgstr "Free variable definitions"
-#: config/fieldvars.php:181
+#: config/fieldvars.php:184
msgid "Variable name"
msgstr "Variable name"
-#: config/fieldvars.php:182
+#: config/fieldvars.php:185
msgid "Variable value"
msgstr "Variable value"
-#: config/fieldvars.php:185
+#: config/fieldvars.php:188
msgid "Activate"
msgstr "Activate"
-#: config/fieldvars.php:186
+#: config/fieldvars.php:189
msgid "Deactivate"
msgstr "Deactivate"
-#: config/fieldvars.php:190
+#: config/fieldvars.php:193
msgid "Do you really want to delete this database entry:"
msgstr "Do you really want to delete this database entry:"
-#: config/fieldvars.php:192
+#: config/fieldvars.php:195
msgid "Do you really want to delete all marked entries?"
msgstr "Do you really want to delete all marked entries?"
-#: config/fieldvars.php:194
+#: config/fieldvars.php:197
msgid "Mark all shown datasets"
msgstr "Mark all shown datasets"
-#: config/fieldvars.php:195
+#: config/fieldvars.php:198
msgid "File"
msgstr "File"
-#: config/fieldvars.php:196
+#: config/fieldvars.php:199
msgid "Write all config files"
msgstr "Write all config files"
-#: config/fieldvars.php:197
+#: config/fieldvars.php:200
msgid "Address"
msgstr "Address"
-#: config/fieldvars.php:198
+#: config/fieldvars.php:201
msgid "Display name"
msgstr "Display name"
-#: config/fieldvars.php:200
+#: config/fieldvars.php:203
msgid "Use this configuration as a template"
msgstr "Use this configuration as a template"
-#: config/fieldvars.php:201
+#: config/fieldvars.php:204
msgid "Generic name"
msgstr "Generic name"
-#: config/fieldvars.php:208
+#: config/fieldvars.php:211
msgid "Please check at least one option from:"
msgstr "Please check at least one option from:"
-#: config/fieldvars.php:209
+#: config/fieldvars.php:212
msgid "Host group name"
msgstr "Host group name"
-#: config/fieldvars.php:210
+#: config/fieldvars.php:213
msgid "Host group members"
msgstr "Host group members"
-#: config/fieldvars.php:214
+#: config/fieldvars.php:217
msgid "Is volatile"
msgstr "Is volatile"
-#: config/fieldvars.php:215
+#: config/fieldvars.php:218
msgid "Parallelize checks"
msgstr "Parallelize checks"
-#: config/fieldvars.php:216
+#: config/fieldvars.php:219
msgid "Config name filter"
msgstr "Config name filter"
-#: config/fieldvars.php:218
+#: config/fieldvars.php:220
+msgid "Filter"
+msgstr "Filter"
+
+#: config/fieldvars.php:223
msgid "Import directory"
msgstr "Import directory"
-#: config/fieldvars.php:220
+#: config/fieldvars.php:225
msgid "Please insert a variable name and a variable definition"
msgstr "Please insert a variable name and a variable definition"
-#: config/fieldvars.php:222 config/fieldvars.php:229 config/fieldvars.php:269
+#: config/fieldvars.php:227 config/fieldvars.php:234 config/fieldvars.php:274
msgid "Warning:"
msgstr "Warning:"
-#: config/fieldvars.php:222
+#: config/fieldvars.php:227
msgid ""
-"You have not filled in some required fields!
If this values are set "
+"You have not filled in some required fields!
If these values are set "
"by a template, you can save anyway - otherwise you will get an invalid "
"configuration!"
msgstr ""
-"You have not filled in some required fields!
If this values are set "
+"You have not filled in some required fields!
If these values are set "
"by a template, you can save anyway - otherwise you will get an invalid "
"configuration!"
-#: config/fieldvars.php:227
+#: config/fieldvars.php:232
msgid "Write config"
msgstr "Write config"
-#: config/fieldvars.php:229
+#: config/fieldvars.php:234
msgid ""
"You have not filled in all command arguments (ARGx) for your selected "
-"command!
If this arguments are optional, you can save anyway - "
+"command!
If these arguments are optional, you can save anyway - "
"otherwise you will get an invalid configuration!"
msgstr ""
"You have not filled in all command arguments (ARGx) for your selected "
-"command!
If this arguments are optional, you can save anyway - "
+"command!
If these arguments are optional, you can save anyway - "
"otherwise you will get an invalid configuration!"
-#: config/fieldvars.php:232
+#: config/fieldvars.php:237
msgid "Service group members"
msgstr "Service group members"
-#: config/fieldvars.php:233
+#: config/fieldvars.php:238
msgid "Service group name"
msgstr "Service group name"
-#: config/fieldvars.php:236
+#: config/fieldvars.php:241
msgid "Hostgroups"
msgstr "Host groups"
-#: config/fieldvars.php:237
+#: config/fieldvars.php:242
msgid "Inherit parents"
msgstr "Inherit parents"
-#: config/fieldvars.php:239
+#: config/fieldvars.php:244
msgid "Execution failure criteria"
msgstr "Execution failure criteria"
-#: config/fieldvars.php:241
+#: config/fieldvars.php:246
msgid "Nofification failure criteria"
msgstr "Notification failure criteria"
-#: config/fieldvars.php:242
+#: config/fieldvars.php:247
msgid "Dependency period"
msgstr "Dependency period"
-#: config/fieldvars.php:243
+#: config/fieldvars.php:248
msgid "Escalation period"
msgstr "Escalation period"
-#: config/fieldvars.php:244
+#: config/fieldvars.php:249
msgid "Escalation options"
msgstr "Escalation options"
-#: config/fieldvars.php:245
+#: config/fieldvars.php:250
msgid "First notification"
msgstr "First notification"
-#: config/fieldvars.php:246
+#: config/fieldvars.php:251
msgid "Last notification"
msgstr "Last notification"
-#: config/fieldvars.php:250
+#: config/fieldvars.php:255
msgid "Dependent servicegroups"
msgstr "Dependent servicegroups"
-#: config/fieldvars.php:251
+#: config/fieldvars.php:256
msgid "Help"
msgstr "Help"
-#: config/fieldvars.php:252
+#: config/fieldvars.php:257
msgid "Calendar"
msgstr "Calendar"
-#: config/fieldvars.php:253
+#: config/fieldvars.php:258
msgid "Group name"
msgstr "Group name"
-#: config/fieldvars.php:254
+#: config/fieldvars.php:259
msgid "Users"
msgstr "Users"
-#: config/fieldvars.php:255
+#: config/fieldvars.php:260
msgid "Access group"
msgstr "Access group"
-#: config/fieldvars.php:256
+#: config/fieldvars.php:261
msgid "User definitions"
msgstr "User definitions"
-#: config/fieldvars.php:257
+#: config/fieldvars.php:262
msgid "User name"
msgstr "User name"
-#: config/fieldvars.php:258
+#: config/fieldvars.php:263
msgid "User rights"
msgstr "User rights"
-#: config/fieldvars.php:260
+#: config/fieldvars.php:265
msgid "Object access restrictions"
msgstr "Object access restrictions"
-#: config/fieldvars.php:262
+#: config/fieldvars.php:267
msgid "Enable group administration"
msgstr "Enable group administration"
-#: config/fieldvars.php:263
+#: config/fieldvars.php:268
msgid "Show relation data"
msgstr "Show relation data"
-#: config/fieldvars.php:264
+#: config/fieldvars.php:269
msgid "Hide relation data"
msgstr "Hide relation data"
-#: config/fieldvars.php:266
+#: config/fieldvars.php:271
msgid "User language"
msgstr "User language"
-#: config/fieldvars.php:267
+#: config/fieldvars.php:272
msgid "Standard domain"
msgstr "Standard domain"
-#: config/fieldvars.php:269
+#: config/fieldvars.php:274
msgid ""
"The associated services must be additionally written to the files. Only "
"writing the host configuration is not sufficient because the modification is "
@@ -2636,245 +2673,208 @@ msgstr ""
"writing the host configuration is not sufficient because the modification is "
"stored inside the service files!"
-#: config/fieldvars.php:273
+#: config/fieldvars.php:278
msgid "Monday"
msgstr "Monday"
-#: config/fieldvars.php:274
+#: config/fieldvars.php:279
msgid "Tuesday"
msgstr "Tuesday"
-#: config/fieldvars.php:275
+#: config/fieldvars.php:280
msgid "Wednesday"
msgstr "Wednesday"
-#: config/fieldvars.php:276
+#: config/fieldvars.php:281
msgid "Thursday"
msgstr "Thursday"
-#: config/fieldvars.php:277
+#: config/fieldvars.php:282
msgid "Friday"
msgstr "Friday"
-#: config/fieldvars.php:278
+#: config/fieldvars.php:283
msgid "Saturday"
msgstr "Saturday"
-#: config/fieldvars.php:279
+#: config/fieldvars.php:284
msgid "Sunday"
msgstr "Sunday"
-#: config/fieldvars.php:291
+#: config/fieldvars.php:295
msgid "Main page"
msgstr "Main page"
-#: config/fieldvars.php:292
+#: config/fieldvars.php:296
msgid "Supervision"
msgstr "Supervision"
-#: config/fieldvars.php:295
+#: config/fieldvars.php:299
msgid "Commands"
msgstr "Commands"
-#: config/fieldvars.php:296
+#: config/fieldvars.php:300
msgid "Specialties"
msgstr "Specialties"
-#: config/fieldvars.php:297
+#: config/fieldvars.php:301
msgid "Tools"
msgstr "Tools"
-#: config/fieldvars.php:308
+#: config/fieldvars.php:312
msgid "Service dependency"
msgstr "Service dependency"
-#: config/fieldvars.php:309
+#: config/fieldvars.php:313
msgid "Service escalation"
msgstr "Service escalation"
-#: config/fieldvars.php:310
+#: config/fieldvars.php:314
msgid "Host dependency"
msgstr "Host dependency"
-#: config/fieldvars.php:311
+#: config/fieldvars.php:315
msgid "Host escalation"
msgstr "Host escalation"
-#: config/fieldvars.php:312
+#: config/fieldvars.php:316
msgid "Extended Host"
msgstr "Extended Host"
-#: config/fieldvars.php:313
+#: config/fieldvars.php:317
msgid "Extended Service"
msgstr "Extended Service"
-#: config/fieldvars.php:314
+#: config/fieldvars.php:318
msgid "Data import"
msgstr "Data import"
-#: config/fieldvars.php:317
+#: config/fieldvars.php:321
msgid "User admin"
msgstr "User admin"
-#: config/fieldvars.php:318
+#: config/fieldvars.php:322
msgid "Group admin"
msgstr "Group admin"
-#: config/fieldvars.php:319
+#: config/fieldvars.php:323
msgid "Nagios control"
msgstr "Nagios control"
-#: config/fieldvars.php:321
+#: config/fieldvars.php:325
msgid "Logbook"
msgstr "Logbook"
-#: config/fieldvars.php:322
+#: config/fieldvars.php:326
msgid "Nagios config"
msgstr "Nagios config"
-#: config/fieldvars.php:323
+#: config/fieldvars.php:327
msgid "Settings"
msgstr "Settings"
-#: config/fieldvars.php:324
+#: config/fieldvars.php:328
msgid "Definitions"
msgstr "Definitions"
-#: config/fieldvars.php:325
+#: config/fieldvars.php:329
msgid "CGI config"
msgstr "CGI config"
-#: config/fieldvars.php:326
+#: config/fieldvars.php:330
msgid "Menu access"
msgstr "Menu access"
-#: config/fieldvars.php:327
+#: config/fieldvars.php:331
msgid "Domains"
msgstr "Domains"
-#: config/fieldvars.php:331
+#: config/fieldvars.php:335
msgid "Help editor"
msgstr "Help editor"
# fieldvars.php
-#: config/fieldvars.php:332
+#: config/fieldvars.php:336
msgid "Data domains"
msgstr "Data domains"
-#: config/fieldvars.php:333
+#: config/fieldvars.php:337
msgid "Config targets"
msgstr "Config targets"
-#: config/fieldvars.php:334
+#: config/fieldvars.php:338
msgid "Support"
msgstr "Support"
-#: functions/MysqliDbClass.php:291
+#: functions/MysqliDbClass.php:132
msgid "Missing server connection parameter!"
msgstr "Missing server connection parameter!"
-#: functions/MysqliDbClass.php:310
+#: functions/MysqliDbClass.php:151
msgid "Connection to the database server has failed by reason:"
msgstr "Connection to the database server has failed by reason:"
-#: functions/MysqliDbClass.php:338
+#: functions/MysqliDbClass.php:194
msgid "Missing database connection parameter!"
msgstr "Missing database connection parameter!"
-#: functions/MysqliDbClass.php:347
+#: functions/MysqliDbClass.php:206
msgid "Connection to the database has failed by reason:"
msgstr "Connection to the database has failed by reason:"
-#: functions/NagConfigClass.php:336 functions/NagConfigClass.php:338
+#: functions/MysqliDbClass.php:404
+msgid "Missing MySQL SSL parameter!"
+msgstr "Missing MySQL SSL parameter!"
+
+#: functions/NagConfigClass.php:331 functions/NagConfigClass.php:333
msgid "Connection to remote system failed (FTP connection):"
msgstr "Connection to remote system failed (FTP connection):"
-#: functions/NagConfigClass.php:387 functions/NagConfigClass.php:389
+#: functions/NagConfigClass.php:407 functions/NagConfigClass.php:409
msgid "SSH public key does not exist or is not readable"
msgstr "SSH public key does not exist or is not readable"
-#: functions/NagConfigClass.php:394 functions/NagConfigClass.php:396
+#: functions/NagConfigClass.php:414 functions/NagConfigClass.php:416
msgid "SSH private key does not exist or is not readable"
msgstr "SSH private key does not exist or is not readable"
-#: functions/NagConfigClass.php:430 functions/NagConfigClass.php:432
-#: functions/NagConfigClass.php:441 functions/NagConfigClass.php:443
+#: functions/NagConfigClass.php:449 functions/NagConfigClass.php:451
+#: functions/NagConfigClass.php:460 functions/NagConfigClass.php:462
msgid "Connection to remote system failed (SSH2 connection):"
msgstr "Connection to remote system failed (SSH2 connection):"
-#: functions/NagConfigClass.php:600
-msgid ""
-"Cannot backup the old file because the permissions are wrong - destination "
-"file: "
-msgstr ""
-"Cannot backup the old file because the permissions are wrong - destination "
-"file: "
+#: functions/NagConfigClass.php:450 functions/NagConfigClass.php:452
+#: functions/NagConfigClass.php:461 functions/NagConfigClass.php:463
+msgid "port"
+msgstr "port"
-#: functions/NagConfigClass.php:605
-msgid ""
-"Cannot backup the old file because the source file is missing - source file: "
-msgstr ""
-"Cannot backup the old file because the source file is missing - source file: "
-
-#: functions/NagConfigClass.php:623
-msgid ""
-"Cannot backup the old file because the source file is missing (remote FTP) - "
-"source file: "
-msgstr ""
-"Cannot backup the old file because the source file is missing (remote FTP) - "
-"source file: "
-
-#: functions/NagConfigClass.php:629
-msgid ""
-"Cannot backup the old file because the permissions are wrong (remote FTP) - "
-"destination file: "
-msgstr ""
-"Cannot backup the old file because the permissions are wrong (remote FTP) - "
-"destination file: "
-
-#: functions/NagConfigClass.php:648
-msgid ""
-"Cannot backup the old file because the source file is missing (remote SFTP) "
-"- source file: "
-msgstr ""
-"Cannot backup the old file because the source file is missing (remote SFTP) "
-"- source file: "
-
-#: functions/NagConfigClass.php:654
-msgid ""
-"Cannot backup the old file because the permissions are wrong (remote SFTP) - "
-"destination file: "
-msgstr ""
-"Cannot backup the old file because the permissions are wrong (remote SFTP) - "
-"destination file: "
-
-#: functions/NagConfigClass.php:685
+#: functions/NagConfigClass.php:552
msgid "Cannot delete the file (wrong permissions)!"
msgstr "Cannot delete the file (wrong permissions)!"
-#: functions/NagConfigClass.php:690
+#: functions/NagConfigClass.php:557
msgid "Cannot delete the file (file does not exist)!"
msgstr "Cannot delete the file (file does not exist)!"
-#: functions/NagConfigClass.php:706
+#: functions/NagConfigClass.php:573
msgid "Cannot delete file because it does not exists (remote FTP)!"
msgstr "Cannot delete file because it does not exists (remote FTP)!"
-#: functions/NagConfigClass.php:712
+#: functions/NagConfigClass.php:579
msgid "Cannot delete file because the permissions are incorrect (remote FTP)!"
msgstr "Cannot delete file because the permissions are incorrect (remote FTP)!"
-#: functions/NagConfigClass.php:724
+#: functions/NagConfigClass.php:591
msgid "Cannot delete file because it does not exists (remote SSH/SFTP)!"
msgstr "Cannot delete file because it does not exists (remote SSH/SFTP)!"
-#: functions/NagConfigClass.php:730
+#: functions/NagConfigClass.php:597
msgid ""
"Cannot delete file because the permissions are incorrect (remote SSH/SFTP)!"
msgstr ""
"Cannot delete file because the permissions are incorrect (remote SSH/SFTP)!"
-#: functions/NagConfigClass.php:822 functions/NagConfigClass.php:846
+#: functions/NagConfigClass.php:692 functions/NagConfigClass.php:716
msgid ""
"Cannot get the remote file (it does not exist or is not readable) - remote "
"file: "
@@ -2882,23 +2882,23 @@ msgstr ""
"Cannot get the remote file (it does not exist or is not readable) - remote "
"file: "
-#: functions/NagConfigClass.php:831
+#: functions/NagConfigClass.php:701
msgid ""
"Cannot write the remote file (remote file is not writeable)- remote file: "
msgstr ""
"Cannot write the remote file (remote file is not writeable)- remote file: "
-#: functions/NagConfigClass.php:849
+#: functions/NagConfigClass.php:719
msgid "Remote file is not readable - remote file: "
msgstr "Remote file is not readable - remote file: "
-#: functions/NagConfigClass.php:860
+#: functions/NagConfigClass.php:730
msgid ""
"Cannot write a remote file (remote file is not writeable) - remote file: "
msgstr ""
"Cannot write a remote file (remote file is not writeable) - remote file: "
-#: functions/NagConfigClass.php:866
+#: functions/NagConfigClass.php:736
msgid ""
"Cannot copy a local file to remote because the local file does not exist or "
"is not readable - local file: "
@@ -2907,67 +2907,113 @@ msgstr ""
"is not readable - local file: "
# contacts.php
-#: functions/NagConfigClass.php:894
+#: functions/NagConfigClass.php:764
msgid "Could not open directory"
msgstr "Could not open directory"
# config_class.php
-#: functions/NagConfigClass.php:1003 functions/NagConfigClass.php:1006
+#: functions/NagConfigClass.php:873 functions/NagConfigClass.php:876
msgid "Warning: configuration file is out of date!"
msgstr "Warning: configuration file is out of date!"
-#: functions/NagConfigClass.php:1010 functions/NagConfigClass.php:1042
-#: functions/NagConfigClass.php:1108
+#: functions/NagConfigClass.php:880 functions/NagConfigClass.php:995
+#: functions/NagConfigClass.php:2499
msgid "Warning: no configuration target defined!"
msgstr "Warning: no configuration target defined!"
-#: functions/NagConfigClass.php:1030 functions/NagConfigClass.php:1076
+#: functions/NagConfigClass.php:983 functions/NagConfigClass.php:2466
msgid ""
"It is not possible to write config files directly from the common domain!"
msgstr ""
"It is not possible to write config files directly from the common domain!"
-#: functions/NagConfigClass.php:2069
+#: functions/NagConfigClass.php:2288
+msgid ""
+"Cannot backup the old file because the permissions are wrong - destination "
+"file: "
+msgstr ""
+"Cannot backup the old file because the permissions are wrong - destination "
+"file: "
+
+#: functions/NagConfigClass.php:2293
+msgid ""
+"Cannot backup the old file because the source file is missing - source file: "
+msgstr ""
+"Cannot backup the old file because the source file is missing - source file: "
+
+#: functions/NagConfigClass.php:2311
+msgid ""
+"Cannot backup the old file because the source file is missing (remote FTP) - "
+"source file: "
+msgstr ""
+"Cannot backup the old file because the source file is missing (remote FTP) - "
+"source file: "
+
+#: functions/NagConfigClass.php:2317
+msgid ""
+"Cannot backup the old file because the permissions are wrong (remote FTP) - "
+"destination file: "
+msgstr ""
+"Cannot backup the old file because the permissions are wrong (remote FTP) - "
+"destination file: "
+
+#: functions/NagConfigClass.php:2336
+msgid ""
+"Cannot backup the old file because the source file is missing (remote SFTP) "
+"- source file: "
+msgstr ""
+"Cannot backup the old file because the source file is missing (remote SFTP) "
+"- source file: "
+
+#: functions/NagConfigClass.php:2342
+msgid ""
+"Cannot backup the old file because the permissions are wrong (remote SFTP) - "
+"destination file: "
+msgstr ""
+"Cannot backup the old file because the permissions are wrong (remote SFTP) - "
+"destination file: "
+
+#: functions/NagConfigClass.php:2395
msgid "Cannot open/overwrite the configuration file (FTP connection failed)!"
msgstr "Cannot open/overwrite the configuration file (FTP connection failed)!"
-#: functions/NagConfigClass.php:2091
+#: functions/NagConfigClass.php:2417
msgid "Cannot open/overwrite the configuration file (remote SFTP)!"
msgstr "Cannot open/overwrite the configuration file (remote SSH/SFTP)!"
-#: functions/NagContentClass.php:251
+#: functions/NagContentClass.php:246
msgid "out-of-date"
msgstr "out-of-date"
-#: functions/NagContentClass.php:253
+#: functions/NagContentClass.php:248
msgid "no target"
msgstr "no target"
-#: functions/NagContentClass.php:256 functions/NagContentClass.php:259
+#: functions/NagContentClass.php:251 functions/NagContentClass.php:254
msgid "missed"
msgstr "missed"
-#: functions/NagContentClass.php:262 install/functions/NagInstallClass.php:479
+#: functions/NagContentClass.php:257 install/functions/NagInstallClass.php:323
msgid "up-to-date"
msgstr "up-to-date"
-#: functions/NagContentClass.php:355
+#: functions/NagContentClass.php:476
msgid "Last database update:"
msgstr "Last database update:"
-#: functions/NagContentClass.php:359
+#: functions/NagContentClass.php:480
msgid "Last file change of the configuration target "
msgstr "Last file change of the configuration target "
-#: functions/NagDataClass.php:267 functions/NagDataClass.php:269
+#: functions/NagDataClass.php:176 functions/NagDataClass.php:178
msgid "Data set copy failed - table [new name]:"
msgstr "Data set copy failed - table [new name]:"
-#: functions/NagDataClass.php:273 functions/NagDataClass.php:275
+#: functions/NagDataClass.php:182 functions/NagDataClass.php:184
msgid "Data set copied - table [new name]:"
msgstr "Data set copied - table [new name]:"
-#: functions/NagDataClass.php:295 functions/NagDataClass.php:300
+#: functions/NagDataClass.php:204 functions/NagDataClass.php:209
msgid ""
"No dataset copied. Maybe the dataset does not exist or you do not have write "
"permission."
@@ -2976,11 +3022,11 @@ msgstr ""
"permission."
# data_class.php
-#: functions/NagDataClass.php:393 functions/NagDataClass.php:422
+#: functions/NagDataClass.php:790 functions/NagDataClass.php:821
msgid "Delete failed because a database error:"
msgstr "Delete failed due to a database error:"
-#: functions/NagDataClass.php:397
+#: functions/NagDataClass.php:794
msgid ""
"No data deleted. The dataset probably does not exist or is protected from "
"deletion."
@@ -2988,21 +3034,21 @@ msgstr ""
"No data deleted. The dataset probably does not exist or is protected from "
"deletion."
-#: functions/NagDataClass.php:403
+#: functions/NagDataClass.php:800
msgid "Delete dataset id:"
msgstr "Delete dataset id:"
-#: functions/NagDataClass.php:403
+#: functions/NagDataClass.php:800
msgid "- from table:"
msgstr "- from table:"
-#: functions/NagDataClass.php:404 functions/NagDataClass.php:439
-#: functions/NagDataClass.php:614 functions/NagDataClass.php:963
-#: functions/NagDataClass.php:1020
+#: functions/NagDataClass.php:801 functions/NagDataClass.php:838
+#: functions/NagDataClass.php:1020 functions/NagDataClass.php:1379
+#: functions/NagDataClass.php:1437
msgid "- with affected rows:"
msgstr "- with affected rows:"
-#: functions/NagDataClass.php:432 functions/NagDataClass.php:443
+#: functions/NagDataClass.php:831 functions/NagDataClass.php:842
msgid ""
"No data deleted. Probably the dataset does not exist or it is protected from "
"delete."
@@ -3010,11 +3056,11 @@ msgstr ""
"No data deleted. The dataset probably does not exist or is protected from "
"deletion."
-#: functions/NagDataClass.php:438 functions/NagDataClass.php:613
+#: functions/NagDataClass.php:837 functions/NagDataClass.php:1019
msgid "Deleted data from table:"
msgstr "Deleted data from table:"
-#: functions/NagDataClass.php:603
+#: functions/NagDataClass.php:1009
msgid ""
"No data deleted. Probably the dataset does not exist, it is protected from "
"deletion, you do not have write permission or it has relations to other "
@@ -3026,7 +3072,7 @@ msgstr ""
"configurations which cannot be deleted. Use the \"info\" function for "
"detailed informations about relations!"
-#: functions/NagDataClass.php:619
+#: functions/NagDataClass.php:1025
msgid ""
"No data deleted. Probably the dataset does not exist, it is protected from "
"deletion or you do not have write permission."
@@ -3034,36 +3080,36 @@ msgstr ""
"No data deleted. Probably the dataset does not exist, it is protected from "
"deletion or you do not have write permission."
-#: functions/NagDataClass.php:691
+#: functions/NagDataClass.php:1097
msgid "Relation information for "
msgstr "Relation information for "
-#: functions/NagDataClass.php:692
+#: functions/NagDataClass.php:1098
msgid " of table "
msgstr " of table "
-#: functions/NagDataClass.php:747 functions/NagDataClass.php:752
-#: functions/NagDataClass.php:759 functions/NagDataClass.php:778
-#: functions/NagDataClass.php:784
+#: functions/NagDataClass.php:1157 functions/NagDataClass.php:1162
+#: functions/NagDataClass.php:1169 functions/NagDataClass.php:1189
+#: functions/NagDataClass.php:1195
msgid "Relation to "
msgstr "Relation to "
-#: functions/NagDataClass.php:748 functions/NagDataClass.php:753
-#: functions/NagDataClass.php:760 functions/NagDataClass.php:779
-#: functions/NagDataClass.php:785
+#: functions/NagDataClass.php:1158 functions/NagDataClass.php:1163
+#: functions/NagDataClass.php:1170 functions/NagDataClass.php:1190
+#: functions/NagDataClass.php:1196
msgid ", entry "
msgstr ", entry "
-#: functions/NagDataClass.php:749 functions/NagDataClass.php:761
-#: functions/NagDataClass.php:787
+#: functions/NagDataClass.php:1159 functions/NagDataClass.php:1171
+#: functions/NagDataClass.php:1198
msgid "deletion possible"
msgstr "deletion possible"
-#: functions/NagDataClass.php:755 functions/NagDataClass.php:781
+#: functions/NagDataClass.php:1165 functions/NagDataClass.php:1192
msgid "deletion not possible"
msgstr "deletion not possible"
-#: functions/NagDataClass.php:954
+#: functions/NagDataClass.php:1370
msgid ""
"No dataset deactivated. Maybe the dataset does not exist, it is protected "
"from deactivation, no dataset was selected or you do not have write "
@@ -3075,15 +3121,15 @@ msgstr ""
"permission. Use the \"info\" function for detailed informations about "
"relations!"
-#: functions/NagDataClass.php:960
+#: functions/NagDataClass.php:1376
msgid "Dataset successfully deactivated. Affected rows:"
msgstr "Dataset successfully deactivated. Affected rows:"
-#: functions/NagDataClass.php:962
+#: functions/NagDataClass.php:1378
msgid "Deactivate dataset from table:"
msgstr "Deactivate dataset from table:"
-#: functions/NagDataClass.php:967
+#: functions/NagDataClass.php:1383
msgid ""
"No dataset deactivated. Maybe the dataset does not exist or you do not have "
"write permission."
@@ -3091,7 +3137,7 @@ msgstr ""
"No dataset deactivated. Maybe the dataset does not exist or you do not have "
"write permission."
-#: functions/NagDataClass.php:1013
+#: functions/NagDataClass.php:1430
msgid ""
"No dataset activated. Maybe the dataset does not exist, no dataset was "
"selected or you do not have write permission."
@@ -3099,15 +3145,15 @@ msgstr ""
"No dataset activated. Maybe the dataset does not exist, no dataset was "
"selected or you do not have write permission."
-#: functions/NagDataClass.php:1017
+#: functions/NagDataClass.php:1434
msgid "Dataset successfully activated. Affected rows:"
msgstr "Dataset successfully activated. Affected rows:"
-#: functions/NagDataClass.php:1019
+#: functions/NagDataClass.php:1436
msgid "Activate dataset from table:"
msgstr "Activate dataset from table:"
-#: functions/NagDataClass.php:1024
+#: functions/NagDataClass.php:1441
msgid ""
"No dataset activated. Maybe the dataset does not exist or you do not have "
"write permission."
@@ -3115,95 +3161,95 @@ msgstr ""
"No dataset activated. Maybe the dataset does not exist or you do not have "
"write permission."
-#: functions/NagImportClass.php:162
+#: functions/NagImportClass.php:158
msgid "No valid configuration found:"
msgstr "No valid configuration found:"
-#: functions/NagImportClass.php:170
+#: functions/NagImportClass.php:166
msgid "Import file does not exist or is not readable:"
msgstr "Import file does not exist or is not readable:"
-#: functions/NagImportClass.php:202
+#: functions/NagImportClass.php:199
msgid "Unable to get configuration data:"
msgstr "Unable to get configuration data:"
-#: functions/NagImportClass.php:229
+#: functions/NagImportClass.php:226
msgid "Cannot receive the configuration file (FTP connection)!"
msgstr "Cannot receive the configuration file (FTP connection)!"
-#: functions/NagImportClass.php:252
+#: functions/NagImportClass.php:249
msgid "Cannot receive the configuration file (SSH connection)!"
msgstr "Cannot receive the configuration file (SSH connection)!"
-#: functions/NagImportClass.php:351 functions/NagImportClass.php:356
-#: functions/NagImportClass.php:420 functions/NagImportClass.php:426
-#: functions/NagImportClass.php:433 functions/NagImportClass.php:438
+#: functions/NagImportClass.php:355 functions/NagImportClass.php:360
+#: functions/NagImportClass.php:426 functions/NagImportClass.php:432
+#: functions/NagImportClass.php:439 functions/NagImportClass.php:444
msgid "inside"
msgstr "inside"
-#: functions/NagImportClass.php:352
+#: functions/NagImportClass.php:356
msgid "exists and were not overwritten"
msgstr "exists and were not overwritten"
-#: functions/NagImportClass.php:357
+#: functions/NagImportClass.php:361
msgid "were not written"
msgstr "were not written"
# contacts.php
-#: functions/NagImportClass.php:421 functions/NagImportClass.php:427
+#: functions/NagImportClass.php:427 functions/NagImportClass.php:433
msgid "could not be inserted:"
msgstr "could not be inserted:"
-#: functions/NagImportClass.php:434 functions/NagImportClass.php:439
+#: functions/NagImportClass.php:440 functions/NagImportClass.php:445
msgid "successfully inserted"
msgstr "successfully inserted"
-#: functions/NagImportClass.php:564
+#: functions/NagImportClass.php:572
msgid "Table for import definition"
msgstr "Table for import definition"
# mutdialog.php
-#: functions/NagImportClass.php:565
+#: functions/NagImportClass.php:573
msgid "is not available!"
msgstr "is not available!"
-#: functions/NagImportClass.php:1640
+#: functions/NagImportClass.php:1678
msgid ""
"Error: incorrect number of arguments - cannot import service group members"
msgstr ""
"Error: incorrect number of arguments - cannot import service group members"
-#: functions/NagImportClass.php:1868
+#: functions/NagImportClass.php:1918
msgid ""
"Error: incorrect number of arguments - cannot import service parent members"
msgstr ""
"Error: incorrect number of arguments - cannot import service parent members"
-#: functions/NagImportClass.php:1929 functions/NagImportClass.php:1934
+#: functions/NagImportClass.php:1980 functions/NagImportClass.php:1985
msgid "Error: cannot import the service parent member "
msgstr "Error: cannot import the service parent member "
-#: functions/NagImportClass.php:1931
+#: functions/NagImportClass.php:1982
msgid "This combination is not unique!"
msgstr "This combination is not unique!"
-#: functions/NagImportClass.php:1936
+#: functions/NagImportClass.php:1987
msgid "This combination is not unique or does not exist!"
msgstr "This combination is not unique or does not exist!"
-#: functions/NagVisualClass.php:227
+#: functions/NagVisualClass.php:131
msgid "Hide menu"
msgstr "Hide menu"
-#: functions/NagVisualClass.php:237
+#: functions/NagVisualClass.php:140
msgid "Show menu"
msgstr "Show menu"
-#: functions/NagVisualClass.php:272
+#: functions/NagVisualClass.php:316
msgid "Page"
msgstr "Page"
-#: functions/NagVisualClass.php:805
+#: functions/NagVisualClass.php:524
msgid "Unrestricted access"
msgstr "Unrestricted access"
@@ -3215,7 +3261,7 @@ msgstr ""
"Error setting the correct locale. Please report this error with the "
"associated output of 'locale -a' to bugs@nagiosql.org"
-#: functions/prepend_adm.php:306
+#: functions/prepend_adm.php:305
msgid "Webserver login successfull"
msgstr "Webserver login successfull"
@@ -3231,23 +3277,23 @@ msgstr "Login failed!"
msgid "Session timeout reached - Seconds:"
msgstr "Session timeout reached - Seconds:"
-#: functions/prepend_adm.php:402
+#: functions/prepend_adm.php:401
msgid "Restricted site accessed:"
msgstr "Restricted site accessed:"
-#: functions/prepend_adm.php:419
+#: functions/prepend_adm.php:418
msgid "User not found in database"
msgstr "User not found in database"
-#: functions/prepend_adm.php:548
+#: functions/prepend_adm.php:543
msgid "Logged in:"
msgstr "Logged in:"
-#: functions/prepend_adm.php:550
+#: functions/prepend_adm.php:545
msgid "Logout"
msgstr "Logout"
-#: functions/prepend_adm.php:573
+#: functions/prepend_adm.php:568
msgid ""
"Warning - template file not found or not readable, please check your file "
"permissions! - File: "
@@ -3255,8 +3301,8 @@ msgstr ""
"Warning - template file not found or not readable, please check your file "
"permissions! - File: "
-#: functions/prepend_content.php:258 functions/prepend_content.php:265
-#: functions/prepend_content.php:288 functions/prepend_content.php:295
+#: functions/prepend_content.php:301 functions/prepend_content.php:308
+#: functions/prepend_content.php:331 functions/prepend_content.php:338
msgid ""
"Some configuration files were not written. Dataset not activated, not found "
"or you do not have write permission!"
@@ -3264,71 +3310,71 @@ msgstr ""
"Some configuration files were not written. Dataset not activated, not found "
"or you do not have write permission!"
-#: functions/prepend_content.php:262 functions/prepend_content.php:292
+#: functions/prepend_content.php:305 functions/prepend_content.php:335
msgid "Configuration files successfully written!"
msgstr "Configuration files successfully written!"
-#: functions/prepend_content.php:321
+#: functions/prepend_content.php:364
msgid "Admin cannot be deleted"
msgstr "Admin cannot be deleted"
-#: functions/prepend_content.php:325
+#: functions/prepend_content.php:368
msgid "Localhost can't be deleted"
msgstr "Localhost can't be deleted"
-#: functions/prepend_content.php:502
+#: functions/prepend_content.php:548
msgid "No permission to open configuration!"
msgstr "No permission to open configuration!"
-#: functions/translator.php:63 install/functions/NagInstallClass.php:99
+#: functions/translator.php:56 install/functions/NagInstallClass.php:111
msgid "English"
msgstr "English"
-#: functions/translator.php:67 install/functions/NagInstallClass.php:103
+#: functions/translator.php:60 install/functions/NagInstallClass.php:115
msgid "German"
msgstr "German"
-#: functions/translator.php:71 install/functions/NagInstallClass.php:107
+#: functions/translator.php:64 install/functions/NagInstallClass.php:119
msgid "Chinese (Simplified)"
msgstr "Chinese (Simplified)"
-#: functions/translator.php:75 install/functions/NagInstallClass.php:111
+#: functions/translator.php:68 install/functions/NagInstallClass.php:123
msgid "Italian"
msgstr "Italian"
-#: functions/translator.php:79 install/functions/NagInstallClass.php:115
+#: functions/translator.php:72 install/functions/NagInstallClass.php:127
msgid "French"
msgstr "French"
-#: functions/translator.php:83 install/functions/NagInstallClass.php:119
+#: functions/translator.php:76 install/functions/NagInstallClass.php:131
msgid "Russian"
msgstr "Russian"
-#: functions/translator.php:87 install/functions/NagInstallClass.php:123
+#: functions/translator.php:80 install/functions/NagInstallClass.php:135
msgid "Spanish"
msgstr "Spanish"
-#: functions/translator.php:91 install/functions/NagInstallClass.php:127
+#: functions/translator.php:84 install/functions/NagInstallClass.php:139
msgid "Portuguese (Brazilian)"
msgstr "Portuguese (Brazilian)"
-#: functions/translator.php:95 install/functions/NagInstallClass.php:131
+#: functions/translator.php:88 install/functions/NagInstallClass.php:143
msgid "Dutch"
msgstr "Dutch"
-#: functions/translator.php:99 install/functions/NagInstallClass.php:135
+#: functions/translator.php:92 install/functions/NagInstallClass.php:147
msgid "Danish"
msgstr "Danish"
-#: index.php:47
+#: index.php:49
msgid "Welcome to"
msgstr "Welcome to"
-#: index.php:48
+#: index.php:50
msgid "Welcome"
msgstr "Welcome"
-#: index.php:49
+#: index.php:51
msgid ""
"Please enter your username and password to access NagiosQL. If you forgot "
"one of them, please contact your Administrator."
@@ -3336,41 +3382,41 @@ msgstr ""
"Please enter your username and password to access NagiosQL. If you forgot "
"one of them, please contact your Administrator."
-#: index.php:53
+#: index.php:55
msgid "Login"
msgstr "Login"
-#: install/functions/NagInstallClass.php:75
+#: install/functions/NagInstallClass.php:67
msgid "Template file not found"
msgstr "Template file not found"
-#: install/functions/NagInstallClass.php:336
-#: install/functions/NagInstallClass.php:368
+#: install/functions/NagInstallClass.php:182
+#: install/functions/NagInstallClass.php:214
msgid "passed"
msgstr "passed"
# prepend.adm
-#: install/functions/NagInstallClass.php:358
+#: install/functions/NagInstallClass.php:204
msgid "Error while connecting to database:"
msgstr "Error while connecting to database:"
-#: install/functions/NagInstallClass.php:399
-#: install/functions/NagInstallClass.php:474
+#: install/functions/NagInstallClass.php:245
+#: install/functions/NagInstallClass.php:318
msgid "supported"
msgstr "supported"
-#: install/functions/NagInstallClass.php:401
+#: install/functions/NagInstallClass.php:247
msgid "not supported"
msgstr "not supported"
-#: install/functions/NagInstallClass.php:477
+#: install/functions/NagInstallClass.php:321
msgid ""
"Your NagiosQL installation is up to date - no further actions are needed!"
msgstr ""
"Your NagiosQL installation is up to date - no further actions are needed!"
-#: install/functions/NagInstallClass.php:483
-#: install/functions/NagInstallClass.php:491
+#: install/functions/NagInstallClass.php:327
+#: install/functions/NagInstallClass.php:335
msgid ""
"Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and "
"above!"
@@ -3379,116 +3425,116 @@ msgstr ""
"above!"
# prepend.adm
-#: install/functions/NagInstallClass.php:489
+#: install/functions/NagInstallClass.php:333
msgid "Error while selecting settings table."
msgstr "Error while selecting settings table."
-#: install/functions/NagInstallClass.php:511
-#: install/functions/NagInstallClass.php:547
-#: install/functions/NagInstallClass.php:610
-#: install/functions/NagInstallClass.php:614
-#: install/functions/NagInstallClass.php:655
-#: install/functions/NagInstallClass.php:736
-#: install/functions/NagInstallClass.php:819
-#: install/functions/NagInstallClass.php:870
-#: install/functions/NagInstallClass.php:935
-#: install/functions/NagInstallClass.php:945
-#: install/functions/NagInstallClass.php:967
-#: install/functions/NagInstallClass.php:1015
-#: install/functions/NagInstallClass.php:1067
+#: install/functions/NagInstallClass.php:355
+#: install/functions/NagInstallClass.php:391
+#: install/functions/NagInstallClass.php:454
+#: install/functions/NagInstallClass.php:458
+#: install/functions/NagInstallClass.php:500
+#: install/functions/NagInstallClass.php:580
+#: install/functions/NagInstallClass.php:660
+#: install/functions/NagInstallClass.php:712
+#: install/functions/NagInstallClass.php:777
+#: install/functions/NagInstallClass.php:787
+#: install/functions/NagInstallClass.php:809
+#: install/functions/NagInstallClass.php:858
+#: install/functions/NagInstallClass.php:910
msgid "done"
msgstr "done"
-#: install/functions/NagInstallClass.php:538
+#: install/functions/NagInstallClass.php:382
msgid "Unsupported database type."
msgstr "Unsupported database type."
-#: install/functions/NagInstallClass.php:611
+#: install/functions/NagInstallClass.php:455
msgid "Only added rights to existing user"
msgstr "Only added rights to existing user"
# mutdialog.php
-#: install/functions/NagInstallClass.php:641
+#: install/functions/NagInstallClass.php:486
msgid "No SQL update files available"
msgstr "No SQL update files available"
-#: install/functions/NagInstallClass.php:650
-#: install/functions/NagInstallClass.php:707
+#: install/functions/NagInstallClass.php:495
+#: install/functions/NagInstallClass.php:552
msgid "SQL file is not readable or empty"
msgstr "SQL file is not readable or empty"
-#: install/functions/NagInstallClass.php:778
-#: install/functions/NagInstallClass.php:785
-#: install/functions/NagInstallClass.php:813
+#: install/functions/NagInstallClass.php:619
+#: install/functions/NagInstallClass.php:626
+#: install/functions/NagInstallClass.php:653
msgid "Inserting initial data to settings database has failed:"
msgstr "Inserting initial data to settings database has failed:"
-#: install/functions/NagInstallClass.php:873
-msgid "Connot open/write to config/settings.php"
-msgstr "Connot open/write to config/settings.php"
+#: install/functions/NagInstallClass.php:715
+msgid "Cannot open/write to config/settings.php"
+msgstr "Cannot open/write to config/settings.php"
-#: install/functions/NagInstallClass.php:905
+#: install/functions/NagInstallClass.php:747
msgid "Inserting path data to database has failed:"
msgstr "Inserting path data to database has failed:"
-#: install/functions/NagInstallClass.php:936
+#: install/functions/NagInstallClass.php:778
msgid "Check the permissions of the created paths!"
msgstr "Check the permissions of the created paths!"
-#: install/functions/NagInstallClass.php:939
+#: install/functions/NagInstallClass.php:781
msgid "NagiosQL config path is not writeable - only database values updated"
msgstr "NagiosQL config path is not writeable - only database values updated"
# prepend.adm
-#: install/functions/NagInstallClass.php:969
-#: install/functions/NagInstallClass.php:1017
-#: install/functions/NagInstallClass.php:1069
+#: install/functions/NagInstallClass.php:811
+#: install/functions/NagInstallClass.php:860
+#: install/functions/NagInstallClass.php:912
msgid "Database errors while converting to utf-8:"
msgstr "Database errors while converting to utf-8:"
-#: install/functions/NagInstallClass.php:1008
-#: install/functions/NagInstallClass.php:1060 install/step3.php:88
-#: install/step3.php:177
+#: install/functions/NagInstallClass.php:851
+#: install/functions/NagInstallClass.php:903 install/step3.php:96
+#: install/step3.php:185
msgid "Database type not defined!"
msgstr "Database type not defined!"
-#: install/index.php:69
+#: install/index.php:74
msgid "Online Documentation"
msgstr "Online Documentation"
-#: install/index.php:115
+#: install/index.php:119
msgid "Database connection failed. Upgrade not available!"
msgstr "Database connection failed. Upgrade not available!"
-#: install/index.php:122
+#: install/index.php:126
msgid "Settings table not available or wrong. Upgrade not available!"
msgstr "Settings table not available or wrong. Upgrade not available!"
-#: install/index.php:133
-msgid ""
-"Invalid database type in settings file (config/settings.php). Upgrade not "
-"available!"
-msgstr ""
-"Invalid database type in settings file (config/settings.php). Upgrade not "
-"available!"
-
#: install/index.php:137
msgid ""
-"Database values in settings file are missing (config/settings.php). Upgrade "
-"not available!"
+"Invalid database type in settings file (config/settings.php). Upgrade not "
+"available!"
msgstr ""
-"Database values in settings file are missing (config/settings.php). Upgrade "
-"not available!"
+"Invalid database type in settings file (config/settings.php). Upgrade not "
+"available!"
#: install/index.php:141
msgid ""
+"Database values in settings file are missing (config/settings.php). Upgrade "
+"not available!"
+msgstr ""
+"Database values in settings file are missing (config/settings.php). Upgrade "
+"not available!"
+
+#: install/index.php:145
+msgid ""
"Settings file not found or not readable (config/settings.php). Upgrade not "
"available!"
msgstr ""
"Settings file not found or not readable (config/settings.php). Upgrade not "
"available!"
-#: install/index.php:152
+#: install/index.php:156
msgid ""
"Default values file is not available or not readable (install/functions/"
"initial_settings.php). Installation possible, but without predefined data!"
@@ -3496,23 +3542,23 @@ msgstr ""
"Default values file is not available or not readable (install/functions/"
"initial_settings.php). Installation possible, but without predefined data!"
-#: install/index.php:159
+#: install/index.php:162
msgid "Installation wizard"
msgstr "Installation wizard"
-#: install/index.php:160
+#: install/index.php:163
msgid "Welcome to the NagiosQL installation wizard"
msgstr "Welcome to the NagiosQL installation wizard"
-#: install/index.php:161
+#: install/index.php:164
msgid "This wizard will help you to install and configure NagiosQL."
msgstr "This wizard will help you to install and configure NagiosQL."
-#: install/index.php:163
+#: install/index.php:165
msgid "For questions please visit"
msgstr "For questions please visit"
-#: install/index.php:164
+#: install/index.php:166
msgid ""
"First let's check your local environment and find out if everything NagiosQL "
"needs is available."
@@ -3520,121 +3566,125 @@ msgstr ""
"First let's check your local environment and find out if everything NagiosQL "
"needs is available."
-#: install/index.php:166
+#: install/index.php:167
msgid "The basic requirements are:"
msgstr "The basic requirements are:"
-#: install/index.php:167
-msgid "PHP 5.5.0 or greater including:"
-msgstr "PHP 5.5.0 or greater including:"
-
#: install/index.php:168
+msgid "PHP 7.2.0 or above (PHP 8 is recommended) including:"
+msgstr "PHP 7.2.0 or above (PHP 8 is recommended) including:"
+
+#: install/index.php:169
msgid "PHP database module:"
msgstr "PHP database module:"
-#: install/index.php:169
+#: install/index.php:170
msgid "supported types are"
msgstr "supported types are"
-#: install/index.php:174 install/index.php:176
+#: install/index.php:175 install/index.php:177
msgid "(optional)"
msgstr "(optional)"
-#: install/index.php:175
+#: install/index.php:176
msgid "PECL extension:"
msgstr "PECL extension:"
-#: install/index.php:177
+#: install/index.php:178
msgid "php.ini options"
msgstr "php.ini options"
-#: install/index.php:178
+#: install/index.php:179
msgid "file_uploads on (for upload features)"
msgstr "file_uploads on (for upload features)"
-#: install/index.php:179
+#: install/index.php:180
msgid "session.auto_start needs to be off"
msgstr "session.auto_start needs to be off"
-#: install/index.php:180
+#: install/index.php:181
+msgid "date.timezone should be set to your local timezone"
+msgstr "date.timezone should be set to your local timezone"
+
+#: install/index.php:182
msgid "A database server"
msgstr "A database server"
-#: install/index.php:181
+#: install/index.php:183
msgid "Nagios 2.x/3.x/4.x"
msgstr "Nagios 2.x/3.x/4.x"
-#: install/index.php:182
+#: install/index.php:184
msgid "NagiosQL version"
msgstr "NagiosQL version"
-#: install/index.php:184
+#: install/index.php:186
msgid "Online documentation"
msgstr "Online documentation"
-#: install/index.php:188
+#: install/index.php:190
msgid "START INSTALLATION"
msgstr "START INSTALLATION"
-#: install/index.php:189
+#: install/index.php:191
msgid "START UPDATE"
msgstr "START UPDATE"
-#: install/install.php:214
+#: install/install.php:196
msgid "Welcome to the NagiosQL Installation Wizard"
msgstr "Welcome to the NagiosQL Installation Wizard"
-#: install/step1.php:74 install/step2.php:34 install/step3.php:38
+#: install/step1.php:79 install/step2.php:39 install/step3.php:47
msgid "Requirements"
msgstr "Requirements"
-#: install/step1.php:75 install/step1.php:77 install/step2.php:35
-#: install/step2.php:37 install/step3.php:39 install/step3.php:41
+#: install/step1.php:80 install/step1.php:82 install/step2.php:40
+#: install/step2.php:42 install/step3.php:48 install/step3.php:50
msgid "Installation"
msgstr "Installation"
-#: install/step1.php:76 install/step2.php:36 install/step3.php:40
-#: install/step3.php:301
+#: install/step1.php:81 install/step2.php:41 install/step3.php:49
+#: install/step3.php:308
msgid "Finish"
msgstr "Finish"
-#: install/step1.php:78
+#: install/step1.php:83
msgid "Checking requirements"
msgstr "Checking requirements"
-#: install/step1.php:79
+#: install/step1.php:84
msgid "Checking Client"
msgstr "Checking Client"
-#: install/step1.php:80
+#: install/step1.php:85
msgid "Checking PHP version"
msgstr "Checking PHP version"
-#: install/step1.php:81
+#: install/step1.php:86
msgid "Checking PHP extensions"
msgstr "Checking PHP extensions"
-#: install/step1.php:82
+#: install/step1.php:87
msgid "Checking available database interfaces"
msgstr "Checking available database interfaces"
-#: install/step1.php:83
+#: install/step1.php:88
msgid "Checking php.ini/.htaccess settings"
msgstr "Checking php.ini/.htaccess settings"
-#: install/step1.php:84
+#: install/step1.php:89
msgid "Checking System Permission"
msgstr "Checking System Permissions"
-#: install/step1.php:85
+#: install/step1.php:90
msgid "The following modules/extensions are required to run NagiosQL"
msgstr "The following modules/extensions are required to run NagiosQL"
-#: install/step1.php:87
+#: install/step1.php:91
msgid "The next couple of extensions are optional but recommended"
msgstr "The next couple of extensions are optional but recommended"
-#: install/step1.php:89
+#: install/step1.php:92
msgid ""
"Check which of the supported extensions are installed. At least one of them "
"is required."
@@ -3642,19 +3692,19 @@ msgstr ""
"Check which of the supported extensions are installed. At least one of them "
"is required."
-#: install/step1.php:91
+#: install/step1.php:93
msgid "The following settings are required to run NagiosQL"
msgstr "The following settings are required to run NagiosQL"
-#: install/step1.php:109
+#: install/step1.php:110
msgid "ENABLED"
msgstr "ENABLED"
-#: install/step1.php:114
+#: install/step1.php:115
msgid "NOT ENABLED"
msgstr "NOT ENABLED"
-#: install/step1.php:115
+#: install/step1.php:116
msgid ""
"After enabling Javascript, the page must be updated twice so that the status "
"changes"
@@ -3662,36 +3712,37 @@ msgstr ""
"After enabling Javascript, the page must be updated twice so that the status "
"changes"
-#: install/step1.php:120
+#: install/step1.php:121
msgid "Version"
msgstr "Version"
-#: install/step1.php:124 install/step1.php:140 install/step1.php:155
-#: install/step1.php:180 install/step1.php:208 install/step1.php:212
-#: install/step1.php:226 install/step1.php:236 install/step1.php:239
-#: install/step1.php:252 install/step1.php:261 install/step1.php:270
-#: install/step1.php:279 install/step1.php:288 install/step1.php:297
+#: install/step1.php:125 install/step1.php:149 install/step1.php:159
+#: install/step1.php:174 install/step1.php:199 install/step1.php:227
+#: install/step1.php:230 install/step1.php:243 install/step1.php:253
+#: install/step1.php:256 install/step1.php:269 install/step1.php:278
+#: install/step1.php:287 install/step1.php:296 install/step1.php:305
+#: install/step1.php:314
msgid "OK"
msgstr "OK"
-#: install/step1.php:125 install/step1.php:129
+#: install/step1.php:126 install/step1.php:130
msgid "detected"
msgstr "detected"
-#: install/step1.php:130
+#: install/step1.php:131
msgid "or greater is required"
msgstr "or greater is required"
-#: install/step1.php:143 install/step1.php:158 install/step1.php:187
-msgid "Could be loaded. Please add in php.ini"
-msgstr "Could be loaded. Please add in php.ini"
-
-#: install/step1.php:145 install/step1.php:160 install/step1.php:189
-#: install/step1.php:204
+#: install/step1.php:152 install/step1.php:164 install/step1.php:179
+#: install/step1.php:208 install/step1.php:223
msgid "NOT AVAILABLE"
msgstr "NOT AVAILABLE"
-#: install/step1.php:177
+#: install/step1.php:162 install/step1.php:177 install/step1.php:206
+msgid "Could be loaded. Please add in php.ini"
+msgstr "Could be loaded. Please add in php.ini"
+
+#: install/step1.php:196
msgid ""
"New installation only - updates are only supported using the same database "
"interface!"
@@ -3699,60 +3750,60 @@ msgstr ""
"New installation only - updates are only supported using the same database "
"interface!"
-#: install/step1.php:205
+#: install/step1.php:224
msgid "cannot be empty and needs to be set"
msgstr "cannot be empty and needs to be set"
-#: install/step1.php:214
+#: install/step1.php:232
msgid "should be"
msgstr "should be"
-#: install/step1.php:225 install/step1.php:228
+#: install/step1.php:242 install/step1.php:245
msgid "Read test on settings file (config/settings.php)"
msgstr "Read test on settings file (config/settings.php)"
-#: install/step1.php:231
+#: install/step1.php:248
msgid "Settings file does not exists (config/settings.php)"
msgstr "Settings file does not exist (config/settings.php)"
-#: install/step1.php:232
+#: install/step1.php:249
msgid "will be created"
msgstr "will be created"
-#: install/step1.php:235 install/step1.php:241
+#: install/step1.php:252 install/step1.php:258
msgid "Write test on settings file (config/settings.php)"
msgstr "Write test on settings file (config/settings.php)"
-#: install/step1.php:238 install/step1.php:245
+#: install/step1.php:255 install/step1.php:262
msgid "Write test on settings directory (config/)"
msgstr "Write test on settings directory (config/)"
-#: install/step1.php:251 install/step1.php:254
+#: install/step1.php:268 install/step1.php:271
msgid "Read test on one class file (functions/NagVisualClass.php)"
msgstr "Read test on one class file (functions/NagVisualClass.php)"
-#: install/step1.php:260 install/step1.php:263
+#: install/step1.php:277 install/step1.php:280
msgid "Read test on home page file (admin.php)"
msgstr "Read test on home page file (admin.php)"
-#: install/step1.php:269 install/step1.php:272
+#: install/step1.php:286 install/step1.php:289
msgid "Read test on one template file (templates/index.tpl.htm)"
msgstr "Read test on one template file (templates/index.tpl.htm)"
-#: install/step1.php:278 install/step1.php:281
+#: install/step1.php:295 install/step1.php:298
msgid "Read test on one admin template file (templates/admin/datalist.htm.tpl)"
msgstr ""
"Read test on one admin template file (templates/admin/datalist.htm.tpl)"
-#: install/step1.php:287 install/step1.php:290
+#: install/step1.php:304 install/step1.php:307
msgid "Read test on one file template (templates/files/contacts.tpl.dat)"
msgstr "Read test on one file template (templates/files/contacts.tpl.dat)"
-#: install/step1.php:296 install/step1.php:299
+#: install/step1.php:313 install/step1.php:316
msgid "Read test on one image file (images/pixel.gif)"
msgstr "Read test on one image file (images/pixel.gif)"
-#: install/step1.php:304
+#: install/step1.php:321
msgid ""
"There are some errors - please check your system settings and read the "
"requirements of NagiosQL!"
@@ -3760,7 +3811,7 @@ msgstr ""
"There are some errors - please check your system settings and read the "
"requirements for NagiosQL!"
-#: install/step1.php:306
+#: install/step1.php:323
msgid ""
"Read the INSTALLATION file in the NagiosQL doc directory or the installation "
"PDF file on our"
@@ -3768,123 +3819,123 @@ msgstr ""
"Read the INSTALLATION file in the NagiosQL doc directory or the installation "
"PDF file on our"
-#: install/step1.php:310
+#: install/step1.php:327
msgid "online documentation"
msgstr "online documentation"
-#: install/step1.php:311
+#: install/step1.php:328
msgid "site to find out, how to fix them."
msgstr "site to find out, how to fix them."
-#: install/step1.php:312
+#: install/step1.php:329
msgid "After that - refresh this page to proceed"
msgstr "After that - refresh this page to proceed"
-#: install/step1.php:316
+#: install/step1.php:333
msgid "Refresh"
msgstr "Refresh"
-#: install/step1.php:318
+#: install/step1.php:335
msgid "Environment test completed successfully"
msgstr "Environment test completed successfully"
-#: install/step1.php:323 install/step2.php:94
+#: install/step1.php:340 install/step2.php:99
msgid "Next"
msgstr "Next"
-#: install/step2.php:32
+#: install/step2.php:37
msgid "The NagiosQL first passwords are not equal!"
msgstr "The NagiosQL first passwords are not equal!"
-#: install/step2.php:38
+#: install/step2.php:43
msgid "Setup"
msgstr "Setup"
-#: install/step2.php:39
+#: install/step2.php:44
msgid "Please complete the form below. Mandatory fields marked *"
msgstr "Please complete the form below. Mandatory fields marked *"
-#: install/step2.php:41
+#: install/step2.php:46
msgid "Database Configuration"
msgstr "Database Configuration"
-#: install/step2.php:42
+#: install/step2.php:47
msgid "Database Type"
msgstr "Database Type"
-#: install/step2.php:56
+#: install/step2.php:61
msgid "Database Server"
msgstr "Database Server"
-#: install/step2.php:58
+#: install/step2.php:63
msgid "Local hostname or IP address"
msgstr "Local hostname or IP address"
-#: install/step2.php:64
+#: install/step2.php:69
msgid "Database Server Port"
msgstr "Database Server Port"
-#: install/step2.php:68
+#: install/step2.php:73
msgid "NagiosQL DB User"
msgstr "NagiosQL DB User"
-#: install/step2.php:70
+#: install/step2.php:75
msgid "NagiosQL DB Password"
msgstr "NagiosQL DB Password"
-#: install/step2.php:72
+#: install/step2.php:77
msgid "Administrative Database User"
msgstr "Administrative Database User"
-#: install/step2.php:74
+#: install/step2.php:79
msgid "Administrative Database Password"
msgstr "Administrative Database Password"
-#: install/step2.php:75
+#: install/step2.php:80
msgid "Drop database if already exists?"
msgstr "Drop database if already exists?"
-#: install/step2.php:81
+#: install/step2.php:86
msgid "NagiosQL User Setup"
msgstr "NagiosQL User Setup"
-#: install/step2.php:82
+#: install/step2.php:87
msgid "Initial NagiosQL User"
msgstr "Initial NagiosQL User"
-#: install/step2.php:84
+#: install/step2.php:89
msgid "Initial NagiosQL Password"
msgstr "Initial NagiosQL Password"
-#: install/step2.php:86
+#: install/step2.php:91
msgid "Please repeat the password"
msgstr "Please repeat the password"
-#: install/step2.php:87
+#: install/step2.php:92
msgid "Nagios Configuration"
msgstr "Nagios Configuration"
-#: install/step2.php:88
+#: install/step2.php:93
msgid "Import Nagios sample config?"
msgstr "Import Nagios sample config?"
-#: install/step2.php:95
+#: install/step2.php:100
msgid "NagiosQL path values"
msgstr "NagiosQL path values"
-#: install/step2.php:96
+#: install/step2.php:101
msgid "Create NagiosQL config paths?"
msgstr "Create NagiosQL config paths?"
-#: install/step2.php:102
+#: install/step2.php:107
msgid "NagiosQL config path"
msgstr "NagiosQL config path"
-#: install/step2.php:104
+#: install/step2.php:109
msgid "Nagios config path"
msgstr "Nagios config path"
-#: install/step2.php:106
+#: install/step2.php:111
msgid ""
"Both path values were stored in your configuration target settings for "
"localhost."
@@ -3892,7 +3943,7 @@ msgstr ""
"Both path values were stored in your configuration target settings for "
"localhost."
-#: install/step2.php:108
+#: install/step2.php:113
msgid ""
"If you select the create path option, be sure that the NagiosQL base path "
"exist and the webserver demon has write access to it. So the installer will "
@@ -3904,103 +3955,103 @@ msgstr ""
"create the required subdirectories in your localhost's filesystem (hosts, "
"services, backup etc.)"
-#: install/step2.php:120
+#: install/step2.php:125
msgid "Please backup your database before proceeding!"
msgstr "Please backup your database before proceeding!"
-#: install/step3.php:42
+#: install/step3.php:51
msgid "Finishing Setup"
msgstr "Finishing Setup"
-#: install/step3.php:44
+#: install/step3.php:53
msgid "Deploy NagiosQL settings"
msgstr "Deploy NagiosQL settings"
-#: install/step3.php:45
+#: install/step3.php:54
msgid "Database server connection (privileged user)"
msgstr "Database server connection (privileged user)"
-#: install/step3.php:46
+#: install/step3.php:55
msgid "Database server version"
msgstr "Database server version"
-#: install/step3.php:47
+#: install/step3.php:56
msgid "Database server support"
msgstr "Database server support"
-#: install/step3.php:48
+#: install/step3.php:57
msgid "Delete existing NagiosQL database"
msgstr "Delete existing NagiosQL database"
-#: install/step3.php:49
+#: install/step3.php:58
msgid "Creating new database"
msgstr "Creating new database"
-#: install/step3.php:50
+#: install/step3.php:59
msgid "Installing NagiosQL database tables"
msgstr "Installing NagiosQL database tables"
-#: install/step3.php:51
+#: install/step3.php:60
msgid "Create NagiosQL database user"
msgstr "Create NagiosQL database user"
-#: install/step3.php:52
+#: install/step3.php:61
msgid "Set initial NagiosQL Administrator"
msgstr "Set initial NagiosQL Administrator"
-#: install/step3.php:53
+#: install/step3.php:62
msgid "Database server connection (NagiosQL user)"
msgstr "Database server connection (NagiosQL user)"
-#: install/step3.php:54
+#: install/step3.php:63
msgid "Writing global settings to database"
msgstr "Writing global settings to database"
-#: install/step3.php:55
+#: install/step3.php:64
msgid "Writing database configuration to settings.php"
msgstr "Writing database configuration to settings.php"
-#: install/step3.php:56
+#: install/step3.php:65
msgid "Import Nagios sample data"
msgstr "Import Nagios sample data"
-#: install/step3.php:57
+#: install/step3.php:66
msgid "Create and/or store NagiosQL path settings"
msgstr "Create and/or store NagiosQL path settings"
-#: install/step3.php:80
+#: install/step3.php:88
msgid "Updating existing NagiosQL database"
msgstr "Updating existing NagiosQL database"
-#: install/step3.php:113
+#: install/step3.php:121
msgid "Installed NagiosQL version"
msgstr "Installed NagiosQL version"
-#: install/step3.php:124
+#: install/step3.php:132
msgid "Upgrading from version"
msgstr "Upgrading from version"
-#: install/step3.php:125
+#: install/step3.php:133
msgid "to"
msgstr "to"
-#: install/step3.php:132
+#: install/step3.php:140
msgid "Converting database to utf8 character set"
msgstr "Converting database to utf8 character set"
-#: install/step3.php:138
+#: install/step3.php:146
msgid "Converting database tables to utf8 character set"
msgstr "Converting database tables to utf8 character set"
-#: install/step3.php:145
+#: install/step3.php:153
msgid "Converting database fields to utf8 character set"
msgstr "Converting database fields to utf8 character set"
-#: install/step3.php:169
+#: install/step3.php:177
msgid "Create new NagiosQL database"
msgstr "Create new NagiosQL database"
-#: install/step3.php:202
+#: install/step3.php:210
msgid ""
"Database already exists and drop database was not selected, please correct "
"or manage manually"
@@ -4008,18 +4059,24 @@ msgstr ""
"Database already exists and drop database was not selected, please correct "
"or manage manually"
-#: install/step3.php:218
+#: install/step3.php:226
msgid "unknown"
msgstr "unknown"
-#: install/step3.php:293
+#: install/step3.php:301
msgid "Back"
msgstr "Back"
-#: install/step3.php:298
+#: install/step3.php:305
msgid "Please delete the install directory to continue!"
msgstr "Please delete the install directory to continue!"
+#~ msgid "Restart failed - Nagios daemon was not running"
+#~ msgstr "Restart failed - Nagios daemon was not running"
+
+#~ msgid "Nagios daemon is not running, cannot send restart command!"
+#~ msgstr "Nagios daemon is not running, cannot send restart command!"
+
#~ msgid "Cgi config file"
#~ msgstr "Cgi config file"
diff --git a/config/locale/fr_FR/LC_MESSAGES/fr_FR.po b/config/locale/fr_FR/LC_MESSAGES/fr_FR.po
index cd39f3f..eb43e57 100644
--- a/config/locale/fr_FR/LC_MESSAGES/fr_FR.po
+++ b/config/locale/fr_FR/LC_MESSAGES/fr_FR.po
@@ -3,7 +3,7 @@
# # Project : NagiosQL
# # Component : Translation File English
# # Website : https://sourceforge.net/projects/nagiosql/
-# # Version : 3.4.0
+# # Version : 3.4.1
# # GIT Repo : https://gitlab.com/wizonet/NagiosQL
# #
# #############################################################################
diff --git a/config/locale/it_IT/LC_MESSAGES/it_IT.po b/config/locale/it_IT/LC_MESSAGES/it_IT.po
index 68792b1..6d3c024 100644
--- a/config/locale/it_IT/LC_MESSAGES/it_IT.po
+++ b/config/locale/it_IT/LC_MESSAGES/it_IT.po
@@ -3,7 +3,7 @@
# # Project : NagiosQL
# # Component : Translation File English
# # Website : https://sourceforge.net/projects/nagiosql/
-# # Version : 3.4.0
+# # Version : 3.4.1
# # GIT Repo : https://gitlab.com/wizonet/NagiosQL
# #
# #############################################################################
diff --git a/config/locale/ja_JP/LC_MESSAGES/ja_JP.po b/config/locale/ja_JP/LC_MESSAGES/ja_JP.po
index 69e098f..446fe41 100644
--- a/config/locale/ja_JP/LC_MESSAGES/ja_JP.po
+++ b/config/locale/ja_JP/LC_MESSAGES/ja_JP.po
@@ -3,7 +3,7 @@
# # Project : NagiosQL
# # Component : Translation File English
# # Website : https://sourceforge.net/projects/nagiosql/
-# # Version : 3.4.0
+# # Version : 3.4.1
# # GIT Repo : https://gitlab.com/wizonet/NagiosQL
# #
# #############################################################################
diff --git a/config/main.css b/config/main.css
index 93528a9..71ba369 100644
--- a/config/main.css
+++ b/config/main.css
@@ -1,230 +1,262 @@
@charset "utf-8";
-/*/////////////////////////////////////////////////////////////////////////////
-//
-// NagiosQL
-//
-///////////////////////////////////////////////////////////////////////////////
-//
-// (c) 2005-2018 by Martin Willisegger
-//
-// Project : NagiosQL
-// Component : CSS Main definition
-// Website : https://sourceforge.net/projects/nagiosql/
-// Version : 3.4.0
-// GIT Repo : https://gitlab.com/wizonet/NagiosQL
-//
-/////////////////////////////////////////////////////////////////////////////*/
+/* ----------------------------------------------------------------------------
+ NagiosQL
+-------------------------------------------------------------------------------
+ (c) 2005-2022 by Martin Willisegger
+
+ Project : NagiosQL
+ Component : CSS Main definition
+ Website : https://sourceforge.net/projects/nagiosql/
+ Version : 3.5.0
+ GIT Repo : https://gitlab.com/wizonet/NagiosQL
+-----------------------------------------------------------------------------*/
body {
- font-family: Arial, Helvetica, sans-serif;
- background-color: #FFFFFF;
- margin: 0;
- padding: 0;
- font-size: 12px;
+ font-family: Arial, Helvetica, sans-serif;
+ background-color: #FFFFFF;
+ margin: 0;
+ padding: 0;
+ font-size: 12px;
}
+
#login {
- text-align: center;
- margin:0 auto;
- max-width:80em;
- min-width:740px;
+ text-align: center;
+ margin: 0 auto;
+ max-width: 80em;
+ min-width: 740px;
}
+
/************************/
/** HEADER definitions */
/************************/
.header {
- background: #FFFFFF url(../images/bg_top.png) repeat-x right top;
+ background: #FFFFFF url(../images/bg_top.png) repeat-x right top;
}
+
.headerleft {
- vertical-align: bottom;
- text-align: left;
- padding-left: 10px;
+ vertical-align: bottom;
+ text-align: left;
+ padding-left: 10px;
}
+
.headerleft a {
- color: #002C52;
- background-color: #FFFFFF;
-}
+ color: #002C52;
+ background-color: #FFFFFF;
+}
+
.headerleft a:hover {
- color: #002C52;
- background-color: #E5E9ED ;
+ color: #002C52;
+ background-color: #E5E9ED;
}
+
.headerleft a:active {
- color: #002C52;
- background-color: #E5E9ED ;
-}
+ color: #002C52;
+ background-color: #E5E9ED;
+}
+
.top-link {
- color: #002C52;
- font-size: 10pt;
- text-decoration: none;
- font-weight: bold;
- background-color: #FFFFFF;
- padding: 2px 3px 0 3px;
- border-top:1px solid #002C52;
- border-left:1px solid #002C52;
- border-right:1px solid #002C52;
-}
+ color: #002C52;
+ font-size: 10pt;
+ text-decoration: none;
+ font-weight: bold;
+ background-color: #FFFFFF;
+ padding: 2px 3px 0 3px;
+ border-top: 1px solid #002C52;
+ border-left: 1px solid #002C52;
+ border-right: 1px solid #002C52;
+}
+
.headermiddle {
- vertical-align: bottom;
- height: 40px;
- width: 200px;
+ vertical-align: bottom;
+ height: 40px;
+ width: 200px;
}
+
.headerright {
- text-align: right;
- vertical-align: bottom;
- padding-right: 20px;
+ text-align: right;
+ vertical-align: bottom;
+ padding-right: 20px;
}
+
.infoleft {
- vertical-align: middle;
- text-align: left;
- font-size: 10px ;
- padding-left: 20px;
+ vertical-align: middle;
+ text-align: left;
+ font-size: 10px;
+ padding-left: 20px;
}
+
.inforight {
- width:200px;
- vertical-align: middle;
- text-align: right;
- font-size: 10px;
- padding: 4px 20px 4px 4px;
+ width: 200px;
+ vertical-align: middle;
+ text-align: right;
+ font-size: 10px;
+ padding: 4px 20px 4px 4px;
}
+
.inforight2 {
- vertical-align: middle;
- text-align: right;
- font-size: 10px;
-}
+ vertical-align: middle;
+ text-align: right;
+ font-size: 10px;
+}
+
/********************/
/** Formatierungen */
/********************/
-h1,h2,h3 {
- color: #0c4271;
- margin-top: 0;
+h1, h2, h3 {
+ color: #0c4271;
+ margin-top: 0;
}
+
h1 {
- text-align: left;
- font-size: 22px;
+ text-align: left;
+ font-size: 22px;
}
+
h2 {
- font-size: 14px;
+ font-size: 14px;
}
+
h3 {
- font-size: 14px;
- font-style:italic;
+ font-size: 14px;
+ font-style: italic;
}
+
/********************/
/** Menu **********/
/********************/
.menutable {
- margin: 0;
- padding: 0;
- border: none;
- text-align:left;
+ margin: 0;
+ padding: 0;
+ border: none;
+ text-align: left;
}
+
.menutable a {
- text-decoration: none;
- color: #666666;
+ text-decoration: none;
+ color: #666666;
}
+
.menutable a:hover {
- color: #FF00FF;
+ color: #FF00FF;
}
/*noinspection ALL*/
.menutable .menu_act {
- color: #FF0000;
- font-size: 12px;
- font-weight: bold;
- padding-left: 20px;
- height: 20px;
- background: url(../images/bg_menu_aktiv.png) repeat-x left top;
- width: 140px;
+ color: #FF0000;
+ font-size: 12px;
+ font-weight: bold;
+ padding-left: 20px;
+ height: 20px;
+ background: url(../images/bg_menu_aktiv.png) repeat-x left top;
+ width: 140px;
}
+
.menutable .menu_act a {
- color: #00396a;
+ color: #00396a;
}
+
.menutable .menu_act a:hover {
- color: #00396a;
+ color: #00396a;
}
+
.menutable .menu {
- color: #FFFFFF;
- font-size: 12px;
- font-weight: bold;
- padding-left: 20px;
- height: 20px;
- background: url(../images/bg_menu_inaktiv.png) repeat-x left top;
- width: 140px;
+ color: #FFFFFF;
+ font-size: 12px;
+ font-weight: bold;
+ padding-left: 20px;
+ height: 20px;
+ background: url(../images/bg_menu_inaktiv.png) repeat-x left top;
+ width: 140px;
}
+
.menutable .menu a {
- color: #d6d6d6;
+ color: #d6d6d6;
}
+
.menutable .menu a:hover {
- color: #FFFFFF;
+ color: #FFFFFF;
}
/*noinspection ALL*/
.menutable .menu_sub {
- font-size: 11px;
- color: #666666;
- text-decoration: none;
- height: 5px;
- padding-left: 30px;
- background: #FFFFFF url(../images/bg_submenu.png) repeat-y left top;
+ font-size: 11px;
+ color: #666666;
+ text-decoration: none;
+ height: 5px;
+ padding-left: 30px;
+ background: #FFFFFF url(../images/bg_submenu.png) repeat-y left top;
}
+
.menutable .menu_sub a {
- color: #666666;
+ color: #666666;
}
+
.menutable .menu_sub a:hover {
- color: #666666;
- text-decoration: underline;
+ color: #666666;
+ text-decoration: underline;
}
/*noinspection ALL*/
.menutable .menu_sub_act {
- font-size: 11px;
- font-weight: bold;
- color: #666666;
- text-decoration: none;
- height: 5px;
- padding-left: 30px;
- background: #FFFFFF url(../images/bg_submenu.png) repeat-y left top;
+ font-size: 11px;
+ font-weight: bold;
+ color: #666666;
+ text-decoration: none;
+ height: 5px;
+ padding-left: 30px;
+ background: #FFFFFF url(../images/bg_submenu.png) repeat-y left top;
}
+
.menutable .menu_sub_act a {
- color: #666666;
+ color: #666666;
}
+
.menutable .menu_sub_act a:hover {
- color: #666666;
- text-decoration: underline;
+ color: #666666;
+ text-decoration: underline;
}
+
.menulinksmall {
- font-size: 10px;
- color: #666666;
- text-decoration: none;
+ font-size: 10px;
+ color: #666666;
+ text-decoration: none;
}
+
/************************/
/** YUI definitions */
/************************/
#cal-cont .bd:after {
- content:".";
- display:block;
- clear:left;
- height:0;
- visibility:hidden;
+ content: ".";
+ display: block;
+ clear: left;
+ height: 0;
+ visibility: hidden;
}
+
#cal-cont .bd {
- padding:0;
+ padding: 0;
}
+
#cal-cont2 .bd:after {
- content:".";
- display:block;
- clear:left;
- height:0;
- visibility:hidden;
+ content: ".";
+ display: block;
+ clear: left;
+ height: 0;
+ visibility: hidden;
}
+
#cal-cont2 .bd {
- padding:0;
+ padding: 0;
}
+
#cal {
- border:none;
- padding:1em
+ border: none;
+ padding: 1em
}
+
.yui-content input[type="radio"] {
- background-color:#EDF5FF;
+ background-color: #EDF5FF;
}
+
.yui-content input[type="checkbox"] {
- background-color:#EDF5FF;
+ background-color: #EDF5FF;
}
\ No newline at end of file
diff --git a/doc/CHANGELOG b/doc/CHANGELOG
index 785d58e..1f55e4d 100644
--- a/doc/CHANGELOG
+++ b/doc/CHANGELOG
@@ -1,3 +1,37 @@
+CHANGELOG 3.5.0
+---------------
+- Support for PHP 8.x
+- Support for PHP < 7.2 dropped
+- [Bugfix] hosttemplate don't use "importance" in Nagios configuration version < 4.0
+
+CHANGELOG 3.4.1
+---------------
+- New setting to disable parent objects to optimize performance
+- New filter function for active and registered in supervision objects
+- New optional help text for command arguments ARG1 - ARG8
+- A config target now supports different port numbers for SSH/SFTP
+- [Bugfix] error page after installation and login when using https protocol
+- [Bugfix] timeperiod exclude and include function
+- [Bugfix] free variables supports special chars
+- [Bugfix] misc- and check commands now support special chars
+- Include all 3.4.0 hotfixes from GIT up to 2019-12-04
+ o Add GIT version number on support page and version check
+ o Nagios 4.0 update for mandatory fields
+ o [Bugfix] Missing PEAR path in scripting interface
+ o [Bugfix] Allowing special characters in ARG fields
+ o [Bugfix] Object copy after changing domain (config_id not set correctly)
+ o [Bugfix] Quote settings data für special chars in database password
+ o [Bugfix] Inserting time definitions when Nagios 3.x is selected in data domain
+ o [Bugfix] Object search and row sorting
+ o [Bugfix] Page numbers in service extinfo
+ o [Bugfix] Fixed some ancient bug in an error message of time periods
+ o [Bugfix] Nagios 4.0 update for mandatory fields
+ o [Bugfix] PHP5 compatibility update
+ o [Bugfix] Allowing quotes in arguments
+ o [Bugfix] Variable bug in downloads.php
+ o [Bugfix] Host copy bug fixed
+ o [Bugfix] Additional security hardening
+
CHANGELOG 3.4.0
---------------
- Support for PHP 7.x (developped and tested with PHP 7.2.4)
@@ -13,22 +47,22 @@ CHANGELOG 3.4.0
CHANGELOG 3.3.0
---------------
-- [OK] Support for PHP version 7.0 (not 7.1 or higher)
-- [OK] Database interface changed from mysql to mysqli
+- Support for PHP version 7.0 (not 7.1 or higher)
+- Database interface changed from mysql to mysqli
CHANGELOG 3.2.0
---------------
-- [OK] Enable/Disable regardless of register
-- [OK] HTML reworking
-- [OK] Domain separation (Data / Configuration)
-- [OK] Additional user settings
+- Enable/Disable regardless of register
+- HTML reworking
+- Domain separation (Data / Configuration)
+- Additional user settings
o Language
o Standard domain
-- [OK] Better HTML/CSS implementation for IE (scroll fields)
-- [OK] Configuration name is stored as free variable inside the configuration file
-- [OK] New support page with additional checks
-- [OK] New/reworked installer
-- [OK] Servicegroup support for servicedependencies and serviceescalations
-- [OK][BUG] Reworked service selection in servicedependencies and serviceescalations
-- [OK][BUG] Reworked right management (menu access / read rights)
+- Better HTML/CSS implementation for IE (scroll fields)
+- Configuration name is stored as free variable inside the configuration file
+- New support page with additional checks
+- New/reworked installer
+- Servicegroup support for servicedependencies and serviceescalations
+- [Bugfix] Reworked service selection in servicedependencies and serviceescalations
+- [Bugfix] Reworked right management (menu access / read rights)
diff --git a/doc/INSTALLATION_deDE.txt b/doc/INSTALLATION_deDE.txt
index 0da2e39..fca46f7 100644
--- a/doc/INSTALLATION_deDE.txt
+++ b/doc/INSTALLATION_deDE.txt
@@ -4,12 +4,12 @@
//
///////////////////////////////////////////////////////////////////////////////
//
-// (c) 2005-2018 by Martin Willisegger
+// (c) 2005-2022 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installations HowTo
// Website : https://sourceforge.net/projects/nagiosql/
-// Version : 3.4.0
+// Version : 3.5.0
// GIT Repo : https://gitlab.com/wizonet/NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
@@ -21,7 +21,7 @@
* Webserver z.B. Apache 2.x
* MySQL/MariaDB 5.x oder neuer
* Nagios 2.x/3.x/4.x oder Nagios kompatible Monitoringsoftware
- * PHP 5.5.0 oder groesser, inklusive:
+ * PHP 7.2.0 oder groesser, inklusive:
* PHP Module: Session
* PHP Module: MySQLi
* PHP Module: gettext
@@ -31,11 +31,26 @@
* Javascript im Webbrowser zugelassen
* Empfohlener Webbrowser: Mozilla Firefox
+==============================================
+= Installation der ssh2 Erweiterung mit PHP8 =
+==============================================
+Benötigte RPM/Software:
+ * php8-pecl
+ * php8-devel
+ * libssh2-devel
+ * make
+
+Installation mit:
+# pecl install ssh2-1.3.1
+
+Konfiguration in php.ini:
+extension=ssh2
+
===================
= Neuinstallation =
===================
- 1. Download und entpacken von NagiosQL 3.4 in einem Apache zugaenglichen Verzeichnis.
+ 1. Download und entpacken von NagiosQL 3.5 in einem Apache zugaenglichen Verzeichnis.
2. Der Installationsassistent wird automatisch durch Eingabe von install/index.php gestartet.
3. Die gewuenschte Sprache auswaehlen (siehe Appendix 2.)
4. Zum Installieren von NagiosQL den Anweisungen folgen.
@@ -47,11 +62,11 @@
1. Aktualisierungen von NagiosQL 1.x und 2.x sind leider nicht moeglich, bitte einfach eine neue Installation starten und
dann die Nagios Konfiguration durch den Import einbinden.
2. Aktualisierungen von NagiosQL 3.x
- a. Download und entpacken von NagiosQL 3.4 in ein NEUES Apache zugaenglichen Verzeichnis (DocumentRoot auf neues Verzeichnis
+ a. Download und entpacken von NagiosQL 3.5 in ein NEUES Apache zugaenglichen Verzeichnis (DocumentRoot auf neues Verzeichnis
aendern)
b. Wird dieselbe Apachekonfiguration verwendet (altes NagiosQL Verzeichnis wegkopieren, neues NagiosQL Verzeichnis bekommt
denselben Namen), sollte der Apache Demon vor dem Upgrade neu gestartet werden.
- c. Verschiebe die alte config/settings.php Datei in das neue NagiosQL 3.4 Verzeichnis config/
+ c. Verschiebe die alte config/settings.php Datei in das neue NagiosQL 3.5 Verzeichnis config/
d. Die alte Datenbank manuell sichern (z.Bsp. mit mysqldump)
e. Der Installationsassistent wird durch den Aufruf von install/index.php gestartet
f. Die gewuenschte Sprache waehlen (siehe auch Appendix 1.) und den Anweisungen folgen
diff --git a/doc/INSTALLATION_enGB.txt b/doc/INSTALLATION_enGB.txt
index 0a87d5b..02da545 100644
--- a/doc/INSTALLATION_enGB.txt
+++ b/doc/INSTALLATION_enGB.txt
@@ -4,12 +4,12 @@
//
///////////////////////////////////////////////////////////////////////////////
//
-// (c) 2005-2018 by Martin Willisegger
+// (c) 2005-2022 by Martin Willisegger
//
// Project : NagiosQL
// Component : Installation HowTo
// Website : https://sourceforge.net/projects/nagiosql/
-// Version : 3.4.0
+// Version : 3.5.0
// GIT Repo : https://gitlab.com/wizonet/NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
@@ -21,7 +21,7 @@
* Webserver like Apache 2.x
* MySQL/MariaDB 5.x or greater
* Nagios 2.x/3.x/4.x or Nagios compatible monitoring software
- * PHP 5.5.0 or greater including:
+ * PHP 7.2.0 or greater including:
* PHP Module: Session
* PHP Module: MySQLi
* PHP Module: gettext
@@ -31,11 +31,26 @@
* Javascript activated in Webbrowser
* Recommended Webbrowser: Mozilla Firefox
+============================================
+= Installation of ssh2 Extension with PHP8 =
+============================================
+Needed RPMs/Software:
+ * php8-pecl
+ * php8-devel
+ * libssh2-devel
+ * make
+
+Installation command:
+# pecl install ssh2-1.3.1
+
+Configuration in php.ini:
+extension=ssh2
+
================
NEW INSTALLATION
================
- 1. Download and extract NagiosQL 3.4 to a directory within your Apache Document Root
+ 1. Download and extract NagiosQL 3.5 to a directory within your Apache Document Root
2. Start the Installation Wizard by opening install/index.php
3. Switch to your preferred language (see Appendix 1.)
4. Follow the instructions to install NagiosQL
@@ -47,10 +62,10 @@ NEW INSTALLATION
1. Upgrade from NagiosQL 1.x and 2.x are not possible, you should better start at "New Installation" and after the installation is done,
import Nagios configuration files with NagiosQL
2. Upgrade from NagiosQL 3.x
- a. Download and extract NagiosQL 3.4 to a NEW directory and change your Apache DocumentRoot to the new directory
+ a. Download and extract NagiosQL 3.5 to a NEW directory and change your Apache DocumentRoot to the new directory
b. If the same Apache configuration is used (old NagiosQL directory moved away and new NagiosQL directory moved to the old
DocumentRoot), you should restart the apache demon before upgrade
- b. Move your old config/settings.php file to the new NagiosQL 3.4 config/ folder
+ b. Move your old config/settings.php file to the new NagiosQL 3.5 config/ folder
c. Backup your old NagiosQL database (as example with mysqldump)
d. Start the Installation Wizard by opening install/index.php
e. Switch to your preferred language (see Appendix) and follow the instructions
diff --git a/doc/README_SSH_KEY b/doc/README_SSH_KEY
index 2d4d6df..658416f 100644
--- a/doc/README_SSH_KEY
+++ b/doc/README_SSH_KEY
@@ -8,7 +8,7 @@ Local system
2. Create a path for the ssh keys
# mkdir /etc/nagiosql/ssh
2. Create a key pair (only rsa is supported!)
-# ssh-keygen -t rsa -b 4096
+# ssh-keygen -t rsa -m PEM -b 4096
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /etc/nagiosql/ssh/id_rsa
-> empty passphrase!
@@ -29,6 +29,15 @@ Enter file in which to save the key (/root/.ssh/id_rsa): /etc/nagiosql/ssh/id_rs
6.3. Fill in /etc/nagiosql/ssh/ as Directory of the key pair (without id_rsa)!
+Callback Error
+==============
+
+If you get a callback error when connecting to the remote system (variant SSH public key), the file
+id_rsa may not be in PEM format. Try a conversion with:
+# ssh-keygen -p -m PEM -f /etc/nagiosql/ssh/id_rsa
+-> empty passphrase!
+
+
Using passwort authentication (not recommended)
===============================================
diff --git a/functions/Autoloader.php b/functions/Autoloader.php
index fb634e8..ca157c8 100644
--- a/functions/Autoloader.php
+++ b/functions/Autoloader.php
@@ -1,18 +1,16 @@
preBasePath = $strBasePath;
@@ -39,21 +38,21 @@ class Autoloader
/**
* Load class from path
- * @param string $strClassName Class name
+ * @param string $strClassName Class name
*/
- public function loadClass($strClassName)
+ public function loadClass(string $strClassName): void
{
$className = ltrim($strClassName, '\\');
- $fileName = '';
+ $fileName = '';
$lastNsPos = strrpos($className, '\\');
- if ($lastNsPos != 0) {
- $namespace = substr($className, 0, $lastNsPos);
- $className = substr($className, $lastNsPos + 1);
- $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
+ if ($lastNsPos !== 0) {
+ $namespace = substr($className, 0, $lastNsPos);
+ $className = substr($className, $lastNsPos + 1);
+ $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
}
- $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
- $strFilePath1 = $this->preBasePath.$fileName;
- $strFilePath2 = $this->preBasePath.'install/'.$fileName;
+ $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
+ $strFilePath1 = $this->preBasePath . $fileName;
+ $strFilePath2 = $this->preBasePath . 'install/' . $fileName;
if (file_exists($strFilePath1) && is_readable($strFilePath1)) {
require_once $strFilePath1;
}
@@ -61,4 +60,4 @@ class Autoloader
require_once $strFilePath2;
}
}
-}
+}
\ No newline at end of file
diff --git a/functions/MysqliDbClass.php b/functions/MysqliDbClass.php
index a941a4b..f8cd913 100644
--- a/functions/MysqliDbClass.php
+++ b/functions/MysqliDbClass.php
@@ -1,68 +1,60 @@
DB server name
-// ----------- $arrParams['port'] -> DB server port
-// $arrParams['user'] -> DB server username
-// $arrParams['password'] -> DB server password
-// $arrParams['database'] -> DB server database name
-//
-///////////////////////////////////////////////////////////////////////////////////////////////
+
+/* ----------------------------------------------------------------------------
+ NagiosQL
+-------------------------------------------------------------------------------
+ (c) 2005-2022 by Martin Willisegger
+
+ Project : NagiosQL
+ Component : MySQLi data processing class
+ Website : https://sourceforge.net/projects/nagiosql/
+ Version : 3.5.0
+ GIT Repo : https://gitlab.com/wizonet/NagiosQL
+-----------------------------------------------------------------------------*/
+
+/* ----------------------------------------------------------------------------
+ Class: Common database functions for MySQL (mysqli database module)
+-------------------------------------------------------------------------------
+ Includes any functions to communicate with an MySQL database server
+ Name: MysqliDbClass
+ Class variables: $arrParams Array including the server settings
+ $strErrorMessage Database error string
+ $error Boolean - Error true/false
+ $strDBId Database connection id
+ $intLastId ID of last dataset
+ $intAffectedRows Counter variable of all affected data dows
+ $booSSLuse Use SSL connection
+
+ Parameters: $arrParams['server'] -> DB server name
+ $arrParams['port'] -> DB server port
+ $arrParams['user'] -> DB server username
+ $arrParams['password'] -> DB server password
+ $arrParams['database'] -> DB server database name
+-----------------------------------------------------------------------------*/
+
namespace functions;
class MysqliDbClass
{
- // Define class variables
- public $error = false; // Will be filled in functions
- public $strDBId; // Will be filled in functions
- public $intLastId = 0; // Will be filled in functions
- public $intAffectedRows = 0; // Will be filled in functions
- public $strErrorMessage = ''; // Will be filled in functions
- public $booSSLuse = false; // Defines if SSL is used or not
- public $arrParams = array(); // Must be filled in while initialization
+ /* Define class variables */
+ public $error = false; /* Will be filled in functions */
+ public $strDBId; /* Will be filled in functions */
+ public $intLastId = 0; /* Will be filled in functions */
+ public $intAffectedRows = 0; /* Will be filled in functions */
+ public $strErrorMessage = ''; /* Will be filled in functions */
+ public $booSSLuse = false; /* Defines if SSL is used or not */
+ public $arrParams = array(); /* Must be filled in while initialization */
/**
* MysqliDbClass constructor.
*/
public function __construct()
{
- $this->arrParams['server'] = '';
- $this->arrParams['port'] = 0;
- $this->arrParams['username'] = '';
- $this->arrParams['password'] = '';
- $this->arrParams['database'] = '';
+ $this->arrParams['server'] = '';
+ $this->arrParams['port'] = 0;
+ $this->arrParams['username'] = '';
+ $this->arrParams['password'] = '';
+ $this->arrParams['database'] = '';
}
/**
@@ -74,21 +66,162 @@ class MysqliDbClass
}
/**
- * Opens a connection to the database server and select a database
- * @param int $intMode 1 = connect only / 0 = connect + dbselect
- * @return bool true = successful / false = error
- * Status messages are stored in class variable
+ * Close database server connectuon
+ * @return bool true = successful / false = error
+ * @noinspection PhpReturnValueOfMethodIsNeverUsedInspection
*/
- public function hasDBConnection($intMode = 0)
+ private function dbDisconnect(): bool
+ {
+ return mysqli_close($this->strDBId);
+ }
+
+ /**
+ * Opens a connection to the database server and select a database
+ * @param int $intMode 1 = connect only / 0 = connect + dbselect
+ * @return bool true = successful / false = error
+ * Status messages are stored in class variable
+ */
+ public function hasDBConnection(int $intMode = 0): bool
{
$booReturn = true;
$this->dbconnect();
- if ($this->error == true) {
+ if ($this->error === true) {
$booReturn = false;
}
- if (($booReturn == true) && ($intMode == 0)) {
+ if (($booReturn === true) && ($intMode === 0)) {
$this->dbselect();
- if ($this->error == true) {
+ if ($this->error === true) {
+ $booReturn = false;
+ }
+ }
+ return $booReturn;
+ }
+
+ /**
+ * Connect to database server
+ * @param string $dbserver Server name
+ * @param int $dbport TCP port
+ * @param string $dbuser Database user
+ * @param string $dbpasswd Database password
+ * @return void true = successful / false = error
+ * Status messages are stored in class variable
+ * @noinspection PhpMissingParamTypeInspection
+ * @noinspection PhpSameParameterValueInspection
+ */
+ private function dbconnect($dbserver = null, int $dbport = 0, $dbuser = null, $dbpasswd = null): void
+ {
+ /* Reset error variables */
+ $this->strErrorMessage = '';
+ $this->error = false;
+ $booReturn = true;
+ /* Get parameters */
+ if ($dbserver === null) {
+ $dbserver = $this->arrParams['server'];
+ }
+ if ($dbport === 0) {
+ $dbport = $this->arrParams['port'];
+ }
+ if ($dbuser === null) {
+ $dbuser = $this->arrParams['username'];
+ }
+ if ($dbpasswd === null) {
+ $dbpasswd = $this->arrParams['password'];
+ }
+ /* Not all parameters available */
+ if (($dbserver === '') || ($dbuser === '') || ($dbpasswd === '')) {
+ $this->strErrorMessage .= gettext('Missing server connection parameter!') . '::';
+ $this->error = true;
+ $booReturn = false;
+ }
+ if ($booReturn === true) {
+ $this->dbinit();
+ /* if ($this->booSSLuse === true) {
+ TODO: TO BE DEFINED
+ }*/
+ $intErrorReporting = error_reporting();
+ error_reporting(0);
+ if ($dbport === 0) {
+ $booReturn = mysqli_real_connect($this->strDBId, $dbserver, $dbuser, $dbpasswd);
+ } else {
+ $booReturn = mysqli_real_connect($this->strDBId, $dbserver, $dbuser, $dbpasswd, null, $dbport);
+ }
+ error_reporting($intErrorReporting);
+ // Connection fails
+ if ($booReturn === false) {
+ $this->strErrorMessage = '[' . $dbserver . '] ' . gettext('Connection to the database server has failed '
+ . 'by reason:') . ' ::';
+ $strError = mysqli_connect_error();
+ $this->strErrorMessage .= $strError . '::';
+ $this->error = true;
+ }
+ /** PHP8 exception handling */
+ mysqli_report(MYSQLI_REPORT_ERROR);
+ }
+ }
+
+ /**
+ * Initialize a mysql database connection
+ * @return bool true = successful / false = error
+ * @noinspection PhpReturnValueOfMethodIsNeverUsedInspection
+ */
+ private function dbinit(): bool
+ {
+ $this->strDBId = mysqli_init();
+ return true;
+ }
+
+ /**
+ * Select a database
+ * @param string $database Database name
+ * @return bool true = successful / false = error
+ * Status messages are stored in class variable
+ * @noinspection PhpReturnValueOfMethodIsNeverUsedInspection
+ * @noinspection PhpMissingParamTypeInspection
+ * @noinspection PhpSameParameterValueInspection
+ */
+ private function dbselect($database = null): bool
+ {
+ /* Reset error variables */
+ $this->strErrorMessage = '';
+ $this->error = false;
+ $booReturn = true;
+ /* Get parameters */
+ if ($database === null) {
+ $database = $this->arrParams['database'];
+ }
+ /* Not all parameters available */
+ if ($database === '') {
+ $this->strErrorMessage .= gettext('Missing database connection parameter!') . '::';
+ $this->error = true;
+ $booReturn = false;
+ }
+ if ($booReturn === true) {
+ $intErrorReporting = error_reporting();
+ error_reporting(0);
+ $bolConnect = mysqli_select_db($this->strDBId, $database);
+ error_reporting($intErrorReporting);
+ /* Session cannot be etablished */
+ if (!$bolConnect) {
+ $this->strErrorMessage .= '[' . $database . '] ' .
+ gettext('Connection to the database has failed by reason:') . ' ::';
+ $this->strErrorMessage .= mysqli_error($this->strDBId) . '::';
+ $this->error = true;
+ $booReturn = false;
+ }
+ }
+ if ($booReturn === true) {
+ mysqli_query($this->strDBId, "set names 'utf8'");
+ if (mysqli_error($this->strDBId) !== '') {
+ $this->strErrorMessage .= mysqli_error($this->strDBId) . '::';
+ $this->error = true;
+ $booReturn = false;
+ }
+ }
+ if ($booReturn === true) {
+ mysqli_query($this->strDBId, "set session sql_mode = 'NO_ENGINE_SUBSTITUTION'");
+ if (mysqli_error($this->strDBId) !== '') {
+ $this->strErrorMessage .= mysqli_error($this->strDBId) . '::';
+ $this->error = true;
$booReturn = false;
}
}
@@ -97,112 +230,115 @@ class MysqliDbClass
/**
* Sends an SQL statement to the server and returns the result of the first data field
- * @param string $strSQL SQL Statement
- * @return string = successful / = error
- * Status messages are stored in class variable
+ * @param string $strSQL SQL Statement
+ * @return string = successful / = error
+ * Status messages are stored in class variable
*/
- public function getFieldData($strSQL)
+ public function getFieldData(string $strSQL): string
{
- // Reset error variables
+ /* Reset error variables */
$this->strErrorMessage = '';
- $this->error = false;
- $strReturn = '';
- // Send the SQL statement to the server
+ $this->error = false;
+ $strReturn = '';
+ /* Send the SQL statement to the server */
$resQuery = mysqli_query($this->strDBId, $strSQL);
- // Error processing
- if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == '')) {
- // Return the field value from position 0/0
+ /* Error processing */
+ if ($resQuery && (mysqli_num_rows($resQuery) !== 0) && (mysqli_error($this->strDBId) === '')) {
+ /* Return the field value from position 0/0 */
$arrDataset = mysqli_fetch_array($resQuery, MYSQLI_NUM);
$strReturn = $arrDataset[0];
- } elseif (mysqli_error($this->strDBId) != '') {
- $this->strErrorMessage .= mysqli_error($this->strDBId). '::';
- $this->error = true;
+ if ($strReturn === null) {
+ $strReturn = '';
+ }
+ } elseif (mysqli_error($this->strDBId) !== '') {
+ $this->strErrorMessage .= mysqli_error($this->strDBId) . '::';
+ $this->error = true;
}
return $strReturn;
}
/**
* Sends an SQL statement to the server and returns the result of the first data set
- * @param string $strSQL SQL Statement
- * @param array|null $arrDataset Result array (by reference)
- * @return bool true = successful / false = error
- * Status messages are stored in class variable
+ * @param string $strSQL SQL Statement
+ * @param array|null $arrDataset Result array (by reference)
+ * @return bool true = successful / false = error
+ * Status messages are stored in class variable
*/
- public function hasSingleDataset($strSQL, &$arrDataset)
+ public function hasSingleDataset(string $strSQL, ?array &$arrDataset): bool
{
- //$arrDataset = array();
- $booReturn = true;
- // Reset error variables
+ $arrDataset = array();
+ $booReturn = true;
+ /* Reset error variables */
$this->strErrorMessage = '';
- $this->error = false;
- // Send the SQL statement to the server
+ $this->error = false;
+ /* Send the SQL statement to the server */
$resQuery = mysqli_query($this->strDBId, $strSQL);
- // Error processing
- if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == '')) {
- // Put the values into the array
+ /* Error processing */
+ if ($resQuery && (mysqli_num_rows($resQuery) !== 0) && (mysqli_error($this->strDBId) === '')) {
+ /* Put the values into the array */
$arrDataset = mysqli_fetch_array($resQuery, MYSQLI_ASSOC);
- } elseif (mysqli_error($this->strDBId) != '') {
- $this->strErrorMessage .= mysqli_error($this->strDBId). '::';
- $this->error = true;
- $booReturn = false;
+ } elseif (mysqli_error($this->strDBId) !== '') {
+ $this->strErrorMessage .= mysqli_error($this->strDBId) . '::';
+ $this->error = true;
+ $booReturn = false;
}
return $booReturn;
}
/**
* Sends an SQL statement to the server and returns the result of all dataset in a data array
- * @param string $strSQL SQL Statement
- * @param array $arrDataset Result array (by reference)
- * @param int $intDataCount Number of data result sets
- * @return bool true = successful / false = error
- * Status messages are stored in class variable
+ * @param string $strSQL SQL Statement
+ * @param array|null $arrDataset Result array (by reference)
+ * @param int|null $intDataCount Number of data result sets
+ * @return bool true = successful / false = error
+ * Status messages are stored in class variable
*/
- public function hasDataArray($strSQL, &$arrDataset, &$intDataCount)
+ public function hasDataArray(string $strSQL, array &$arrDataset = null, int &$intDataCount = null): bool
{
- $arrDataset = array();
+ $arrDataset = array();
$intDataCount = 0;
- $booReturn = true;
- // Reset error variables
+ $booReturn = true;
+ /* Reset error variables */
$this->strErrorMessage = '';
- $this->error = false;
- // Send the SQL statement to the server
+ $this->error = false;
+ /* Send the SQL statement to the server */
$resQuery = mysqli_query($this->strDBId, $strSQL);
- // Error processing
- if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == '')) {
- $intDataCount = mysqli_num_rows($resQuery);
+ /* Error processing */
+ if ($resQuery && (mysqli_num_rows($resQuery) !== 0) && (mysqli_error($this->strDBId) === '')) {
+ $intDataCount = (int)mysqli_num_rows($resQuery);
$intCount = 0;
- // Put the values into the array
+ /* Put the values into the array */
while ($arrDataTemp = mysqli_fetch_array($resQuery, MYSQLI_ASSOC)) {
foreach ($arrDataTemp as $key => $value) {
$arrDataset[$intCount][$key] = $value;
}
$intCount++;
}
- } elseif (mysqli_error($this->strDBId) != '') {
- $this->strErrorMessage .= mysqli_error($this->strDBId). '::';
- $this->error = true;
- $booReturn = false;
+ } elseif (mysqli_error($this->strDBId) !== '') {
+ $this->strErrorMessage .= mysqli_error($this->strDBId) . '::';
+ $this->error = true;
+ $booReturn = false;
}
return $booReturn;
}
/**
* Insert/update or delete data
- * @param string $strSQL SQL Statement
- * @return bool true = successful / false = error
- * Status messages are stored in class variable
+ * @param string $strSQL SQL Statement
+ * @return bool true = successful / false = error
+ * Status messages are stored in class variable
*/
- public function insertData($strSQL)
+ public function insertData(string $strSQL): bool
{
- // Reset error variables
+ /* Reset error variables */
$this->strErrorMessage = '';
- $this->error = false;
- $booReturn = false;
- // Send the SQL statement to the server
- if ($strSQL != '') {
+ $this->error = false;
+ $booReturn = false;
+ /* Send the SQL statement to the server */
+ if ($strSQL !== '') {
mysqli_query($this->strDBId, $strSQL);
- // Error processing
- if (mysqli_error($this->strDBId) == '') {
+ /* Error processing */
+ if (mysqli_error($this->strDBId) === '') {
$this->intLastId = mysqli_insert_id($this->strDBId);
$this->intAffectedRows = mysqli_affected_rows($this->strDBId);
$booReturn = true;
@@ -216,197 +352,65 @@ class MysqliDbClass
/**
* Count the sum of data records
- * @param string $strSQL SQL Statement
- * @return int = successful / 0 = no dataset or error
- * Status messages are stored in class variable
+ * @param string $strSQL SQL Statement
+ * @return int = successful / 0 = no dataset or error
+ * Status messages are stored in class variable
*/
- public function countRows($strSQL)
+ public function countRows(string $strSQL): int
{
- // Reset error variables
+ /* Reset error variables */
$this->strErrorMessage = '';
- $this->error = false;
- $intReturn = 0;
- // Send the SQL statement to the server
+ $this->error = false;
+ $intReturn = 0;
+ /* Send the SQL statement to the server */
$resQuery = mysqli_query($this->strDBId, $strSQL);
- // Error processing
- if ($resQuery && (mysqli_error($this->strDBId) == '')) {
+ /* Error processing */
+ if ($resQuery && (mysqli_error($this->strDBId) === '')) {
$intReturn = mysqli_num_rows($resQuery);
} else {
$this->strErrorMessage .= mysqli_error($this->strDBId);
- $this->error = true;
+ $this->error = true;
}
return $intReturn;
}
/**
* Returns a safe insert string for database manipulations
- * @param string $strInput Input String
- * @return string Output String
+ * @param string $strInput Input String
+ * @return string Output String
*/
- public function realEscape($strInput)
+ public function realEscape(string $strInput): string
{
return mysqli_real_escape_string($this->strDBId, $strInput);
}
- /**
- * Initialize a mysql database connection
- * @return bool true = successful / false = error
- */
- private function dbinit()
- {
- $this->strDBId = mysqli_init();
- return true;
- }
-
- /**
- * Connect to database server
- * @param string $dbserver Server name
- * @param int $dbport TCP port
- * @param string $dbuser Database user
- * @param string $dbpasswd Database password
- * @return bool true = successful / false = error
- * Status messages are stored in class variable
- */
- private function dbconnect($dbserver = null, $dbport = null, $dbuser = null, $dbpasswd = null)
- {
- // Reset error variables
- $this->strErrorMessage = '';
- $this->error = false;
- $booReturn = true;
- // Get parameters
- if ($dbserver == null) {
- $dbserver = $this->arrParams['server'];
- }
- if ($dbport == null) {
- $dbport = $this->arrParams['port'];
- }
- if ($dbuser == null) {
- $dbuser = $this->arrParams['username'];
- }
- if ($dbpasswd == null) {
- $dbpasswd = $this->arrParams['password'];
- }
- // Not all parameters available
- if (($dbserver == '') || ($dbuser == '') || ($dbpasswd == '')) {
- $this->strErrorMessage .= gettext('Missing server connection parameter!'). '::';
- $this->error = true;
- $booReturn = false;
- }
- if ($booReturn == true) {
- $this->dbinit();
- //if ($this->booSSLuse == true) {
- // TO BE DEFINED
- //}
- $intErrorReporting = error_reporting();
- error_reporting(0);
- if ($dbport == 0) {
- $booReturn = mysqli_real_connect($this->strDBId, $dbserver, $dbuser, $dbpasswd);
- } else {
- $booReturn = mysqli_real_connect($this->strDBId, $dbserver, $dbuser, $dbpasswd, null, $dbport);
- }
- error_reporting($intErrorReporting);
- // Connection fails
- if ($booReturn == false) {
- $this->strErrorMessage = '[' .$dbserver. '] ' .gettext('Connection to the database server has failed '
- . 'by reason:'). ' ::';
- $strError = mysqli_connect_error();
- $this->strErrorMessage .= $strError. '::';
- $this->error = true;
- }
- }
- return $booReturn;
- }
-
- /**
- * Select a database
- * @param string $database Database name
- * @return bool true = successful / false = error
- * Status messages are stored in class variable
- */
- private function dbselect($database = null)
- {
- // Reset error variables
- $this->strErrorMessage = '';
- $this->error = false;
- $booReturn = true;
- // Get parameters
- if ($database == null) {
- $database = $this->arrParams['database'];
- }
- // Not all parameters available
- if ($database == '') {
- $this->strErrorMessage .= gettext('Missing database connection parameter!'). '::';
- $this->error = true;
- $booReturn = false;
- }
- if ($booReturn == true) {
- $bolConnect = mysqli_select_db($this->strDBId, $database);
- // Session cannot be etablished
- if (!$bolConnect) {
- $this->strErrorMessage .= '[' .$database. '] ' .
- gettext('Connection to the database has failed by reason:'). ' ::';
- $this->strErrorMessage .= mysqli_error($this->strDBId). '::';
- $this->error = true;
- $booReturn = false;
- }
- }
- if ($booReturn == true) {
- mysqli_query($this->strDBId, "set names 'utf8'");
- if (mysqli_error($this->strDBId) != '') {
- $this->strErrorMessage .= mysqli_error($this->strDBId). '::';
- $this->error = true;
- $booReturn = false;
- }
- }
- if ($booReturn == true) {
- mysqli_query($this->strDBId, "set session sql_mode = 'NO_ENGINE_SUBSTITUTION'");
- if (mysqli_error($this->strDBId) != '') {
- $this->strErrorMessage .= mysqli_error($this->strDBId). '::';
- $this->error = true;
- $booReturn = false;
- }
- }
- return $booReturn;
- }
-
- /*
/**
* Set SSL connection parameters
- * @param string $sslkey SSL key
- * @param string $sslcert SSL certificate
- * @param string $sslca SSL CA file (optional)
- * @param string $sslpath SSL certificate path (optional)
- * @param string $sslcypher SSL cypher (optional)
- * @return bool true = successful
- * Status messages are stored in class variable
+ * @param string $sslkey SSL key
+ * @param string $sslcert SSL certificate
+ * @param string|null $sslca SSL CA file (optional)
+ * @param string|null $sslpath SSL certificate path (optional)
+ * @param string|null $sslcypher SSL cypher (optional)
+ * @return bool true = successful
+ * Status messages are stored in class variable
+ * @noinspection PhpSameParameterValueInspection
+ * @noinspection PhpUnusedPrivateMethodInspection
*/
- /*
- private function dbsetssl($sslkey, $sslcert, $sslca = null, $sslpath = null, $sslcypher = null)
+ private function dbsetssl(string $sslkey, string $sslcert, string $sslca = null, string $sslpath = null, string $sslcypher = null): bool
{
- // Reset error variables
+ /* Reset error variables */
$this->strErrorMessage = "";
- $this->error = false;
- $booReturn = true;
- // Values are missing
- if (($sslkey == "") || ($sslcert == "")) {
- $this->strErrorMessage = gettext("Missing MySQL SSL parameter!")."::";
- $this->error = true;
- $booReturn = false;
+ $this->error = false;
+ $booReturn = true;
+ /* Values are missing */
+ if (($sslkey === "") || ($sslcert === "")) {
+ $this->strErrorMessage = gettext("Missing MySQL SSL parameter!") . "::";
+ $this->error = true;
+ $booReturn = false;
}
- if ($booReturn == true) {
+ if ($booReturn === true) {
mysqli_ssl_set($this->strDBId, $sslkey, $sslcert, $sslca, $sslpath, $sslcypher);
}
- return($booReturn);
+ return ($booReturn);
}
- */
-
- /**
- * Close database server connectuon
- * @return bool true = successful / false = error
- */
- private function dbDisconnect()
- {
- mysqli_close($this->strDBId);
- return true;
- }
-}
+}
\ No newline at end of file
diff --git a/functions/NagConfigClass.php b/functions/NagConfigClass.php
index b9b5d92..d177d10 100644
--- a/functions/NagConfigClass.php
+++ b/functions/NagConfigClass.php
@@ -1,160 +1,147 @@
arrSettings = $arrSession['SETS'];
}
if (isset($arrSession['domain'])) {
- $this->intDomainId = $arrSession['domain'];
+ $this->intDomainId = (int)$arrSession['domain'];
}
$this->arrSession = $arrSession;
}
- /**
- * Get domain configuration parameters.
- * @param string $strConfigItem Configuration key
- * @param string $strValue Configuration value (by reference)
- * @return int 0 = successful / 1 = error
- */
- public function getDomainData($strConfigItem, &$strValue)
- {
- // Variable definition
- $intReturn = 0;
- // Request domain data from database
- $strSQL = 'SELECT `' .$strConfigItem. '` FROM `tbl_datadomain` WHERE `id` = ' .$this->intDomainId;
- $strValue = $this->myDBClass->getFieldData($strSQL);
- if ($strValue == '') {
- $intReturn = 1;
- }
- return $intReturn;
- }
-
/**
* Get last modification date of a database table and any configuration files inside a directory.
- * @param string $strTableName Name of the database table
- * @param string $strConfigName Name of the configuration file
- * @param int $intDataId ID of the dataset for service table
- * @param array $arrTimeData Array with the timestamps of the files and the DB table (by reference)
- * @param int $intTimeInfo Time status value (by reference)
- * 0 = all files are newer than the database item
- * 1 = some file are older than the database item
- * 2 = one file is missing
- * 3 = any files are missing
- * 4 = no configuration targets defined
- * @return int 0 = successful / 1 = error
- * Status messages are stored in class variables
+ * @param string $strTableName Name of the database table
+ * @param string $strConfigName Name of the configuration file
+ * @param int $intDataId ID of the dataset for service table
+ * @param array|null $arrTimeData Array with the timestamps of the files and the DB table (by reference)
+ * @param int|null $intTimeInfo Time status value (by reference)
+ * 0 = all files are newer than the database item
+ * 1 = some files are older than the database item
+ * 2 = one file is missing
+ * 3 = any files are missing
+ * 4 = no configuration targets defined
+ * @return int 0 = successful / 1 = error
+ * Status messages are stored in class variables
*/
- public function lastModifiedDir($strTableName, $strConfigName, $intDataId, &$arrTimeData, &$intTimeInfo)
+ public function lastModifiedDir(string $strTableName, string $strConfigName, int $intDataId, array &$arrTimeData = null, int &$intTimeInfo = null): int
{
- // Variable definitions
- $intReturn = 0;
- // Create file name
- $strFileName = $strConfigName. '.cfg';
- // Get table times
- $strActive = 0;
- $arrTimeData = array();
+ /* Variable definitions */
+ $intReturn = 0;
+ /* Create file name */
+ $strFileName = $strConfigName . '.cfg';
+ /* Get table times */
+ $strActive = 0;
+ $arrTimeData = array();
$arrTimeData['table'] = 'unknown';
- // Clear status cache
+ /* Clear status cache */
clearstatcache();
- // Get last change on dataset
- if ($strTableName == 'tbl_host') {
- $strSQL1 = "SELECT DATE_FORMAT(`last_modified`,'%Y-%m-%d %H:%i:%s') FROM `tbl_host` ".
- "WHERE `host_name`='$strConfigName' AND `config_id`=".$this->intDomainId;
- $strSQL2 = "SELECT `active` FROM `tbl_host` WHERE `host_name`='$strConfigName' ".
- 'AND `config_id`=' .$this->intDomainId;
+ /* Get last change on dataset */
+ if ($strTableName === 'tbl_host') {
+ $strSQL1 = "SELECT DATE_FORMAT(`last_modified`,'%Y-%m-%d %H:%i:%s') FROM `tbl_host` " .
+ "WHERE `host_name`='$strConfigName' AND `config_id`=" . $this->intDomainId;
+ $strSQL2 = "SELECT `active` FROM `tbl_host` WHERE `host_name`='$strConfigName' " .
+ 'AND `config_id`=' . $this->intDomainId;
$arrTimeData['table'] = $this->myDBClass->getFieldData($strSQL1);
- $strActive = $this->myDBClass->getFieldData($strSQL2);
- } elseif ($strTableName == 'tbl_service') {
- $strSQL1 = "SELECT DATE_FORMAT(`last_modified`,'%Y-%m-%d %H:%i:%s') FROM `tbl_service` ".
- "WHERE `id`='$intDataId' AND `config_id`=".$this->intDomainId;
- $strSQL2 = "SELECT * FROM `$strTableName` WHERE `config_name`='$strConfigName' ".
- 'AND `config_id`=' .$this->intDomainId." AND `active`='1'";
+ $strActive = $this->myDBClass->getFieldData($strSQL2);
+ } elseif ($strTableName === 'tbl_service') {
+ $strSQL1 = "SELECT DATE_FORMAT(`last_modified`,'%Y-%m-%d %H:%i:%s') FROM `tbl_service` " .
+ "WHERE `id`='$intDataId' AND `config_id`=" . $this->intDomainId;
+ /** @noinspection SqlResolve */
+ $strSQL2 = "SELECT * FROM `$strTableName` WHERE `config_name`='$strConfigName' " .
+ 'AND `config_id`=' . $this->intDomainId . " AND `active`='1'";
$arrTimeData['table'] = $this->myDBClass->getFieldData($strSQL1);
- $intServiceCount = $this->myDBClass->countRows($strSQL2);
- if ($intServiceCount != 0) {
+ $intServiceCount = $this->myDBClass->countRows($strSQL2);
+ if ($intServiceCount !== 0) {
$strActive = 1;
}
} else {
$intReturn = 1;
}
- // Get config sets
- $arrConfigId = array();
- $strTarget = '';
- $strBaseDir = '';
- $intTimeInfo = -1;
- $intRetVal2 = $this->getConfigTargets($arrConfigId);
- if ($intRetVal2 == 0) {
+ /* Get config sets */
+ $arrConfigId = array();
+ $strTarget = '';
+ $strBaseDir = '';
+ $intTimeInfo = -1;
+ $intRetVal2 = $this->getConfigTargets($arrConfigId);
+ if ($intRetVal2 === 0) {
foreach ($arrConfigId as $intConfigId) {
- // Get configuration file data
+ /* Get configuration file data */
$this->getConfigValues($intConfigId, 'target', $strTarget);
- // Get last change on dataset
- if ($strTableName == 'tbl_host') {
+ /* Get last change on dataset */
+ if ($strTableName === 'tbl_host') {
$this->getConfigValues($intConfigId, 'hostconfig', $strBaseDir);
- } elseif ($strTableName == 'tbl_service') {
+ } elseif ($strTableName === 'tbl_service') {
$this->getConfigValues($intConfigId, 'serviceconfig', $strBaseDir);
}
$arrTimeData[$strTarget] = 'unknown';
- $intFileStampTemp = -1;
- // Get time data
+ $intFileStampTemp = -1;
+ /* Get time data */
$intReturn = $this->getFileDate(
$intConfigId,
$strFileName,
@@ -162,28 +149,28 @@ class NagConfigClass
$intFileStampTemp,
$arrTimeData[$strTarget]
);
- if (($intFileStampTemp == 0) && ($strActive == '1')) {
+ if (($intFileStampTemp === 0) && ($strActive === '1')) {
$intTimeInfo = 2;
}
- if (($strActive == '1') && (strtotime($arrTimeData['table']) > $intFileStampTemp)) {
+ if (($strActive === '1') && (strtotime($arrTimeData['table']) > $intFileStampTemp)) {
$intTimeInfo = 1;
}
}
- $intItems = \count($arrTimeData) - 1;
- $intUnknown = 0;
+ $intItems = count($arrTimeData) - 1;
+ $intUnknown = 0;
$intUpToDate = 0;
foreach ($arrTimeData as $key) {
- if ($key == 'unknown') {
+ if ($key === 'unknown') {
$intUnknown++;
}
if (strtotime($arrTimeData['table']) < strtotime($key)) {
$intUpToDate++;
}
}
- if ($intUnknown == $intItems) {
+ if ($intUnknown === $intItems) {
$intTimeInfo = 3;
}
- if ($intUpToDate == $intItems) {
+ if ($intUpToDate === $intItems) {
$intTimeInfo = 0;
}
} else {
@@ -194,20 +181,20 @@ class NagConfigClass
/**
* Get configuration target IDs
- * @param array $arrConfigId Configuration target IDs (by reference)
- * @return int 0 = successful / 1 = error
+ * @param array|null $arrConfigId Configuration target IDs (by reference)
+ * @return int 0 = successful / 1 = error
*/
- public function getConfigTargets(&$arrConfigId)
+ public function getConfigTargets(array &$arrConfigId = null): int
{
- // Variable definition
- $arrData = array();
- $arrConfigId = array();
+ /* Variable definition */
+ $arrData = array();
+ $arrConfigId = array();
$intDataCount = 0;
- $intReturn = 1;
- // Request target ID
- $strSQL = 'SELECT `targets` FROM `tbl_datadomain` WHERE `id`=' .$this->intDomainId;
+ $intReturn = 1;
+ /* Request target ID */
+ $strSQL = 'SELECT `targets` FROM `tbl_datadomain` WHERE `id`=' . $this->intDomainId;
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn && ($intDataCount != 0)) {
+ if ($booReturn && ($intDataCount !== 0)) {
foreach ($arrData as $elem) {
$arrConfigId[] = $elem['targets'];
}
@@ -218,19 +205,19 @@ class NagConfigClass
/**
* Get configuration domain values
- * @param int $intConfigId Configuration ID
- * @param string $strConfigKey Configuration key
- * @param string $strValue Configuration value (by reference)
- * @return int 0 = successful / 1 = error
+ * @param int $intConfigId Configuration ID
+ * @param string $strConfigKey Configuration key
+ * @param string|null $strValue Configuration value (by reference)
+ * @return int 0 = successful / 1 = error
*/
- public function getConfigValues($intConfigId, $strConfigKey, &$strValue)
+ public function getConfigValues(int $intConfigId, string $strConfigKey, string &$strValue = null): int
{
- // Define variables
+ /* Define variables */
$intReturn = 1;
- // Read database
- $strSQL = 'SELECT `' .$strConfigKey. '` FROM `tbl_configtarget` WHERE `id`=' .$intConfigId;
- $strValue = $this->myDBClass->getFieldData($strSQL);
- if ($strValue != '') {
+ /* Read database */
+ $strSQL = 'SELECT `' . $strConfigKey . '` FROM `tbl_configtarget` WHERE `id`=' . $intConfigId;
+ $strValue = $this->myDBClass->getFieldData($strSQL);
+ if ($strValue !== '') {
$intReturn = 0;
}
return $intReturn;
@@ -238,46 +225,48 @@ class NagConfigClass
/**
* Get last modification date of a configuration file.
- * @param int $intConfigId Configuration ID
- * @param string $strFile Configuration file name
- * @param string $strBaseDir Base directory with configuration file
- * @param int|bool $intFileStamp File timestamp (by reference)
- * @param string $strTimeData Human readable string of file time stamp (by reference)
- * @return int 0 = successful / 1 = error
+ * @param int $intConfigId Configuration ID
+ * @param string $strFile Configuration file name
+ * @param string $strBaseDir Base directory with configuration file
+ * @param bool|int $intFileStamp File timestamp (by reference)
+ * @param string|null $strTimeData Human-readable string of file time stamp (by reference)
+ * @return int 0 = successful / 1 = error
*/
- public function getFileDate($intConfigId, $strFile, $strBaseDir, &$intFileStamp, &$strTimeData)
+ public function getFileDate(int $intConfigId, string $strFile, string $strBaseDir, bool &$intFileStamp, string &$strTimeData = null): int
{
- $strMethod = 1;
- $intReturn = 0;
- // Get configuration file data
- $this->getConfigValues($intConfigId, 'method', $strMethod);
- $strTimeData = 'unknown';
+ $intMethod = 1;
+ $intReturn = 0;
+ /* Get configuration file data */
+ if ($this->getConfigValues($intConfigId, 'method', $strMethod) === 0) {
+ $intMethod = (int)$strMethod;
+ }
+ $strTimeData = 'unknown';
$intFileStamp = -1;
- // Lokal file system
- if (($strMethod == 1) && file_exists($strBaseDir. '/' .$strFile)) {
- $intFileStamp = filemtime($strBaseDir. '/' .$strFile);
+ /* Lokal file system */
+ if (($intMethod === 1) && file_exists($strBaseDir . '/' . $strFile)) {
+ $intFileStamp = filemtime($strBaseDir . '/' . $strFile);
$strTimeData = date('Y-m-d H:i:s', $intFileStamp);
- } elseif ($strMethod == 2) { // FTP file system
- // Check connection
+ } elseif ($intMethod === 2) { // FTP file system
+ /* Check connection */
$intReturn = $this->getFTPConnection($intConfigId);
- if ($intReturn == 0) {
- $intFileStamp = ftp_mdtm($this->resConnectId, $strBaseDir . '/' . $strFile);
- if ($intFileStamp != -1) {
+ if ($intReturn === 0) {
+ $intFileStamp = ftp_mdtm($this->conFTPConId, $strBaseDir . '/' . $strFile);
+ if ($intFileStamp !== -1) {
$strTimeData = date('Y-m-d H:i:s', $intFileStamp);
}
}
- } elseif ($strMethod == 3) { // SSH file system
- // Check connection
+ } elseif ($intMethod === 3) { // SSH file system
+ /* Check connection */
$intReturn = $this->getSSHConnection($intConfigId);
- // Check file date
- $strFilePath = str_replace('//', '/', $strBaseDir.'/'.$strFile);
- $strCommand = 'ls '.$strFilePath;
- $arrResult = array();
- if (($intReturn == 0) && ($this->sendSSHCommand($strCommand, $arrResult) == 0) &&
- isset($arrResult[0]) && ($arrResult[0] == $strFilePath)) {
- $arrInfo = ssh2_sftp_stat($this->resSFTP, $strFilePath);
+ /* Check file date */
+ $strFilePath = str_replace('//', '/', $strBaseDir . '/' . $strFile);
+ $strCommand = 'ls ' . $strFilePath;
+ $arrResult = array();
+ if (($intReturn === 0) && ($this->sendSSHCommand($strCommand, $arrResult) === 0) &&
+ isset($arrResult[0]) && ($arrResult[0] === $strFilePath)) {
+ $arrInfo = ssh2_sftp_stat($this->resSFTP, $strFilePath);
$intFileStamp = $arrInfo['mtime'];
- if ($intFileStamp != -1) {
+ if ($intFileStamp !== -1) {
$strTimeData = date('Y-m-d H:i:s', $intFileStamp);
}
}
@@ -287,57 +276,63 @@ class NagConfigClass
/**
* Open an FTP connection
- * @param int $intConfigID Configuration ID
- * @return int 0 = successful / 1 = error
- * Status messages are stored in class variables
+ * @param int $intConfigID Configuration ID
+ * @return int 0 = successful / 1 = error
+ * Status messages are stored in class variables
*/
- public function getFTPConnection($intConfigID)
+ public function getFTPConnection(int $intConfigID): int
{
- // Define variables
+ /* Define variables */
$intReturn = 0;
- $arrError = array();
- // Already connected?
- if (empty($this->resConnectId) || !\is_resource($this->resConnectId) || ($this->resConnectType != 'FTP')) {
- // Define variables
+ $arrError = array();
+ $strServer = '';
+ $intFtpSecure = 0;
+ /* Already connected? */
+ if (empty($this->conFTPConId) || !is_resource($this->conFTPConId) || ($this->resConnectType !== 'FTP')) {
+ /* Define variables */
$booLogin = false;
- $this->getConfigValues($intConfigID, 'server', $strServer);
- $this->getConfigValues($intConfigID, 'ftp_secure', $intFtpSecure);
- // Set up basic connection
+ if ($this->getConfigValues($intConfigID, 'server', $strServerVal) === 0) {
+ $strServer = $strServerVal;
+ }
+ if ($this->getConfigValues($intConfigID, 'ftp_secure', $strFtpSecure) === 0) {
+ $intFtpSecure = (int)$strFtpSecure;
+ }
+ /* Set up basic connection */
$this->resConnectServer = $strServer;
$this->resConnectType = 'FTP';
- // Secure FTP?
- if ($intFtpSecure == 1) {
- $this->resConnectId = ftp_ssl_connect($strServer);
+ /* Secure FTP? */
+ if ($intFtpSecure === 1) {
+ $this->conFTPConId = ftp_ssl_connect($strServer);
} else {
- $this->resConnectId = ftp_connect($strServer);
+ $this->conFTPConId = ftp_connect($strServer);
}
- // Login with username and password
- if ($this->resConnectId) {
+ /* Login with username and password */
+ if ($this->conFTPConId) {
$this->getConfigValues($intConfigID, 'user', $strUser);
$this->getConfigValues($intConfigID, 'password', $strPasswd);
$intErrorReporting = error_reporting();
error_reporting('0');
- $booLogin = ftp_login($this->resConnectId, $strUser, $strPasswd);
+ $booLogin = ftp_login($this->conFTPConId, $strUser, $strPasswd);
$arrError = error_get_last();
error_reporting($intErrorReporting);
- if ($booLogin == false) {
- ftp_close($this->resConnectId);
+ if ($booLogin === false) {
+ ftp_close($this->conFTPConId);
$this->resConnectServer = '';
- $this->resConnectType = 'none';
- $this->resConnectId = null;
+ $this->resConnectType = 'none';
+ $this->conFTPConId = null;
$intReturn = 1;
} else {
- // Change to PASV mode
- ftp_pasv($this->resConnectId, true);
+ /* Change to PASV mode */
+ ftp_pasv($this->conFTPConId, true);
}
}
- // Check connection
- if ((!$this->resConnectId) || (!$booLogin)) {
+ /* Check connection */
+ if ((!$this->conFTPConId) || (!$booLogin)) {
$this->myDataClass->writeLog(translate('Connection to remote system failed (FTP connection):') .
' ' . $strServer);
$this->processClassMessage(translate('Connection to remote system failed (FTP connection):') .
' ' . $strServer . '::', $this->strErrorMessage);
- if ($arrError !== null && ($arrError['message'] != '')) {
+ if ($arrError !== null && ((string)$arrError['message'] !== '')) {
$this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage);
}
}
@@ -346,115 +341,139 @@ class NagConfigClass
}
/**
- * Open an SSH connection
- * @param int $intConfigID Configuration ID
- * @return int 0 = successful / 1 = error
- * Status messages are stored in class variables
+ * Merge message strings and check for duplicate messages
+ * @param string $strNewMessage New message to add
+ * @param string|null $strOldMessage Modified message string (by reference)
*/
- public function getSSHConnection($intConfigID)
+ public function processClassMessage(string $strNewMessage, string &$strOldMessage = null): void
{
- // Define variables
- $intReturn = 0;
+ $strNewMessage = str_replace('::::', '::', $strNewMessage);
+ if (($strOldMessage !== '') && ($strNewMessage !== '') && (substr_count($strOldMessage, $strNewMessage) === 0)) {
+ $strOldMessage .= $strNewMessage;
+ } elseif ($strOldMessage === '') {
+ $strOldMessage .= $strNewMessage;
+ }
+ }
+
+ /**
+ * Open an SSH connection
+ * @param int $intConfigID Configuration ID
+ * @return int 0 = successful / 1 = error
+ * Status messages are stored in class variables
+ */
+ public function getSSHConnection(int $intConfigID): int
+ {
+ /* Define variables */
+ $intReturn = 0;
$strPasswordNote = '';
- // Already connected?
- if (empty($this->resConnectId) || !\is_resource($this->resConnectId) || ($this->resConnectType != 'SSH')) {
- // SSH Possible
- if (!\function_exists('ssh2_connect')) {
- $this->processClassMessage(translate('SSH module not loaded!'). '::', $this->strErrorMessage);
+ $strServer = '';
+ $intPort = 22;
+ /* Already connected? */
+ if (empty($this->resSSHConId) || !is_resource($this->resSSHConId) || ($this->resConnectType !== 'SSH')) {
+ /* SSH Possible */
+ if (!function_exists('ssh2_connect')) {
+ $this->processClassMessage(translate('SSH module not loaded!') . '::', $this->strErrorMessage);
return 1;
}
- // Define variables
+ /* Define variables */
$booLogin = false;
- $this->getConfigValues($intConfigID, 'server', $strServer);
+ if ($this->getConfigValues($intConfigID, 'server', $strServerVal) === 0) {
+ $strServer = $strServerVal;
+ }
+ if ($this->getConfigValues($intConfigID, 'port', $strPort) === 0) {
+ $intPort = (int)$strPort;
+ if ($intPort === 0) {
+ $intPort = 22;
+ }
+ }
$this->resConnectServer = $strServer;
- $this->resConnectType = 'SSH';
- $intErrorReporting = error_reporting();
+ $this->resConnectType = 'SSH';
+ $intErrorReporting = error_reporting();
error_reporting(0);
- $this->resConnectId = ssh2_connect($strServer);
+ $this->resSSHConId = ssh2_connect($strServer, $intPort);
$arrError = error_get_last();
error_reporting($intErrorReporting);
- // Check connection
- if ($this->resConnectId) {
- // Login with username and password
+ /* Check connection */
+ if ($this->resSSHConId) {
+ /* Login with username and password */
$this->getConfigValues($intConfigID, 'user', $strUser);
$this->getConfigValues($intConfigID, 'password', $strPasswd);
$this->getConfigValues($intConfigID, 'ssh_key_path', $strSSHKeyPath);
- if ($strSSHKeyPath != '') {
- $strPublicKey = str_replace('//', '/', $strSSHKeyPath.'/id_rsa.pub');
- $strPrivatKey = str_replace('//', '/', $strSSHKeyPath.'/id_rsa');
- // Check if ssh key file are readable
+ if ($strSSHKeyPath !== '') {
+ $strPublicKey = str_replace('//', '/', $strSSHKeyPath . '/id_rsa.pub');
+ $strPrivatKey = str_replace('//', '/', $strSSHKeyPath . '/id_rsa');
+ /* Check if ssh key file are readable */
if (!file_exists($strPublicKey) || !is_readable($strPublicKey)) {
$this->myDataClass->writeLog(translate('SSH public key does not exist or is not readable')
- . ' ' . $strSSHKeyPath.$strPublicKey);
+ . ' ' . $strSSHKeyPath . $strPublicKey);
$this->processClassMessage(translate('SSH public key does not exist or is not readable')
- . ' ' . $strSSHKeyPath.$strPublicKey. '::', $this->strErrorMessage);
+ . ' ' . $strSSHKeyPath . $strPublicKey . '::', $this->strErrorMessage);
$intReturn = 1;
}
if (!file_exists($strPrivatKey) || !is_readable($strPrivatKey)) {
$this->myDataClass->writeLog(translate('SSH private key does not exist or is not readable')
. ' ' . $strPrivatKey);
- $this->processClassMessage(translate('SSH private key does not exist or is not readable'). ' ' .
- $strPrivatKey. '::', $this->strErrorMessage);
+ $this->processClassMessage(translate('SSH private key does not exist or is not readable') . ' ' .
+ $strPrivatKey . '::', $this->strErrorMessage);
$intReturn = 1;
}
- $intErrorReporting = error_reporting();
+ $intErrorReporting = error_reporting();
error_reporting(0);
- if ($strPasswd == '') {
+ if ($strPasswd === '') {
$booLogin = ssh2_auth_pubkey_file(
- $this->resConnectId,
+ $this->resSSHConId,
$strUser,
- $strSSHKeyPath. '/id_rsa.pub',
- $strSSHKeyPath. '/id_rsa'
+ $strSSHKeyPath . '/id_rsa.pub',
+ $strSSHKeyPath . '/id_rsa'
);
} else {
$booLogin = ssh2_auth_pubkey_file(
- $this->resConnectId,
+ $this->resSSHConId,
$strUser,
- $strSSHKeyPath. '/id_rsa.pub',
- $strSSHKeyPath. '/id_rsa',
+ $strSSHKeyPath . '/id_rsa.pub',
+ $strSSHKeyPath . '/id_rsa',
$strPasswd
);
}
$arrError = error_get_last();
- error_reporting($intErrorReporting);
} else {
- $intErrorReporting = error_reporting();
+ $intErrorReporting = error_reporting();
error_reporting(0);
- $booLogin = ssh2_auth_password($this->resConnectId, $strUser, $strPasswd);
- $arrError = error_get_last();
+ $booLogin = ssh2_auth_password($this->resSSHConId, $strUser, $strPasswd);
+ $arrError = error_get_last();
$strPasswordNote = 'If you are using ssh2 with user/password - you have to enable ' .
'PasswordAuthentication in your sshd_config';
- error_reporting($intErrorReporting);
}
+ error_reporting($intErrorReporting);
} else {
- $this->myDataClass->writeLog(translate('Connection to remote system failed (SSH2 connection):').
- ' ' .$strServer);
- $this->processClassMessage(translate('Connection to remote system failed (SSH2 connection):').
- ' ' .$strServer. '::', $this->strErrorMessage);
- if ($arrError['message'] != '') {
- $this->processClassMessage($arrError['message']. '::', $this->strErrorMessage);
+ $this->myDataClass->writeLog(translate('Connection to remote system failed (SSH2 connection):') .
+ ' ' . $strServer . ' / ' . translate('port') . ' : ' . $intPort);
+ $this->processClassMessage(translate('Connection to remote system failed (SSH2 connection):') .
+ ' ' . $strServer . ' / ' . translate('port') . ' : ' . $intPort . '::', $this->strErrorMessage);
+ if ((string)$arrError['message'] !== '') {
+ $this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage);
}
$intReturn = 1;
}
- // Check connection
- if ((!$this->resConnectId) || (!$booLogin)) {
- $this->myDataClass->writeLog(translate('Connection to remote system failed (SSH2 connection):').
- ' ' .$strServer);
+ /* Check connection */
+ if ((!$this->resSSHConId) || (!$booLogin)) {
+ $this->myDataClass->writeLog(translate('Connection to remote system failed (SSH2 connection):') .
+ ' ' . $strServer . ' / ' . translate('port') . ' : ' . $intPort);
$this->processClassMessage(translate('Connection to remote system failed (SSH2 connection):')
- . ' ' .$strServer. '::', $this->strErrorMessage);
- if ($arrError['message'] != '') {
- $this->processClassMessage($arrError['message']. '::', $this->strErrorMessage);
+ . ' ' . $strServer . ' / ' . translate('port') . ' : ' . $intPort . '::', $this->strErrorMessage);
+ if ((string)$arrError['message'] !== '') {
+ $this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage);
}
if ($strPasswordNote !== null) {
- $this->processClassMessage($strPasswordNote. '::', $this->strErrorMessage);
+ $this->processClassMessage($strPasswordNote . '::', $this->strErrorMessage);
}
$this->resConnectServer = '';
- $this->resConnectType = 'none';
- $this->resConnectId = null;
+ $this->resConnectType = 'none';
+ $this->resSSHConId = null;
$intReturn = 1;
} else {
- // Etablish an SFTP connection ressource
- $this->resSFTP = ssh2_sftp($this->resConnectId);
+ /* Etablish an SFTP connection ressource */
+ $this->resSFTP = ssh2_sftp($this->resSSHConId);
}
}
return $intReturn;
@@ -462,83 +481,484 @@ class NagConfigClass
/**
* Sends a command via SSH and stores the result in an array
- * @param string $strCommand Command string
- * @param array $arrResult Output as array (by reference)
- * @param int $intLines Maximal length of output to read
- * @return int 0 = successful / 1 = error
+ * @param string $strCommand Command string
+ * @param array|null $arrResult Output as array (by reference)
+ * @param int $intLines Maximal length of output to read
+ * @return int 0 = successful / 1 = error
*/
- public function sendSSHCommand($strCommand, &$arrResult, $intLines = 100)
+ public function sendSSHCommand(string $strCommand, array &$arrResult = null, int $intLines = 100): int
{
- // Define variables
- $intCount1 = 0; // empty lines
- $intCount2 = 0; // data lines
+ /* Define variables */
+ $intCount1 = 0; /* empty lines */
+ $intCount2 = 0; /* data lines */
$booBreak = false;
$this->getConfigTargets($arrConfigSet);
- // Check connection
+ /* Check connection */
$intReturn = $this->getSSHConnection($arrConfigSet[0]);
- if (\is_resource($this->resConnectId)) {
- // Send command
- $resStream = ssh2_exec($this->resConnectId, $strCommand.'; echo __END__');
+ if (is_resource($this->resSSHConId)) {
+ /* Send command */
+ $resStream = ssh2_exec($this->resSSHConId, $strCommand . '; echo __END__');
if ($resStream) {
- // read result
+ /* Read result */
stream_set_blocking($resStream, true);
stream_set_timeout($resStream, 2);
do {
$strLine = stream_get_line($resStream, 1024, "\n");
- if ($strLine == '') {
+ if ($strLine === '') {
$intCount1++;
- } elseif (substr_count($strLine, '__END__') != 1) {
+ } elseif (substr_count($strLine, '__END__') !== 1) {
$arrResult[] = $strLine;
- $intReturn = 0;
- } elseif (substr_count($strLine, '__END__') == 1) {
+ $intReturn = 0;
+ } elseif (substr_count($strLine, '__END__') === 1) {
$booBreak = true;
}
$intCount2++;
$arrStatus = stream_get_meta_data($resStream);
} while ($resStream && !feof($resStream) && ($intCount1 <= 10) && ($intCount2 <= $intLines) &&
- ($arrStatus['timed_out'] != true) && $booBreak == false);
+ ((bool)$arrStatus['timed_out'] !== true) && $booBreak === false);
fclose($resStream);
- // Close SSH connection because of timing problems
- unset($this->resConnectId);
- //sleep(1);
+ /* Close SSH connection because of timing problems */
+ unset($this->resSSHConId);
}
}
return $intReturn;
}
/**
- * Merge message strings and check for duplicate messages
- * @param string $strNewMessage New message to add
- * @param string $strOldMessage Modified message string (by reference)
+ * Remove a file
+ * @param string $strFileName Filename including path to remove
+ * @param int $intConfigID Configuration target ID
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
*/
- public function processClassMessage($strNewMessage, &$strOldMessage)
+ public function removeFile(string $strFileName, int $intConfigID): int
{
- $strNewMessage = str_replace('::::', '::', $strNewMessage);
- if (($strOldMessage != '') && ($strNewMessage != '') && (substr_count($strOldMessage, $strNewMessage) == 0)) {
- $strOldMessage .= $strNewMessage;
- } elseif ($strOldMessage == '') {
- $strOldMessage .= $strNewMessage;
+ /* Variable definitions */
+ $intMethod = 1;
+ $intReturn = 0;
+ $booRetVal = false;
+ $strMethod = '';
+ /* Get connection method */
+ if ($this->getConfigData($intConfigID, 'method', $strMethod) === 0) {
+ $intMethod = (int)$strMethod;
+ }
+ /* Local file system */
+ if ($intMethod === 1) {
+ /* Save configuration file */
+ if (file_exists($strFileName)) {
+ if (is_writable($strFileName)) {
+ unlink($strFileName);
+ } else {
+ $this->processClassMessage(translate('Cannot delete the file (wrong permissions)!') . '::' .
+ $strFileName . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ } else {
+ $this->processClassMessage(translate('Cannot delete the file (file does not exist)!') . '::' .
+ $strFileName . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ } elseif ($intMethod === 2) { /* Remote file (FTP) */
+ /* Check connection */
+ $intReturn = $this->getFTPConnection($intConfigID);
+ if ($intReturn === 0) {
+ /* Save configuration file */
+ $intFileStamp = ftp_mdtm($this->conFTPConId, $strFileName);
+ if ($intFileStamp > -1) {
+ $intErrorReporting = error_reporting();
+ error_reporting(0);
+ $booRetVal = ftp_delete($this->conFTPConId, $strFileName);
+ error_reporting($intErrorReporting);
+ } else {
+ $this->processClassMessage(translate('Cannot delete file because it does not exists (remote '
+ . 'FTP)!') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ }
+ if ($booRetVal === false) {
+ $this->processClassMessage(translate('Cannot delete file because the permissions are incorrect '
+ . '(remote FTP)!') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ } elseif ($intMethod === 3) { /* Remote file (SFTP) */
+ /* Check connection */
+ $intReturn = $this->getSSHConnection($intConfigID);
+ /* Save configuration file */
+ if (($intReturn === 0) && ($this->sendSSHCommand('ls ' . $strFileName, $arrResult) === 0)) {
+ if (isset($arrResult[0])) {
+ $booRetVal = ssh2_sftp_unlink($this->resSFTP, $strFileName);
+ } else {
+ $this->processClassMessage(translate('Cannot delete file because it does not exists (remote '
+ . 'SSH/SFTP)!') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ }
+ if (($intReturn === 0) && ($booRetVal === false)) {
+ $this->processClassMessage(translate('Cannot delete file because the permissions are incorrect '
+ . '(remote SSH/SFTP)!') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Get configuration domain parameters
+ * @param int $intConfigId Configuration ID
+ * @param string $strConfigItem Configuration key
+ * @param string $strValue Configuration value (by reference)
+ * @return int 0 = successful / 1 = error
+ */
+ public function getConfigData(int $intConfigId, string $strConfigItem, string &$strValue): int
+ {
+ $intReturn = 1;
+ $strSQL = 'SELECT `' . $strConfigItem . '` FROM `tbl_configtarget` WHERE `id` = ' . $intConfigId;
+ $strValue = $this->myDBClass->getFieldData($strSQL);
+ if ($strValue !== '') {
+ $intReturn = 0;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Check a directory for write access
+ * @param string $strPath Physical path
+ * @return int 0 = successful / 1 = error
+ */
+ public function isDirWriteable(string $strPath): int
+ {
+ /* Define variables */
+ $intReturnFile = 1;
+ $intReturnDir = 1;
+ $intReturn = 1;
+ /* Is input path a file? */
+ if (file_exists($strPath) && is_file($strPath)) {
+ $resFile = fopen($strPath, 'ab');
+ if ($resFile) {
+ $intReturnFile = 0;
+ }
+ } else {
+ $intReturnFile = 0;
+ }
+ if (is_file($strPath)) {
+ $strDirectory = dirname($strPath);
+ } else {
+ $strDirectory = $strPath;
+ }
+ $strFile = $strDirectory . '/' . uniqid(mt_rand(), true) . '.tmp';
+ /* Check writing in directory directly */
+ if (is_dir($strDirectory) && is_writable($strDirectory)) {
+ $resFile = fopen($strFile, 'wb');
+ if ($resFile) {
+ $intReturnDir = 0;
+ unlink($strFile);
+ }
+ } else {
+ $intReturnDir = 0;
+ }
+ if (($intReturnDir === 0) && ($intReturnFile === 0)) {
+ $intReturn = 0;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Copy a remote file
+ * @param string $strFileRemote Remote file name
+ * @param int $intConfigID Configuration target id
+ * @param string $strFileLocal Local file name
+ * @param int $intDirection 0 = from remote to local / 1 = from local to remote
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ public function remoteFileCopy(string $strFileRemote, int $intConfigID, string $strFileLocal, int $intDirection = 0): int
+ {
+ /* Variable definitions */
+ $intMethod = 3;
+ $intReturn = 0;
+ $strMethod = '';
+ $arrTemp = array();
+ /* Get method */
+ if ($this->getConfigData($intConfigID, 'method', $strMethod) === 0) {
+ $intMethod = (int)$strMethod;
+ }
+ if ($intMethod === 2) {
+ /* Check connection */
+ $intReturn = $this->getFTPConnection($intConfigID);
+ if (($intReturn === 0) && ($intDirection === 0)) {
+ $intErrorReporting = error_reporting();
+ error_reporting(0);
+ if (!ftp_get($this->conFTPConId, $strFileLocal, $strFileRemote, FTP_ASCII)) {
+ $this->processClassMessage(translate('Cannot get the remote file (it does not exist or is not '
+ . 'readable) - remote file: ') . $strFileRemote . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ error_reporting($intErrorReporting);
+ } elseif (($intReturn === 0) && ($intDirection === 1)) {
+ $intErrorReporting = error_reporting();
+ error_reporting(0);
+ if (!ftp_put($this->conFTPConId, $strFileRemote, $strFileLocal, FTP_ASCII)) {
+ $this->processClassMessage(translate('Cannot write the remote file (remote file is not writeable)'
+ . '- remote file: ') . $strFileRemote . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ error_reporting($intErrorReporting);
+ }
+ ftp_close($this->conFTPConId);
+ } elseif ($intMethod === 3) { /* Remote file (SFTP) */
+ $intReturn = $this->getSSHConnection($intConfigID);
+ if (($intReturn === 0) && ($intDirection === 0)) {
+ /* Copy file */
+ $intErrorReporting = error_reporting();
+ error_reporting(0);
+ if (!ssh2_scp_recv($this->resSSHConId, $strFileRemote, $strFileLocal)) {
+ if ($this->sendSSHCommand('ls ' . $strFileRemote, $arrTemp) !== 0) {
+ $this->processClassMessage(translate('Cannot get the remote file (it does not exist or is not '
+ . 'readable) - remote file: ') . $strFileRemote . '::', $this->strErrorMessage);
+ } else {
+ $this->processClassMessage(translate('Remote file is not readable - remote file: ')
+ . $strFileRemote . '::', $this->strErrorMessage);
+ }
+ $intReturn = 1;
+ }
+ error_reporting($intErrorReporting);
+ } elseif (($intReturn === 0) && ($intDirection === 1)) {
+ if (file_exists($strFileLocal) && is_readable($strFileLocal)) {
+ $intErrorReporting = error_reporting();
+ error_reporting(0);
+ if (!ssh2_scp_send($this->resSSHConId, $strFileLocal, $strFileRemote, 0644)) {
+ $this->processClassMessage(translate('Cannot write a remote file (remote file is not writeable)'
+ . ' - remote file: ') . $strFileRemote . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ error_reporting($intErrorReporting);
+ } else {
+ $this->processClassMessage(translate('Cannot copy a local file to remote because the local file ' .
+ 'does not exist or is not readable - local file: ') .
+ $strFileLocal . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ }
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Add files of a given directory to an array
+ * @param string $strSourceDir Source directory
+ * @param string $strIncPattern Include file pattern
+ * @param string $strExcPattern Exclude file pattern
+ * @param array|null $arrOutput Output array (by reference)
+ * @param string|null $strErrorMessage Error messages (by reference)
+ */
+ public function storeDirToArray(string $strSourceDir, string $strIncPattern, string $strExcPattern, array &$arrOutput = null, string &$strErrorMessage = null): void
+ {
+ /* Define variables */
+ $arrDir = array();
+ while (substr($strSourceDir, -1) === '/' or substr($strSourceDir, -1) === "\\") {
+ $strSourceDir = substr($strSourceDir, 0, -1);
+ }
+ $resHandle = opendir($strSourceDir);
+ if ($resHandle === false) {
+ if ($this->intDomainId !== 0) {
+ $strErrorMessage .= translate('Could not open directory') . ': ' . $strSourceDir;
+ }
+ } else {
+ $booBreak = true;
+ while ($booBreak) {
+ if (!$arrDir[] = readdir($resHandle)) {
+ $booBreak = false;
+ }
+ }
+ closedir($resHandle);
+ sort($arrDir);
+ /** @var string $file */
+ foreach ($arrDir as $file) {
+ /** @noinspection StrlenInEmptyStringCheckContextInspection */
+ if (!preg_match("/^\.{1,2}/", $file) && strlen($file)) {
+ if (is_dir($strSourceDir . '/' . $file)) {
+ $this->storeDirToArray(
+ $strSourceDir . '/' . $file,
+ $strIncPattern,
+ $strExcPattern,
+ $arrOutput,
+ $strErrorMessage
+ );
+ } else if (preg_match('/' . $strIncPattern . '/', $file) && (($strExcPattern === '') ||
+ !preg_match('/' . $strExcPattern . '/', $file))) {
+ if (0 === stripos(PHP_OS_FAMILY, 'Windows')) {
+ $strSourceDir = str_replace('/', "\\", $strSourceDir);
+ $arrOutput [] = $strSourceDir . "\\" . $file;
+ } else {
+ $arrOutput [] = $strSourceDir . '/' . $file;
+ }
+ }
+ }
+ }
}
}
/**
- * Get configuration target IDs
- * @param array $arrConfigId Configuration target IDs (by reference)
- * @return int 0 = successful / 1 = error
+ * Determines the dates of the last data table change and the last modification to the configuration files
+ * @param string $strTableName Name of the data table
+ * @param array|null $arrTimeData Array with time data of table and all config files
+ * @param string|null $strCheckConfig Information string (text message)
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
*/
- public function getConfigSets(&$arrConfigId)
+ public function lastModifiedFile(string $strTableName, array &$arrTimeData = null, string &$strCheckConfig = null): int
{
- // Variable definition
- $arrData = array();
- $arrConfigId = array();
+ /* Variable definitions */
+ /** @noinspection PhpUnusedLocalVariableInspection */
+ $intEnableCommon = 0;
+ $arrDataset = array();
+ $strFileName = '';
+ $strCheckConfig = '';
+ $intReturn = 0;
+ // Get configuration filename based on table name
+ $arrConfigData = $this->getConfData();
+ if (isset($arrConfigData[$strTableName])) {
+ $strFileName = $arrConfigData[$strTableName]['filename'];
+ } else {
+ $intReturn = 1;
+ }
+ /* Get table times */
+ $arrTimeData = array();
+ $arrTimeData['table'] = 'unknown';
+ $strConfigValue = '';
+ /* Clear status cache */
+ clearstatcache();
+ if ($this->getDomainData('enable_common', $strConfigValue) === 0) {
+ $intEnableCommon = (int)$strConfigValue;
+ $strSQLAdd = '';
+ if ($intEnableCommon === 1) {
+ $strSQLAdd = 'OR `domainId`=0';
+ }
+ $strSQL = 'SELECT `updateTime` FROM `tbl_tablestatus` '
+ . 'WHERE (`domainId`=' . $this->intDomainId . " $strSQLAdd) AND `tableName`='" . $strTableName . "' "
+ . 'ORDER BY `updateTime` DESC LIMIT 1';
+ $booReturn = $this->myDBClass->hasSingleDataset($strSQL, $arrDataset);
+ if ($booReturn && isset($arrDataset['updateTime'])) {
+ $arrTimeData['table'] = $arrDataset['updateTime'];
+ } else {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `last_modified` FROM `' . $strTableName . '` '
+ . 'WHERE `config_id`=' . $this->intDomainId . ' ORDER BY `last_modified` DESC LIMIT 1';
+ $booReturn = $this->myDBClass->hasSingleDataset($strSQL, $arrDataset);
+ if (($booReturn === true) && isset($arrDataset['last_modified'])) {
+ $arrTimeData['table'] = $arrDataset['last_modified'];
+ }
+ }
+ }
+ /* Get config sets */
+ $arrConfigId = array();
+ $strTarget = '';
+ $strBaseDir = '';
+ $intFileStampTemp = 0;
+ $intRetVal2 = $this->getConfigSets($arrConfigId);
+ if ($intRetVal2 === 0) {
+ foreach ($arrConfigId as $intConfigId) {
+ /* Get configuration file data */
+ $this->getConfigData($intConfigId, 'target', $strTarget);
+ $this->getConfigData($intConfigId, 'basedir', $strBaseDir);
+ /* Get time data */
+ $intReturn = $this->getFileDate(
+ $intConfigId,
+ $strFileName,
+ $strBaseDir,
+ $intFileStampTemp,
+ $arrTimeData[$strTarget]
+ );
+ if ($intFileStampTemp !== 0 && strtotime($arrTimeData['table']) > $intFileStampTemp) {
+ $strCheckConfig = translate('Warning: configuration file is out of date!');
+ }
+ if ((string)$arrTimeData[$strTarget] === 'unknown') {
+ $strCheckConfig = translate('Warning: configuration file is out of date!');
+ }
+ }
+ } else {
+ $strCheckConfig = translate('Warning: no configuration target defined!');
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Determines the configuration data for each database table
+ * @return array filename (configuration file name)
+ * order_field (database order field)
+ */
+ public function getConfData(): array
+ {
+ $arrConfData['tbl_timeperiod'] = array('filename' => 'timeperiods.cfg',
+ 'order_field' => 'timeperiod_name');
+ $arrConfData['tbl_command'] = array('filename' => 'commands.cfg',
+ 'order_field' => 'command_name');
+ $arrConfData['tbl_contact'] = array('filename' => 'contacts.cfg',
+ 'order_field' => 'contact_name');
+ $arrConfData['tbl_contacttemplate'] = array('filename' => 'contacttemplates.cfg',
+ 'order_field' => 'template_name');
+ $arrConfData['tbl_contactgroup'] = array('filename' => 'contactgroups.cfg',
+ 'order_field' => 'contactgroup_name');
+ $arrConfData['tbl_hosttemplate'] = array('filename' => 'hosttemplates.cfg',
+ 'order_field' => 'template_name');
+ $arrConfData['tbl_servicetemplate'] = array('filename' => 'servicetemplates.cfg',
+ 'order_field' => 'template_name');
+ $arrConfData['tbl_hostgroup'] = array('filename' => 'hostgroups.cfg',
+ 'order_field' => 'hostgroup_name');
+ $arrConfData['tbl_servicegroup'] = array('filename' => 'servicegroups.cfg',
+ 'order_field' => 'servicegroup_name');
+ $arrConfData['tbl_hostdependency'] = array('filename' => 'hostdependencies.cfg',
+ 'order_field' => 'dependent_host_name');
+ $arrConfData['tbl_servicedependency'] = array('filename' => 'servicedependencies.cfg',
+ 'order_field' => 'config_name');
+ $arrConfData['tbl_hostescalation'] = array('filename' => 'hostescalations.cfg',
+ 'order_field' => 'host_name`,`hostgroup_name');
+ $arrConfData['tbl_serviceescalation'] = array('filename' => 'serviceescalations.cfg',
+ 'order_field' => 'config_name');
+ $arrConfData['tbl_hostextinfo'] = array('filename' => 'hostextinfo.cfg',
+ 'order_field' => 'host_name');
+ $arrConfData['tbl_serviceextinfo'] = array('filename' => 'serviceextinfo.cfg',
+ 'order_field' => 'host_name');
+ return $arrConfData;
+ }
+
+ /**
+ * Get domain configuration parameters.
+ * @param string $strConfigItem Configuration key
+ * @param string|null $strValue Configuration value (by reference)
+ * @return int 0 = successful / 1 = error
+ */
+ public function getDomainData(string $strConfigItem, string &$strValue = null): int
+ {
+ /* Variable definition */
+ $intReturn = 0;
+ /* Request domain data from database */
+ $strSQL = 'SELECT `' . $strConfigItem . '` FROM `tbl_datadomain` WHERE `id` = ' . $this->intDomainId;
+ $strValue = $this->myDBClass->getFieldData($strSQL);
+ if ($strValue === '') {
+ $intReturn = 1;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Get configuration target IDs
+ * @param array|null $arrConfigId Configuration target IDs (by reference)
+ * @return int 0 = successful / 1 = error
+ */
+ public function getConfigSets(array &$arrConfigId = null): int
+ {
+ /* Variable definition */
+ $arrData = array();
+ $arrConfigId = array();
$intDataCount = 0;
- $intReturn = 1;
- // Request target ID
- $strSQL = 'SELECT `targets` FROM `tbl_datadomain` WHERE `id`=' .$this->intDomainId;
+ $intReturn = 1;
+ /* Request target ID */
+ $strSQL = 'SELECT `targets` FROM `tbl_datadomain` WHERE `id`=' . $this->intDomainId;
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn && ($intDataCount != 0)) {
+ if ($booReturn && ($intDataCount !== 0)) {
foreach ($arrData as $elem) {
- $arrConfigId[] = $elem['targets'];
+ $arrConfigId[] = (int)$elem['targets'];
}
$intReturn = 0;
}
@@ -546,20 +966,1287 @@ class NagConfigClass
}
/**
- * Moves an existing configuration file to the backup directory and removes then the original file
- * @param string $strType Type of the configuration file
- * @param string $strName Name of the configuration file
- * @param int $intConfigID Configuration target ID
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
+ * Writes a configuration file including all datasets of a configuration table or returns the output as a text
+ * file for download. (Public master function)
+ * @param string $strTableName Table name
+ * @param int $intMode 0 = Write file to filesystem
+ * 1 = Return Textfile for download test
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
*/
- public function moveFile($strType, $strName, $intConfigID)
+ public function createConfig(string $strTableName, int $intMode = 0): int
{
- // Variable definitions
+ /* Define variables */
+ $intReturn = 0;
+ /* Do not create configs in common domain */
+ if ($this->intDomainId === 0) {
+ $this->processClassMessage(translate('It is not possible to write config files directly from the common '
+ . 'domain!') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ if ($intReturn === 0) {
+ /* Get configuration targets */
+ $this->getConfigSets($arrConfigID);
+ if (is_array($arrConfigID)) {
+ foreach ($arrConfigID as $intConfigID) {
+ $intReturn = $this->writeConfTemplate($intConfigID, $strTableName, $intMode);
+ }
+ } else {
+ $this->processClassMessage(translate('Warning: no configuration target defined!') .
+ '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Writes a configuration file including all datasets of a configuration table or returns the output as a text
+ * file for download. (Private worker function)
+ * @param int $intConfigID Configuration target ID
+ * @param string $strTableName Table name
+ * @param int $intMode 0 = Write file to filesystem
+ * 1 = Return Textfile for download test
+ * @param array $arrTableData Dataset array for host and services only
+ * @param int $intID Key for dataset array
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ private function writeConfTemplate(int $intConfigID, string $strTableName, int $intMode, array $arrTableData = array(), int $intID = 0): int
+ {
+ /* Variable definitions */
+ $strSQL = '';
+ $strOrderField = '';
+ $strFileString = '';
+ $arrTplOptions = array('use_preg' => false);
+ $strDomainWhere = ' (`config_id`=' . $this->intDomainId . ') ';
+ $intType = 0;
+ $intReturn = 0;
+ $setUTF8Decode = 0;
+ $intNagiosVersion = 0;
+ $setEnableCommon = 0;
+ $strConfigValue = '';
+ /* Read some settings and information */
+ if ($this->getDomainData('utf8_decode', $strConfigValue) === 0) {
+ $setUTF8Decode = (int)$strConfigValue;
+ }
+ if ($this->getConfigData($intConfigID, 'version', $strConfigValue) === 0) {
+ $intNagiosVersion = (int)$strConfigValue;
+ }
+ if ($this->getDomainData('enable_common', $strConfigValue) === 0) {
+ $setEnableCommon = (int)$strConfigValue;
+ }
+ $arrConfigData = $this->getConfData();
+ if (isset($arrConfigData[$strTableName])) {
+ $strFileString = str_replace('.cfg', '', $arrConfigData[$strTableName]['filename']);
+ $strOrderField = $arrConfigData[$strTableName]['order_field'];
+ }
+ /* Variable rewritting */
+ if ($setEnableCommon !== 0) {
+ $strDomainWhere = str_replace(')', ' OR `config_id`=0)', $strDomainWhere);
+ }
+ /* Special processing for table host and service */
+ $setTemplate = $strFileString . '.tpl.dat';
+ if (($strTableName === 'tbl_host') || ($strTableName === 'tbl_service')) {
+ // Define variable names based on table name
+ switch ($strTableName) {
+ case 'tbl_host':
+ $strFileString = $arrTableData[$intID]['host_name'];
+ $intDomainId = $arrTableData[$intID]['config_id'];
+ $setTemplate = 'hosts.tpl.dat';
+ $intType = 1;
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTableName . "` WHERE `host_name`='$strFileString' "
+ . "AND `active`='1' AND `config_id`=$intDomainId";
+ break;
+ case 'tbl_service':
+ $strFileString = $arrTableData[$intID]['config_name'];
+ $intDomainId = $arrTableData[$intID]['config_id'];
+ $setTemplate = 'services.tpl.dat';
+ $intType = 2;
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTableName . "` WHERE `config_name`='$strFileString' "
+ . "AND `active`='1' AND `config_id`=$intDomainId ORDER BY `service_description`";
+ break;
+ }
+ } else {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTableName . "` WHERE $strDomainWhere AND `active`='1' " .
+ 'ORDER BY `' . $strOrderField . '`';
+ }
+ $strFile = $strFileString . '.cfg';
+ /* Load configuration template file */
+ $tplConf = new HTML_Template_IT($this->arrSettings['path']['base_path'] . '/templates/files/');
+ $tplConf->loadTemplatefile($setTemplate);
+ $tplConf->setOptions($arrTplOptions);
+ $tplConf->setVariable('CREATE_DATE', date('Y-m-d H:i:s'));
+ $tplConf->setVariable('NAGIOS_QL_VERSION', $this->arrSettings['db']['version']);
+ $tplConf->setVariable('VERSION', $this->getVersionString($intConfigID));
+ /* Write data from configuration table */
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
+ if ($booReturn && ($intDataCount !== 0) && ($strFileString !== '')) {
+ /* Process every data set */
+ for ($i = 0; $i < $intDataCount; $i++) {
+ $intDataId = 0;
+ foreach ($arrData[$i] as $key => $value) {
+ if ((string)$key === 'id') {
+ $intDataId = $value;
+ }
+ if ((string)$key === 'config_name') {
+ $key = '#NAGIOSQL_CONFIG_NAME';
+ }
+ /* UTF8 decoded vaules */
+ if ($setUTF8Decode === 1) {
+ $value = mb_convert_encoding($value, 'UTF-8');
+ }
+ /* Pass special fields (NagiosQL data fields not used by Nagios itselves) */
+ if ($value === null) {
+ $value = '';
+ }
+ if ($this->skipEntries($strTableName, $intNagiosVersion, $key, $value) === 1) {
+ continue;
+ }
+ /* Get relation data */
+ $intSkip = $this->getRelationData($strTableName, $tplConf, $arrData[$i], $key, $value);
+ /* Rename field names */
+ $this->renameFields($strTableName, $intConfigID, $intDataId, $key, $value, $intSkip);
+ /* Inset data field */
+ if ($intSkip !== 1) {
+ /* Insert fill spaces */
+ $strFillLen = (30 - strlen($key));
+ $strSpace = ' ';
+ $strSpace .= str_repeat(' ', $strFillLen);
+ /* Write key and value to template */
+ $tplConf->setVariable('ITEM_TITLE', $key . $strSpace);
+ /* Short values */
+ if (($intNagiosVersion !== 3) || (strlen($value) < 800)) {
+ $tplConf->setVariable('ITEM_VALUE', $value);
+ $tplConf->parse('configline');
+ } else { /* Long values */
+ $arrValueTemp = explode(',', $value);
+ $strValueNew = '';
+ $intArrCount = count($arrValueTemp);
+ $intCounter = 0;
+ $strSpace = ' ';
+ $strSpace .= str_repeat(' ', 30);
+ foreach ($arrValueTemp as $elem) {
+ if (strlen($strValueNew) < 800) {
+ $strValueNew .= $elem . ',';
+ } else {
+ if (substr($strValueNew, -1) === ',') {
+ $strValueNew = substr($strValueNew, 0, -1);
+ }
+ if ($intCounter < $intArrCount) {
+ $strValueNew .= ",\\";
+ }
+ $tplConf->setVariable('ITEM_VALUE', $strValueNew);
+ $tplConf->parse('configline');
+ $tplConf->setVariable('ITEM_TITLE', $strSpace);
+ $strValueNew = $elem . ',';
+ }
+ $intCounter++;
+ }
+ if ($strValueNew !== '') {
+ if (substr($strValueNew, -1) === ',') {
+ $strValueNew = substr($strValueNew, 0, -1);
+ }
+ $tplConf->setVariable('ITEM_VALUE', $strValueNew);
+ $tplConf->parse('configline');
+ }
+ }
+ }
+ }
+ /* Special processing for time periods */
+ if ($strTableName === 'tbl_timeperiod') {
+ $arrDataTime = array();
+ $strSQLTime = 'SELECT `definition`, `range` '
+ . 'FROM `tbl_timedefinition` WHERE `tipId` = ' . $arrData[$i]['id'];
+ $booReturn = $this->myDBClass->hasDataArray($strSQLTime, $arrDataTime, $intDataCountTime);
+ if ($booReturn && $intDataCountTime !== 0) {
+ foreach ($arrDataTime as $data) {
+ /* Skip other values than weekdays in nagios version below 3 */
+ if ($intNagiosVersion < 3) {
+ $arrWeekdays = array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday',
+ 'sunday');
+ if (!in_array($data['definition'], $arrWeekdays, true)) {
+ continue;
+ }
+ }
+ /* Insert fill spaces */
+ $strFillLen = (30 - strlen($data['definition']));
+ $strSpace = ' ';
+ $strSpace .= str_repeat(' ', $strFillLen);
+ /* Write key and value */
+ $tplConf->setVariable('ITEM_TITLE', $data['definition'] . $strSpace);
+ $tplConf->setVariable('ITEM_VALUE', $data['range']);
+ /** @noinspection DisconnectedForeachInstructionInspection */
+ $tplConf->parse('configline');
+ }
+ }
+ }
+ /* Write configuration set */
+ $tplConf->parse('configset');
+ }
+ } elseif ($booReturn && ($intDataCount === 0) && ($strFileString !== '')) {
+ $this->processClassMessage(translate('Error while selecting data from database:')
+ . '::', $this->strErrorMessage);
+ $this->processClassMessage($this->myDBClass->strErrorMessage, $this->strErrorMessage);
+ $intReturn = 1;
+ } else {
+ $this->myDataClass->writeLog(translate('Writing of the configuration failed - no dataset '
+ . 'or not activated dataset found'));
+ $this->processClassMessage(translate('Writing of the configuration failed - no dataset '
+ . 'or not activated dataset found') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ if ($intMode === 0) {
+ $strCfgFile = '';
+ $intReturn = $this->getConfigFile($strFile, $intConfigID, $intType, $resCfgFile, $strCfgFile);
+ if ($intReturn === 0) {
+ $tplConf->parse();
+ $strContent = $tplConf->get();
+ $intReturn = $this->writeConfigFile(
+ $strContent,
+ $strFile,
+ $intType,
+ $intConfigID,
+ $resCfgFile,
+ $strCfgFile
+ );
+ }
+ } elseif ($intMode === 1) {
+ $tplConf->show();
+ }
+ return $intReturn;
+ }
+
+ /* PRIVATE functions */
+
+ /**
+ * Get Nagios version string
+ * @param int $intConfigID Configuration target ID
+ * @return string Version string
+ */
+ private function getVersionString(int $intConfigID): string
+ {
+ $strConfigValue = '';
+ $intVersion = 0;
+ $arrVersion = array(
+ 'Nagios 2.x config file',
+ 'Nagios 2.9 config file',
+ 'Nagios 3.x config file',
+ 'Nagios 4.x config file'
+ );
+ if ($this->getConfigData($intConfigID, 'version', $strConfigValue) === 0) {
+ $intVersion = (int)$strConfigValue;
+ }
+ if (($intVersion >= 1) && ($intVersion <= count($arrVersion))) {
+ $strVersion = $arrVersion[$intVersion - 1];
+ } else {
+ $strVersion = '';
+ }
+ return $strVersion;
+ }
+
+ /**
+ * Skip database values based on Nagios version
+ * @param string $strTableName Table name
+ * @param int $intVersionValue Nagios version value
+ * @param string $key Data key
+ * @param string $value Data value
+ * @return int 1 = Skip entry / 0 = Pass entry
+ */
+ private function skipEntries(string $strTableName, int $intVersionValue, string $key, string &$value): int
+ {
+ /* Define variables */
+ $arrOption = array();
+ $intReturn = 0;
+ /* Skip common fields */
+ $strSpecial = 'id,active,last_modified,access_rights,access_group,config_id,template,nodelete,command_type,';
+ $strSpecial .= 'import_hash';
+
+ /* Skip fields of special tables */
+ if ($strTableName === 'tbl_hosttemplate') {
+ $strSpecial .= ',parents_tploptions,hostgroups_tploptions,contacts_tploptions';
+ $strSpecial .= ',contact_groups_tploptions,use_template_tploptions';
+ }
+ if ($strTableName === 'tbl_servicetemplate') {
+ $strSpecial .= ',host_name_tploptions,hostgroup_name_tploptions,parents_tploptions,contacts_tploptions';
+ $strSpecial .= ',servicegroups_tploptions,contact_groups_tploptions,use_template_tploptions';
+ }
+ if ($strTableName === 'tbl_contact') {
+ $strSpecial .= ',use_template_tploptions,contactgroups_tploptions';
+ $strSpecial .= ',host_notification_commands_tploptions,service_notification_commands_tploptions';
+ }
+ if ($strTableName === 'tbl_contacttemplate') {
+ $strSpecial .= ',use_template_tploptions,contactgroups_tploptions';
+ $strSpecial .= ',host_notification_commands_tploptions,service_notification_commands_tploptions';
+ }
+ if ($strTableName === 'tbl_host') {
+ $strSpecial .= ',parents_tploptions,hostgroups_tploptions,contacts_tploptions';
+ $strSpecial .= ',contact_groups_tploptions,use_template_tploptions';
+ }
+ if ($strTableName === 'tbl_service') {
+ $strSpecial .= ',host_name_tploptions,hostgroup_name_tploptions,parents_tploptions';
+ $strSpecial .= ',servicegroups_tploptions,contacts_tploptions,contact_groups_tploptions';
+ $strSpecial .= ',use_template_tploptions';
+ }
+ if ($strTableName === 'tbl_command') {
+ $strSpecial .= ',arg1_info,arg2_info,arg3_info,arg4_info,arg5_info,arg6_info,arg7_info,arg8_info';
+ }
+
+ /* Pass fields based on nagios version lower than 3.x */
+ if ($intVersionValue < 3) {
+ if ($strTableName === 'tbl_timeperiod') {
+ $strSpecial .= ',use_template,exclude,name';
+ }
+ if (($strTableName === 'tbl_contact') || ($strTableName === 'tbl_contacttemplate')) {
+ $strSpecial .= ',host_notifications_enabled,service_notifications_enabled,can_submit_commands';
+ $strSpecial .= ',retain_status_information,retain_nonstatus_information';
+ $arrOption['host_notification_options'] = ',s';
+ $arrOption['service_notification_options'] = ',s';
+ }
+ if ($strTableName === 'tbl_contactgroup') {
+ $strSpecial .= ',contactgroup_members';
+ }
+ if ($strTableName === 'tbl_hostgroup') {
+ $strSpecial .= ',hostgroup_members,notes,notes_url,action_url';
+ }
+ if ($strTableName === 'tbl_servicegroup') {
+ $strSpecial .= ',servicegroup_members,notes,notes_url,action_url';
+ }
+ if ($strTableName === 'tbl_hostdependency') {
+ $strSpecial .= ',dependent_hostgroup_name,hostgroup_name,dependency_period';
+ }
+ if ($strTableName === 'tbl_hostescalation') {
+ $strSpecial .= ',contacts';
+ }
+ if ($strTableName === 'tbl_servicedependency') {
+ $strSpecial .= ',dependent_hostgroup_name,hostgroup_name,dependency_period,dependent_servicegroup_name';
+ $strSpecial .= ',servicegroup_name';
+ }
+ if ($strTableName === 'tbl_serviceescalation') {
+ $strSpecial .= ',hostgroup_name,contacts,servicegroup_name';
+ }
+ if (($strTableName === 'tbl_host') || ($strTableName === 'tbl_hosttemplate')) {
+ $strSpecial .= ',initial_state,flap_detection_options,contacts,notes,notes_url,action_url';
+ $strSpecial .= ',icon_image,icon_image_alt,vrml_image,statusmap_image,2d_coords,3d_coords';
+ $arrOption['notification_options'] = ',s';
+ }
+ /* Services */
+ if (($strTableName === 'tbl_service') || ($strTableName === 'tbl_servicetemplate')) {
+ $strSpecial .= ',initial_state,flap_detection_options,contacts,notes,notes_url,action_url';
+ $strSpecial .= ',icon_image,icon_image_alt';
+ $arrOption['notification_options'] = ',s';
+ }
+ }
+ /* Pass fields based on nagios version higher than 2.x */
+ if ($intVersionValue > 2) {
+ if ($strTableName === 'tbl_servicetemplate') {
+ $strSpecial .= ',parallelize_check ';
+ }
+ if ($strTableName === 'tbl_service') {
+ $strSpecial .= ',parallelize_check';
+ }
+ }
+ /* Pass fields based on nagios version lower than 4.x */
+ if ($intVersionValue < 4) {
+ if (($strTableName === 'tbl_contact') || ($strTableName === 'tbl_contacttemplate')) {
+ $strSpecial .= ',minimum_importance';
+ }
+ if (($strTableName === 'tbl_host') || ($strTableName === 'tbl_hosttemplate')) {
+ $strSpecial .= ',importance';
+ }
+ if (($strTableName === 'tbl_service') || ($strTableName === 'tbl_servicetemplate')) {
+ $strSpecial .= ',importance,parents';
+ }
+ }
+ if ($intVersionValue === 1) {
+ $strSpecial .= '';
+ }
+ /* Reduce option values */
+ if (array_key_exists($key, $arrOption) && (count($arrOption) !== 0)) {
+ $value = str_replace(array($arrOption[$key], str_replace(',', '', $arrOption[$key])), '', $value);
+ if ($value === '') {
+ $intReturn = 1;
+ }
+ }
+ if ($intReturn === 0) {
+ /* Skip entries */
+ $arrSpecial = explode(',', $strSpecial);
+ if (((string)$value === '') || in_array($key, $arrSpecial, true)) {
+ $intReturn = 1;
+ }
+ }
+ if ($intReturn === 0) {
+ /* Do not write config data (based on 'skip' option) */
+ $strNoTwo = 'active_checks_enabled,passive_checks_enabled,obsess_over_host,check_freshness,';
+ $strNoTwo .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,';
+ $strNoTwo .= 'retain_nonstatus_information,notifications_enabled,parallelize_check,is_volatile,';
+ $strNoTwo .= 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
+ $strNoTwo .= 'obsess_over_service';
+ foreach (explode(',', $strNoTwo) as $elem) {
+ if (($key === $elem) && ((string)$value === '2')) {
+ $intReturn = 1;
+ }
+ if (($intVersionValue < 3) && ($key === $elem) && ((string)$value === '3')) {
+ $intReturn = 1;
+ }
+ }
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Get related data
+ * @param string $strTableName Table name
+ * @param HTML_Template_IT $resTemplate Template ressource
+ * @param array $arrData Dataset array
+ * @param string $strDataKey Data key
+ * @param string|null $strDataValue Data value
+ * @return int 0 = use data / 1 = skip data
+ * Status message is stored in message class variables
+ */
+ private function getRelationData(string $strTableName, HTML_Template_IT $resTemplate, array $arrData, string $strDataKey, string &$strDataValue = null): int
+ {
+ /* Define variables */
+ $intReturn = 0;
+ $intSkipProc = 0;
+ $arrRelations = array();
+ /* Pass function for tbl_command */
+ if ($strTableName === 'tbl_command') {
+ $intSkipProc = 1;
+ }
+ /* Get relation info and store the value in a class variable (speedup export) */
+ if (($intSkipProc === 0) && ($this->strRelTable !== $strTableName)) {
+ $intReturn = $this->myDataClass->tableRelations($strTableName, $arrRelations);
+ $this->strRelTable = $strTableName;
+ $this->arrRelData = $arrRelations;
+ } elseif ($intSkipProc === 0) {
+ $arrRelations = $this->arrRelData;
+ $intReturn = 0;
+ }
+ if (($intSkipProc === 0) && (!is_array($arrRelations))) {
+ $intSkipProc = 1;
+ $intReturn = 1;
+ }
+ if ($intSkipProc === 0) {
+ /* Common domain is enabled? */
+ $this->getDomainData('enable_common', $strCommonEnable);
+ $intCommonEnable = (int)$strCommonEnable;
+ if ($intCommonEnable === 1) {
+ $strDomainWhere1 = ' (`config_id`=' . $this->intDomainId . ' OR `config_id`=0) ';
+ } else {
+ $strDomainWhere1 = ' `config_id`=' . $this->intDomainId . ' ';
+ }
+ /* Process relations */
+ foreach ($arrRelations as $elem) {
+ if ($elem['fieldName'] === $strDataKey) {
+ /* Process normal 1:n relations (1 = only data / 2 = including a * value) */
+ if (((int)$elem['type'] === 2) && (((int)$strDataValue === 1) || ((int)$strDataValue === 2))) {
+ $intReturn = $this->processRelation1($arrData, $strDataValue, $elem, $strDomainWhere1);
+ /* Process normal 1:1 relations */
+ } elseif ((int)$elem['type'] === 1) {
+ $intReturn = $this->processRelation2($arrData, $strDataValue, $elem, $strDomainWhere1);
+ /* Process normal 1:n relations with special table and idSort (template tables) */
+ } elseif (((int)$elem['type'] === 3) && ((int)$strDataValue === 1)) {
+ $intReturn = $this->processRelation3($arrData, $strDataValue, $elem, $strDomainWhere1);
+ /* Process special 1:n:str relations with string values (servicedependencies) */
+ } elseif (((int)$elem['type'] === 6) && (((int)$strDataValue === 1) || ((int)$strDataValue === 2))) {
+ $intReturn = $this->processRelation4($arrData, $strDataValue, $elem, $strDomainWhere1);
+ /* Process special relations for free variables */
+ } elseif (((int)$elem['type'] === 4) && ((int)$strDataValue === 1) && ($this->intNagVersion >= 3)) {
+ $intReturn = $this->processRelation5($resTemplate, $arrData, $elem);
+ /* Process special relations for service groups */
+ } elseif (((int)$elem['type'] === 5) && ((int)$strDataValue === 1)) {
+ $intReturn = $this->processRelation6($arrData, $strDataValue, $elem, $strDomainWhere1);
+ /* Process special relations for service parents */
+ } elseif (((int)$elem['type'] === 7) && ((int)$strDataValue === 1)) {
+ $intReturn = $this->processRelation7($arrData, $strDataValue, $elem);
+ /* Process "*" */
+ } elseif ((int)$strDataValue === 2) {
+ $strDataValue = '*';
+ } else {
+ $intReturn = 1;
+ }
+ }
+ }
+ }
+ return $intReturn;
+ }
+
+ /**
+ * @param array $arrData Dataset array
+ * @param string $strDataValue Data value
+ * @param array $elem Relation data array
+ * @param string $strDomainWhere1 SQL WHERE add-in
+ * @return int 0 = use data / 1 = skip data
+ */
+ private function processRelation1(array $arrData, string &$strDataValue, array $elem, string $strDomainWhere1): int
+ {
+ /* Define variables */
+ $arrDataRel = array();
+ $intDataCountRel = 0;
+ $intReturn = 0;
+ /* Get relation data */
+ $strSQLRel = 'SELECT `' . $elem['tableName1'] . '`.`' . $elem['target1'] . '`, `' . $elem['linkTable'] .
+ '`.`exclude` FROM `' . $elem['linkTable'] . '` LEFT JOIN `' . $elem['tableName1'] .
+ '` ON `' . $elem['linkTable'] . '`.`idSlave` = `' . $elem['tableName1'] . '`.`id`' .
+ 'WHERE `idMaster`=' . $arrData['id'] . " AND `active`='1' AND $strDomainWhere1" .
+ 'ORDER BY `' . $elem['tableName1'] . '`.`' . $elem['target1'] . '`';
+ $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
+ if ($booReturn && ($intDataCountRel !== 0)) {
+ /* Rewrite $strDataValue with returned relation data */
+ if ((int)$strDataValue === 2) {
+ $strDataValue = '*,';
+ } else {
+ $strDataValue = '';
+ }
+ foreach ($arrDataRel as $data) {
+ if ((int)$data['exclude'] === 0) {
+ $strDataValue .= $data[$elem['target1']] . ',';
+ } elseif ($this->intNagVersion >= 3) {
+ $strDataValue .= '!' . $data[$elem['target1']] . ',';
+ }
+ }
+ $strDataValue = substr($strDataValue, 0, -1);
+ if ($strDataValue === '') {
+ $intReturn = 1;
+ }
+ } else if ((int)$strDataValue === 2) {
+ $strDataValue = '*';
+ } else {
+ $intReturn = 1;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * @param array $arrData Dataset array
+ * @param string $strDataValue Data value
+ * @param array $elem Relation data array
+ * @param string $strDomainWhere1 SQL WHERE add-in
+ * @return int 0 = use data / 1 = skip data
+ */
+ private function processRelation2(array $arrData, string &$strDataValue, array $elem, string $strDomainWhere1): int
+ {
+ /* Define variables */
+ $arrDataRel = array();
+ $arrField = array();
+ $intDataCountRel = 0;
+ $intReturn = 0;
+ $strCommand = '';
+ /* Get relation data */
+ if (((string)$elem['tableName1'] === 'tbl_command') &&
+ (substr_count($arrData[$elem['fieldName']], '!') !== 0)) {
+ $arrField = explode('!', $arrData[$elem['fieldName']]);
+ $strCommand = strstr($arrData[$elem['fieldName']], '!');
+ $strSQLRel = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '`' .
+ 'WHERE `id`=' . $arrField[0] . " AND `active`='1' AND $strDomainWhere1";
+ } else {
+ $strSQLRel = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '`' .
+ 'WHERE `id`=' . $arrData[$elem['fieldName']] . " AND `active`='1' AND $strDomainWhere1";
+ }
+ $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
+ if ($booReturn && ($intDataCountRel !== 0)) {
+ /* Rewrite $strDataValue with returned relation data */
+ if (((string)$elem['tableName1'] === 'tbl_command') && (substr_count($strDataValue, '!') !== 0)) {
+ $strDataValue = $arrDataRel[0][$elem['target1']] . $strCommand;
+ } else {
+ $strDataValue = $arrDataRel[0][$elem['target1']];
+ }
+ } else if (((string)$elem['tableName1'] === 'tbl_command') && (substr_count($strDataValue, '!') !== 0) &&
+ ((int)$arrField[0] === -1)) {
+ $strDataValue = 'null';
+ } else {
+ $intReturn = 1;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * @param array $arrData Dataset array
+ * @param string $strDataValue Data value
+ * @param array $elem Relation data array
+ * @param string $strDomainWhere1 SQL WHERE add-in
+ * @return int 0 = use data / 1 = skip data
+ */
+ private function processRelation3(array $arrData, string &$strDataValue, array $elem, string $strDomainWhere1): int
+ {
+ /* Define variables */
+ $arrDataRel = array();
+ $intDataCountRel = 0;
+ $intReturn = 0;
+ /* Get relation data */
+ /** @noinspection SqlResolve */
+ $strSQLRel = 'SELECT * FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData['id'] . ' ORDER BY idSort';
+ $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
+ if ($booReturn && ($intDataCountRel !== 0)) {
+ /* Rewrite $strDataValue with returned relation data */
+ $strDataValue = '';
+ foreach ($arrDataRel as $data) {
+ if ((int)$data['idTable'] === 1) {
+ $strSQLName = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '`' .
+ "WHERE `active`='1' AND $strDomainWhere1 AND `id`=" . $data['idSlave'];
+ } else {
+ $strSQLName = 'SELECT `' . $elem['target2'] . '` FROM `' . $elem['tableName2'] . '`' .
+ "WHERE `active`='1' AND $strDomainWhere1 AND `id`=" . $data['idSlave'];
+ }
+ $strDataValue .= $this->myDBClass->getFieldData($strSQLName) . ',';
+ }
+ $strDataValue = substr($strDataValue, 0, -1);
+ } else {
+ $intReturn = 1;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * @param array $arrData Dataset array
+ * @param string $strDataValue Data value
+ * @param array $elem Relation data array
+ * @param string $strDomainWhere1 SQL WHERE add-in
+ * @return int 0 = use data / 1 = skip data
+ */
+ private function processRelation4(array $arrData, string &$strDataValue, array $elem, string $strDomainWhere1): int
+ {
+ /* Define variables */
+ $arrDataRel = array();
+ $intDataCountRel = 0;
+ $intReturn = 0;
+ /* Get relation data */
+ $strSQLRel = 'SELECT `' . $elem['linkTable'] . '`.`strSlave`, `' . $elem['linkTable'] . '`.`exclude` ' .
+ 'FROM `' . $elem['linkTable'] . '` ' .
+ 'LEFT JOIN `tbl_service` ON `' . $elem['linkTable'] . '`.`idSlave`=`tbl_service`.`id` ' .
+ 'WHERE `' . $elem['linkTable'] . '`.`idMaster`=' . $arrData['id'] . " AND `active`='1' AND " .
+ $strDomainWhere1 . ' ' .
+ 'ORDER BY `' . $elem['linkTable'] . '`.`strSlave`';
+ $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
+ if ($booReturn && ($intDataCountRel !== 0)) {
+ /* Rewrite $strDataValue with returned relation data */
+ if ((int)$strDataValue === 2) {
+ $strDataValue = '*,';
+ } else {
+ $strDataValue = '';
+ }
+ foreach ($arrDataRel as $data) {
+ if ((int)$data['exclude'] === 0) {
+ $strDataValue .= $data['strSlave'] . ',';
+ } elseif ($this->intNagVersion >= 3) {
+ $strDataValue .= '!' . $data['strSlave'] . ',';
+ }
+ }
+ $strDataValue = substr($strDataValue, 0, -1);
+ if ($strDataValue === '') {
+ $intReturn = 1;
+ }
+ } else if ((int)$strDataValue === 2) {
+ $strDataValue = '*';
+ } else {
+ $intReturn = 1;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * @param HTML_Template_IT $resTemplate Template object
+ * @param array $arrData Dataset array
+ * @param array $elem Relation data array
+ * @return int 0 = use data / 1 = skip data
+ */
+ private function processRelation5(HTML_Template_IT $resTemplate, array $arrData, array $elem): int
+ {
+ /* Define variables */
+ $arrDataRel = array();
+ $intDataCountRel = 0;
+ /** @noinspection SqlResolve */
+ $strSQLRel = 'SELECT * FROM `tbl_variabledefinition` LEFT JOIN `' . $elem['linkTable'] . '` ' .
+ 'ON `id`=`idSlave` WHERE `idMaster`=' . $arrData['id'] . ' ORDER BY `name`';
+ $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
+ if ($booReturn && ($intDataCountRel !== 0)) {
+ foreach ($arrDataRel as $vardata) {
+ /* Insert fill spaces */
+ $strFillLen = (30 - strlen($vardata['name']));
+ $strSpace = ' ';
+ $strSpace .= str_repeat(' ', $strFillLen);
+ $resTemplate->setVariable('ITEM_TITLE', $vardata['name'] . $strSpace);
+ $resTemplate->setVariable('ITEM_VALUE', html_entity_decode($vardata['value'], ENT_QUOTES | ENT_XML1, 'UTF-8'));
+ /** @noinspection DisconnectedForeachInstructionInspection */
+ $resTemplate->parse('configline');
+ }
+ }
+ return 1;
+ }
+
+ /**
+ * @param array $arrData Dataset array
+ * @param string $strDataValue Data value
+ * @param array $elem Relation data array
+ * @param string $strDomainWhere1 SQL WHERE add-in
+ * @return int 0 = use data / 1 = skip data
+ */
+ private function processRelation6(array $arrData, string &$strDataValue, array $elem, string $strDomainWhere1): int
+ {
+ /* Define variables */
+ $arrDataRel = array();
+ $arrHG1 = array();
+ $arrHG2 = array();
+ $intDataCountRel = 0;
+ $intHG1 = 0;
+ $intHG2 = 0;
+ $intReturn = 0;
+ /* Get relation data */
+ /** @noinspection SqlResolve */
+ $strSQLMaster = 'SELECT * FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData['id'];
+ $booReturn = $this->myDBClass->hasDataArray($strSQLMaster, $arrDataRel, $intDataCountRel);
+ if ($booReturn && ($intDataCountRel !== 0)) {
+ /* Rewrite $strDataValue with returned relation data */
+ $strDataValue = '';
+ foreach ($arrDataRel as $data) {
+ /* Get excluded hosts */
+ $arrExclude = array();
+ $strSQLEx = 'SELECT `idSlave` FROM `tbl_lnkServiceToHost` WHERE `exclude`=1 AND `idMaster`=' .
+ $data['idSlaveS'];
+ $booReturn = $this->myDBClass->hasDataArray($strSQLEx, $arrEx, $intEx);
+ if ($booReturn && ($intEx !== 0)) {
+ foreach ($arrEx as $elemEx) {
+ $arrExclude[] = $elemEx['idSlave'];
+ }
+ }
+ if ((int)$data['idSlaveHG'] !== 0) {
+ /* Get Sevices */
+ $strSQLSrv = 'SELECT `' . $elem['target2'] . '` FROM `' . $elem['tableName2'] .
+ '` WHERE `id`=' . $data['idSlaveS'];
+ $strService = $this->myDBClass->getFieldData($strSQLSrv);
+ $strSQLHG1 = 'SELECT `host_name`, `idSlave` FROM `tbl_host` ' .
+ 'LEFT JOIN `tbl_lnkHostgroupToHost` ON `id`=`idSlave` ' .
+ 'WHERE `idMaster`=' . $data['idSlaveHG'] . " AND `active`='1' AND `exclude`=0 " .
+ "AND $strDomainWhere1";
+ $booReturn = $this->myDBClass->hasDataArray($strSQLHG1, $arrHG1, $intHG1);
+ if ($booReturn && ($intHG1 !== 0)) {
+ foreach ($arrHG1 as $elemHG1) {
+ if (!in_array($elemHG1['idSlave'], $arrExclude, true) &&
+ substr_count($strDataValue, $elemHG1['host_name'] . ',' . $strService) === 0) {
+ $strDataValue .= $elemHG1['host_name'] . ',' . $strService . ',';
+ }
+ }
+ }
+ $strSQLHG2 = 'SELECT `host_name`, `idMaster` FROM `tbl_host` ' .
+ 'LEFT JOIN `tbl_lnkHostToHostgroup` ON `id`=`idMaster` ' .
+ 'WHERE `idSlave`=' . $data['idSlaveHG'] . " AND `active`='1' AND `exclude`=0 " .
+ "AND $strDomainWhere1";
+ $booReturn = $this->myDBClass->hasDataArray($strSQLHG2, $arrHG2, $intHG2);
+ if ($booReturn && ($intHG2 !== 0)) {
+ foreach ($arrHG2 as $elemHG2) {
+ if (!in_array($elemHG2['idMaster'], $arrExclude, true) &&
+ substr_count($strDataValue, $elemHG2['host_name'] . ',' . $strService) === 0) {
+ $strDataValue .= $elemHG2['host_name'] . ',' . $strService . ',';
+ }
+ }
+ }
+ } else {
+ $strSQLHost = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '` ' .
+ 'WHERE `id`=' . $data['idSlaveH'] . " AND `active`='1' AND $strDomainWhere1";
+ $strHost = $this->myDBClass->getFieldData($strSQLHost);
+ $strSQLSrv = 'SELECT `' . $elem['target2'] . '` FROM `' . $elem['tableName2'] . '` ' .
+ 'WHERE `id`=' . $data['idSlaveS'] . " AND `active`='1' AND $strDomainWhere1";
+ $strService = $this->myDBClass->getFieldData($strSQLSrv);
+ if (($strHost !== '') && ($strService !== '') &&
+ substr_count($strDataValue, $strHost . ',' . $strService) === 0 &&
+ !in_array($data['idSlaveH'], $arrExclude, true)) {
+ $strDataValue .= $strHost . ',' . $strService . ',';
+ }
+ }
+ }
+ $strDataValue = substr($strDataValue, 0, -1);
+ if ($strDataValue === '') {
+ $intReturn = 1;
+ }
+ } else {
+ $intReturn = 1;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * @param array $arrData Dataset array
+ * @param string $strDataValue Data value
+ * @param array $elem Relation data array
+ * @return int 0 = use data / 1 = skip data
+ */
+ private function processRelation7(array $arrData, string &$strDataValue, array $elem): int
+ {
+ $intReturn = 1;
+ /* Get relation data */
+ /** @noinspection SqlResolve */
+ $strSQLMaster = 'SELECT * FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData['id'];
+ $booReturn = $this->myDBClass->hasDataArray($strSQLMaster, $arrDataRel, $intDataCountRel);
+ if ($booReturn && ($intDataCountRel !== 0)) {
+ /* Rewrite $strDataValue with returned relation data */
+ $strDataValue = '';
+ /** @var array $arrDataRel */
+ foreach ($arrDataRel as $data) {
+ $strSQL = 'SELECT host_name FROM tbl_host WHERE id=' . $data['idHost'];
+ $strHost = $this->myDBClass->getFieldData($strSQL);
+ $strSQL = 'SELECT service_description FROM tbl_service WHERE id=' . $data['idSlave'];
+ $strService = $this->myDBClass->getFieldData($strSQL);
+ $strDataValue .= $strHost . ',' . $strService . ',';
+ $intReturn = 0;
+ }
+ $strDataValue = substr($strDataValue, 0, -1);
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Rename field names
+ * @param string $strTableName Table name
+ * @param int $intConfigID Configuration target ID
+ * @param int $intDataId Data ID
+ * @param string $key Data key (by reference)
+ * @param string $value Data value (by reference)
+ * @param int $intSkip Skip value (by reference) 1 = skip / 0 = pass
+ */
+ private function renameFields(string $strTableName, int $intConfigID, int $intDataId, string &$key, string &$value, int &$intSkip): void
+ {
+ if ($this->intNagVersion === 0) {
+ $this->getConfigData($intConfigID, 'version', $this->intNagVersion);
+ }
+ /* Picture path */
+ if ($this->strPicPath === 'none') {
+ $this->getConfigData($intConfigID, 'picturedir', $this->strPicPath);
+ }
+ if ($key === 'icon_image') {
+ $value = $this->strPicPath . $value;
+ }
+ if ($key === 'vrml_image') {
+ $value = $this->strPicPath . $value;
+ }
+ if ($key === 'statusmap_image') {
+ $value = $this->strPicPath . $value;
+ }
+ /* Tables */
+ if ($strTableName === 'tbl_host') {
+ if ($key === 'use_template') {
+ $key = 'use';
+ }
+ $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,';
+ $strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,';
+ $strVIValues .= 'retain_nonstatus_information,notifications_enabled';
+ if (in_array($key, explode(',', $strVIValues), true)) {
+ if ((int)$value === -1) {
+ $value = 'null';
+ }
+ if ((int)$value === 3) {
+ $value = 'null';
+ }
+ }
+ if ($key === 'parents') {
+ $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_host', $intDataId, $intSkip);
+ }
+ if ($key === 'hostgroups') {
+ $value = $this->checkTpl($value, 'hostgroups_tploptions', 'tbl_host', $intDataId, $intSkip);
+ }
+ if ($key === 'contacts') {
+ $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_host', $intDataId, $intSkip);
+ }
+ if ($key === 'contact_groups') {
+ $value = $this->checkTpl($value, 'contact_groups_tploptions', 'tbl_host', $intDataId, $intSkip);
+ }
+ if ($key === 'use') {
+ $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_host', $intDataId, $intSkip);
+ }
+ if ($key === 'check_command') {
+ $value = str_replace("\::bang::", "\!", $value);
+ }
+ if ($key === 'check_command') {
+ $value = str_replace('::bang::', "\!", $value);
+ }
+ }
+ if ($strTableName === 'tbl_service') {
+ if ($key === 'use_template') {
+ $key = 'use';
+ }
+ if ($this->intNagVersion < 2) {
+ if ($key === 'check_interval') {
+ $key = 'normal_check_interval';
+ }
+ if ($key === 'retry_interval') {
+ $key = 'retry_check_interval';
+ }
+ }
+ $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,';
+ $strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,';
+ $strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,';
+ $strVIValues .= 'notifications_enabled';
+ if (in_array($key, explode(',', $strVIValues), true)) {
+ if ((int)$value === -1) {
+ $value = 'null';
+ }
+ if ((int)$value === 3) {
+ $value = 'null';
+ }
+ }
+ if ($key === 'host_name') {
+ $value = $this->checkTpl($value, 'host_name_tploptions', 'tbl_service', $intDataId, $intSkip);
+ }
+ if ($key === 'hostgroup_name') {
+ $value = $this->checkTpl($value, 'hostgroup_name_tploptions', 'tbl_service', $intDataId, $intSkip);
+ }
+ if ($key === 'parents') {
+ $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_service', $intDataId, $intSkip);
+ }
+ if ($key === 'servicegroups') {
+ $value = $this->checkTpl($value, 'servicegroups_tploptions', 'tbl_service', $intDataId, $intSkip);
+ }
+ if ($key === 'contacts') {
+ $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_service', $intDataId, $intSkip);
+ }
+ if ($key === 'contact_groups') {
+ $value = $this->checkTpl($value, 'contact_groups_tploptions', 'tbl_service', $intDataId, $intSkip);
+ }
+ if ($key === 'use') {
+ $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_service', $intDataId, $intSkip);
+ }
+ if ($key === 'check_command') {
+ $value = str_replace("\::bang::", "\!", $value);
+ }
+ if ($key === 'check_command') {
+ $value = str_replace('::bang::', "\!", $value);
+ }
+ }
+ if ($strTableName === 'tbl_hosttemplate') {
+ if ($key === 'template_name') {
+ $key = 'name';
+ }
+ if ($key === 'use_template') {
+ $key = 'use';
+ }
+ $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,';
+ $strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,';
+ $strVIValues .= 'retain_nonstatus_information,notifications_enabled';
+ if (in_array($key, explode(',', $strVIValues), true)) {
+ if ((int)$value === -1) {
+ $value = 'null';
+ }
+ if ((int)$value === 3) {
+ $value = 'null';
+ }
+ }
+ if ($key === 'parents') {
+ $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
+ }
+ if ($key === 'hostgroups') {
+ $value = $this->checkTpl($value, 'hostgroups_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
+ }
+ if ($key === 'contacts') {
+ $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
+ }
+ if ($key === 'contact_groups') {
+ $value = $this->checkTpl($value, 'contact_groups_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
+ }
+ if ($key === 'use') {
+ $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
+ }
+ }
+ if ($strTableName === 'tbl_servicetemplate') {
+ if ($key === 'template_name') {
+ $key = 'name';
+ }
+ if ($key === 'use_template') {
+ $key = 'use';
+ }
+ if ($this->intNagVersion < 2) {
+ if ($key === 'check_interval') {
+ $key = 'normal_check_interval';
+ }
+ if ($key === 'retry_interval') {
+ $key = 'retry_check_interval';
+ }
+ }
+ $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,';
+ $strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,';
+ $strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,';
+ $strVIValues .= 'notifications_enabled';
+ if (in_array($key, explode(',', $strVIValues), true)) {
+ if ((int)$value === -1) {
+ $value = 'null';
+ }
+ if ((int)$value === 3) {
+ $value = 'null';
+ }
+ }
+ if ($key === 'host_name') {
+ $value = $this->checkTpl($value, 'host_name_tploptions', 'tbl_servicetemplate', $intDataId, $intSkip);
+ }
+ if ($key === 'hostgroup_name') {
+ $value = $this->checkTpl(
+ $value,
+ 'hostgroup_name_tploptions',
+ 'tbl_servicetemplate',
+ $intDataId,
+ $intSkip
+ );
+ }
+ if ($key === 'parents') {
+ $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_servicetemplate', $intDataId, $intSkip);
+ }
+ if ($key === 'servicegroups') {
+ $value = $this->checkTpl(
+ $value,
+ 'servicegroups_tploptions',
+ 'tbl_servicetemplate',
+ $intDataId,
+ $intSkip
+ );
+ }
+ if ($key === 'contacts') {
+ $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_servicetemplate', $intDataId, $intSkip);
+ }
+ if ($key === 'contact_groups') {
+ $value = $this->checkTpl(
+ $value,
+ 'contact_groups_tploptions',
+ 'tbl_servicetemplate',
+ $intDataId,
+ $intSkip
+ );
+ }
+ if ($key === 'use') {
+ $value = $this->checkTpl(
+ $value,
+ 'use_template_tploptions',
+ 'tbl_servicetemplate',
+ $intDataId,
+ $intSkip
+ );
+ }
+ }
+ if ($strTableName === 'tbl_contact') {
+ if ($key === 'use_template') {
+ $key = 'use';
+ }
+ $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
+ $strVIValues .= 'retain_status_information,retain_nonstatus_information';
+ if (in_array($key, explode(',', $strVIValues), true)) {
+ if ((int)$value === -1) {
+ $value = 'null';
+ }
+ if ((int)$value === 3) {
+ $value = 'null';
+ }
+ }
+ if ($key === 'contactgroups') {
+ $value = $this->checkTpl($value, 'contactgroups_tploptions', 'tbl_contact', $intDataId, $intSkip);
+ }
+ if ($key === 'host_notification_commands') {
+ $value = $this->checkTpl(
+ $value,
+ 'host_notification_commands_tploptions',
+ 'tbl_contact',
+ $intDataId,
+ $intSkip
+ );
+ }
+ if ($key === 'service_notification_commands') {
+ $value = $this->checkTpl(
+ $value,
+ 'service_notification_commands_tploptions',
+ 'tbl_contact',
+ $intDataId,
+ $intSkip
+ );
+ }
+ if ($key === 'use') {
+ $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_contact', $intDataId, $intSkip);
+ }
+ }
+ if ($strTableName === 'tbl_contacttemplate') {
+ if ($key === 'template_name') {
+ $key = 'name';
+ }
+ if ($key === 'use_template') {
+ $key = 'use';
+ }
+ $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
+ $strVIValues .= 'retain_status_information,retain_nonstatus_information';
+ if (in_array($key, explode(',', $strVIValues), true)) {
+ if ((int)$value === -1) {
+ $value = 'null';
+ }
+ if ((int)$value === 3) {
+ $value = 'null';
+ }
+ }
+ if ($key === 'contactgroups') {
+ $value = $this->checkTpl(
+ $value,
+ 'contactgroups_tploptions',
+ 'tbl_contacttemplate',
+ $intDataId,
+ $intSkip
+ );
+ }
+ if ($key === 'host_notification_commands') {
+ $value = $this->checkTpl(
+ $value,
+ 'host_notification_commands_tploptions',
+ 'tbl_contacttemplate',
+ $intDataId,
+ $intSkip
+ );
+ }
+ if ($key === 'service_notification_commands') {
+ $value = $this->checkTpl(
+ $value,
+ 'service_notification_commands_tploptions',
+ 'tbl_contacttemplate',
+ $intDataId,
+ $intSkip
+ );
+ }
+ if ($key === 'use') {
+ $value = $this->checkTpl(
+ $value,
+ 'use_template_tploptions',
+ 'tbl_contacttemplate',
+ $intDataId,
+ $intSkip
+ );
+ }
+ }
+ if ((($strTableName === 'tbl_hosttemplate') || ($strTableName === 'tbl_servicetemplate') ||
+ ($strTableName === 'tbl_contacttemplate')) && $key === 'register') {
+ $value = '0';
+ }
+ if ($strTableName === 'tbl_timeperiod' && $key === 'use_template') {
+ $key = 'use';
+ }
+ }
+
+ /**
+ * Process special settings based on template option
+ * @param string $strValue Original data value
+ * @param string $strKeyField Template option field name
+ * @param string $strTable Table name
+ * @param int $intId Dataset ID
+ * @param int $intSkip Skip value (by reference)
+ * @return string Manipulated data value
+ */
+ public function checkTpl(string $strValue, string $strKeyField, string $strTable, int $intId, int &$intSkip): string
+ {
+ if ($this->intNagVersion < 3) {
+ return $strValue;
+ }
+ $strSQL = 'SELECT `' . $strKeyField . '` FROM `' . $strTable . "` WHERE `id` = $intId";
+ $intValue = $this->myDBClass->getFieldData($strSQL);
+ if ((int)$intValue === 0) {
+ return ('+' . $strValue);
+ }
+ if ((int)$intValue === 1) {
+ $intSkip = 0;
+ return 'null';
+ }
+ return $strValue;
+ }
+
+ /**
+ * Open configuration file
+ * @param string $strFile File name
+ * @param int $intConfigID Configuration ID
+ * @param int $intType Type ID
+ * @param resource $resConfigFile Temporary or configuration file ressource (by reference)
+ * @param string $strConfigFile Configuration file name (by reference)
+ * @return int 0 = successful / 1 = error
+ */
+ private function getConfigFile(string $strFile, int $intConfigID, int $intType, &$resConfigFile, string &$strConfigFile): int
+ {
+ /* Variable definitions */
+ $strBaseDir = '';
+ $intMethod = 1;
+ $intReturn = 0;
+ $strConfigValue = '';
+ /* Get config data */
+ if ($intType === 1) {
+ $this->getConfigData($intConfigID, 'hostconfig', $strBaseDir);
+ $strType = 'host';
+ } elseif ($intType === 2) {
+ $this->getConfigData($intConfigID, 'serviceconfig', $strBaseDir);
+ $strType = 'service';
+ } else {
+ $this->getConfigData($intConfigID, 'basedir', $strBaseDir);
+ $strType = 'basic';
+ }
+ if ($this->getConfigData($intConfigID, 'method', $strConfigValue) === 0) {
+ $intMethod = (int)$strConfigValue;
+ }
+ /* Backup config file */
+ $this->moveFile($strType, $strFile, $intConfigID);
+ /* Variable definition */
+ $strConfigFile = $strBaseDir . '/' . $strFile;
+ /* Local file system */
+ if ($intMethod === 1) {
+ /* Save configuration file */
+ if (is_writable($strConfigFile) || (!file_exists($strConfigFile) && is_writable($strBaseDir))) {
+ /** @noinspection CallableParameterUseCaseInTypeContextInspection */
+ $resConfigFile = fopen($strConfigFile, 'wb');
+ chmod($strConfigFile, 0644);
+ } else {
+ $this->myDataClass->writeLog(translate('Configuration write failed:') . ' ' . $strFile);
+ $this->processClassMessage(translate('Cannot open/overwrite the configuration file (check the '
+ . 'permissions)!') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ } elseif ($intMethod === 2) { /* Remote file (FTP) */
+ /* Check connection */
+ if (empty($this->conFTPConId) || !is_resource($this->conFTPConId) ||
+ ($this->resConnectType !== 'FTP')) {
+ $intReturn = $this->getFTPConnection($intConfigID);
+ }
+ if ($intReturn === 0) {
+ /* Open the config file */
+ if (isset($this->arrSettings['path']['tempdir'])) {
+ $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql');
+ } else {
+ $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql');
+ }
+ /** @noinspection CallableParameterUseCaseInTypeContextInspection */
+ $resConfigFile = fopen($strConfigFile, 'wb');
+ }
+ } elseif ($intMethod === 3) { /* Remote file (SFTP) */
+ /* Check connection */
+ if (empty($this->resSSHConId) || !is_resource($this->resSSHConId) ||
+ ($this->resConnectType !== 'SSH')) {
+ $intReturn = $this->getSSHConnection($intConfigID);
+ }
+ if ($intReturn === 0) {
+ if (isset($this->arrSettings['path']['tempdir'])) {
+ $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql');
+ } else {
+ $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql');
+ }
+ /** @noinspection CallableParameterUseCaseInTypeContextInspection */
+ $resConfigFile = fopen($strConfigFile, 'wb');
+ }
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Moves an existing configuration file to the backup directory and removes then the original file
+ * @param string $strType Type of the configuration file
+ * @param string $strName Name of the configuration file
+ * @param int $intConfigID Configuration target ID
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ public function moveFile(string $strType, string $strName, int $intConfigID): int
+ {
+ /* Variable definitions */
$strConfigDir = '';
$strBackupDir = '';
- $intReturn = 0;
- // Get directories
+ $intReturn = 0;
+ /* Get directories */
switch ($strType) {
case 'host':
$this->getConfigData($intConfigID, 'hostconfig', $strConfigDir);
@@ -580,25 +2267,27 @@ class NagConfigClass
default:
$intReturn = 1;
}
- if ($intReturn == 0) {
- // Variable definition
- $intMethod = 1;
- $strDate = date('YmdHis');
- $strSourceFile = $strConfigDir. '/' .$strName;
- $strDestinationFile = $strBackupDir. '/' .$strName. '_old_' .$strDate;
- $booRetVal = false;
- // Get connection method
- $this->getConfigData($intConfigID, 'method', $intMethod);
- // Local file system
- if ($intMethod == 1) {
- // Save configuration file
+ if ($intReturn === 0) {
+ /* Variable definition */
+ $intMethod = 1;
+ $strDate = date('YmdHis');
+ $strSourceFile = $strConfigDir . '/' . $strName;
+ $strDestinationFile = $strBackupDir . '/' . $strName . '_old_' . $strDate;
+ $booRetVal = false;
+ /* Get connection method */
+ if ($this->getConfigValues($intConfigID, 'method', $strMethod) === 0) {
+ $intMethod = (int)$strMethod;
+ }
+ /* Local file system */
+ if ($intMethod === 1) {
+ /* Save configuration file */
if (file_exists($strSourceFile)) {
if (is_writable($strBackupDir) && is_writable($strConfigDir)) {
copy($strSourceFile, $strDestinationFile);
unlink($strSourceFile);
} else {
$this->processClassMessage(translate('Cannot backup the old file because the permissions are '
- .'wrong - destination file: ').$strDestinationFile. '::', $this->strErrorMessage);
+ . 'wrong - destination file: ') . $strDestinationFile . '::', $this->strErrorMessage);
$intReturn = 1;
}
} else {
@@ -606,53 +2295,53 @@ class NagConfigClass
. 'missing - source file: ') . $strSourceFile . '::', $this->strErrorMessage);
$intReturn = 1;
}
- } elseif ($intMethod == 2) { // Remote file (FTP)
- // Check connection
+ } elseif ($intMethod === 2) { /* Remote file (FTP) */
+ /* Check connection */
$intReturn = $this->getFTPConnection($intConfigID);
- if ($intReturn == 0) {
- $strSourceFile = str_replace('//', '/', $strSourceFile);
+ if ($intReturn === 0) {
+ $strSourceFile = str_replace('//', '/', $strSourceFile);
$strDestinationFile = str_replace('//', '/', $strDestinationFile);
- // Save configuration file
- $intFileStamp = ftp_mdtm($this->resConnectId, $strSourceFile);
+ /* Save configuration file */
+ $intFileStamp = ftp_mdtm($this->conFTPConId, $strSourceFile);
if ($intFileStamp > -1) {
$intErrorReporting = error_reporting();
error_reporting(0);
- $booRetVal = ftp_rename($this->resConnectId, $strSourceFile, $strDestinationFile);
+ $booRetVal = ftp_rename($this->conFTPConId, $strSourceFile, $strDestinationFile);
error_reporting($intErrorReporting);
} else {
$this->processClassMessage(translate('Cannot backup the old file because the source file is '
- .'missing (remote FTP) - source file: '). $strSourceFile. '::', $this->strErrorMessage);
+ . 'missing (remote FTP) - source file: ') . $strSourceFile . '::', $this->strErrorMessage);
$intReturn = 1;
}
}
- if (($booRetVal == false) && ($intReturn == 0)) {
+ if (($booRetVal === false) && ($intReturn === 0)) {
$this->processClassMessage(translate('Cannot backup the old file because the permissions are '
- .'wrong (remote FTP) - destination file: ').$strDestinationFile. '::', $this->strErrorMessage);
+ . 'wrong (remote FTP) - destination file: ') . $strDestinationFile . '::', $this->strErrorMessage);
$intReturn = 1;
}
- } elseif ($intMethod == 3) { // Remote file (SFTP)
- // Check connection
+ } elseif ($intMethod === 3) { /* Remote file (SFTP) */
+ /* Check connection */
$intReturn = $this->getSSHConnection($intConfigID);
- // Save configuration file
- $arrResult = array();
- $strSourceFile = str_replace('//', '/', $strSourceFile);
+ /* Save configuration file */
+ $arrResult = array();
+ $strSourceFile = str_replace('//', '/', $strSourceFile);
$strDestinationFile = str_replace('//', '/', $strDestinationFile);
- $strCommand = 'ls '.$strSourceFile;
- if (($intReturn == 0) && ($this->sendSSHCommand($strCommand, $arrResult) == 0)) {
- if (isset($arrResult[0]) && $arrResult[0] == $strSourceFile) {
- $arrInfo = ssh2_sftp_stat($this->resSFTP, $strSourceFile);
+ $strCommand = 'ls ' . $strSourceFile;
+ if (($intReturn === 0) && ($this->sendSSHCommand($strCommand, $arrResult) === 0)) {
+ if (isset($arrResult[0]) && $arrResult[0] === $strSourceFile) {
+ $arrInfo = ssh2_sftp_stat($this->resSFTP, $strSourceFile);
if ($arrInfo['mtime'] > -1) {
$booRetVal = ssh2_sftp_rename($this->resSFTP, $strSourceFile, $strDestinationFile);
}
} else {
$this->processClassMessage(translate('Cannot backup the old file because the source file is '
- .'missing (remote SFTP) - source file: '). $strSourceFile. '::', $this->strErrorMessage);
+ . 'missing (remote SFTP) - source file: ') . $strSourceFile . '::', $this->strErrorMessage);
$intReturn = 1;
}
}
- if (($booRetVal == false) && ($intReturn == 0)) {
+ if (($booRetVal === false) && ($intReturn === 0)) {
$this->processClassMessage(translate('Cannot backup the old file because the permissions are '
- .'wrong (remote SFTP) - destination file: ').$strDestinationFile. '::', $this->strErrorMessage);
+ . 'wrong (remote SFTP) - destination file: ') . $strDestinationFile . '::', $this->strErrorMessage);
$intReturn = 1;
}
}
@@ -661,388 +2350,88 @@ class NagConfigClass
}
/**
- * Remove a file
- * @param string $strFileName Filename including path to remove
- * @param int $intConfigID Configuration target ID
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
+ * Write configuration file
+ * @param string $strData Data string
+ * @param string $strFile File name
+ * @param int $intType Type ID
+ * @param int $intConfigID Configuration target ID
+ * @param resource $resConfigFile Temporary or configuration file ressource
+ * @param string $strConfigFile Configuration file name
+ * @return int 0 = successful / 1 = error
*/
- public function removeFile($strFileName, $intConfigID)
+ private function writeConfigFile(string $strData, string $strFile, int $intType, int $intConfigID, $resConfigFile, string $strConfigFile): int
{
- // Variable definitions
+ /* Variable definitions */
+ $intReturn = 0;
$intMethod = 1;
- $intReturn = 0;
- $booRetVal = false;
- // Get connection method
- $this->getConfigData($intConfigID, 'method', $intMethod);
- // Local file system
- if ($intMethod == 1) {
- // Save configuration file
- if (file_exists($strFileName)) {
- if (is_writable($strFileName)) {
- unlink($strFileName);
- } else {
- $this->processClassMessage(translate('Cannot delete the file (wrong permissions)!').'::'.
- $strFileName. '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- } else {
- $this->processClassMessage(translate('Cannot delete the file (file does not exist)!').'::'.
- $strFileName. '::', $this->strErrorMessage);
+ $strBaseDir = '';
+ $strConfigValue = '';
+ /* Get config data */
+ if ($intType === 1) {
+ $this->getConfigData($intConfigID, 'hostconfig', $strBaseDir);
+ } elseif ($intType === 2) {
+ $this->getConfigData($intConfigID, 'serviceconfig', $strBaseDir);
+ } else {
+ $this->getConfigData($intConfigID, 'basedir', $strBaseDir);
+ }
+ if ($this->getConfigData($intConfigID, 'method', $strConfigValue) === 0) {
+ $intMethod = (int)$strConfigValue;
+ }
+ $strData = str_replace("\r\n", "\n", $strData);
+ fwrite($resConfigFile, $strData);
+ /* Local filesystem */
+ if ($intMethod === 1) {
+ fclose($resConfigFile);
+ } elseif ($intMethod === 2) { /* FTP access */
+ /* SSH Possible */
+ if (!function_exists('ftp_put')) {
+ $this->processClassMessage(translate('FTP module not loaded!') . '::', $this->strErrorMessage);
$intReturn = 1;
- }
- } elseif ($intMethod == 2) { // Remote file (FTP)
- // Check connection
- $intReturn = $this->getFTPConnection($intConfigID);
- if ($intReturn == 0) {
- // Save configuration file
- $intFileStamp = ftp_mdtm($this->resConnectId, $strFileName);
- if ($intFileStamp > -1) {
- $intErrorReporting = error_reporting();
- error_reporting(0);
- $booRetVal = ftp_delete($this->resConnectId, $strFileName);
+ } else {
+ $intErrorReporting = error_reporting();
+ error_reporting(0);
+ if (!ftp_put($this->conFTPConId, $strBaseDir . '/' . $strFile, $strConfigFile, FTP_ASCII)) {
+ $arrError = error_get_last();
error_reporting($intErrorReporting);
- } else {
- $this->processClassMessage(translate('Cannot delete file because it does not exists (remote '
- . 'FTP)!'). '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- }
- if ($booRetVal == false) {
- $this->processClassMessage(translate('Cannot delete file because the permissions are incorrect '
- . '(remote FTP)!'). '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- } elseif ($intMethod == 3) { // Remote file (SFTP)
- // Check connection
- $intReturn = $this->getSSHConnection($intConfigID);
- // Save configuration file
- if (($intReturn == 0) && ($this->sendSSHCommand('ls '.$strFileName, $arrResult) == 0)) {
- if (isset($arrResult[0])) {
- $booRetVal = ssh2_sftp_unlink($this->resSFTP, $strFileName);
- } else {
- $this->processClassMessage(translate('Cannot delete file because it does not exists (remote '
- . 'SSH/SFTP)!'). '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- }
- if (($intReturn == 0) && ($booRetVal == false)) {
- $this->processClassMessage(translate('Cannot delete file because the permissions are incorrect '
- . '(remote SSH/SFTP)!'). '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- }
- return $intReturn;
- }
-
- /**
- * Get configuration domain parameters
- * @param int $intConfigId Configuration ID
- * @param string $strConfigItem Configuration key
- * @param string $strValue Configuration value (by reference)
- * @return int 0 = successful / 1 = error
- */
- public function getConfigData($intConfigId, $strConfigItem, &$strValue)
- {
- $intReturn = 1;
- $strSQL = 'SELECT `' .$strConfigItem. '` FROM `tbl_configtarget` WHERE `id` = ' .$intConfigId;
- $strValue = $this->myDBClass->getFieldData($strSQL);
- if ($strValue != '') {
- $intReturn = 0;
- }
- return $intReturn;
- }
-
- /**
- * Check a directory for write access
- * @param string $strPath Physical path
- * @return int 0 = successful / 1 = error
- */
- public function isDirWriteable($strPath)
- {
- // Define variables
- $intReturnFile = 1;
- $intReturnDir = 1;
- $intReturn = 1;
- // Is input path a file?
- if (file_exists($strPath) && is_file($strPath)) {
- $resFile = fopen($strPath, 'ab');
- if ($resFile) {
- $intReturnFile = 0;
- }
- } else {
- $intReturnFile = 0;
- }
- if (is_file($strPath)) {
- $strDirectory = \dirname($strPath);
- } else {
- $strDirectory = $strPath;
- }
- $strFile = $strDirectory.'/'.uniqid(mt_rand(), true).'.tmp';
- // Check writing in directory directly
- if (is_dir($strDirectory) && is_writable($strDirectory)) {
- $resFile = fopen($strFile, 'wb');
- if ($resFile) {
- $intReturnDir = 0;
- unlink($strFile);
- }
- } else {
- $intReturnDir = 0;
- }
- if (($intReturnDir == 0) && ($intReturnFile == 0)) {
- $intReturn = 0;
- }
- return $intReturn;
- }
-
- /**
- * Copy a remote file
- * @param string $strFileRemote Remote file name
- * @param int $intConfigID Configuration target id
- * @param string $strFileLocal Local file name
- * @param int $intDirection 0 = from remote to local / 1 = from local to remote
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function remoteFileCopy($strFileRemote, $intConfigID, $strFileLocal, $intDirection = 0)
- {
- // Variable definitions
- $intMethod = 3;
- $intReturn = 0;
- $arrTemp = array();
- // Get method
- $this->getConfigData($intConfigID, 'method', $intMethod);
- if ($intMethod == 2) {
- // Check connection
- $intReturn = $this->getFTPConnection($intConfigID);
- if (($intReturn == 0) && ($intDirection == 0)) {
- $intErrorReporting = error_reporting();
- error_reporting(0);
- if (!ftp_get($this->resConnectId, $strFileLocal, $strFileRemote, FTP_ASCII)) {
- $this->processClassMessage(translate('Cannot get the remote file (it does not exist or is not '
- . 'readable) - remote file: '). $strFileRemote. '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- error_reporting($intErrorReporting);
- } elseif (($intReturn == 0) && ($intDirection == 1)) {
- $intErrorReporting = error_reporting();
- error_reporting(0);
- if (!ftp_put($this->resConnectId, $strFileRemote, $strFileLocal, FTP_ASCII)) {
- $this->processClassMessage(translate('Cannot write the remote file (remote file is not writeable)'
- . '- remote file: ').$strFileRemote. '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- error_reporting($intErrorReporting);
- }
- ftp_close($this->resConnectId);
- } elseif ($intMethod == 3) { // Remote file (SFTP)
- $intReturn = $this->getSSHConnection($intConfigID);
- if (($intReturn == 0) && ($intDirection == 0)) {
- // Copy file
- $intErrorReporting = error_reporting();
- error_reporting(0);
- if (!ssh2_scp_recv($this->resConnectId, $strFileRemote, $strFileLocal)) {
- if ($this->sendSSHCommand('ls ' . $strFileRemote, $arrTemp) != 0) {
- $this->processClassMessage(translate('Cannot get the remote file (it does not exist or is not '
- . 'readable) - remote file: ') .$strFileRemote. '::', $this->strErrorMessage);
- } else {
- $this->processClassMessage(translate('Remote file is not readable - remote file: ')
- . $strFileRemote. '::', $this->strErrorMessage);
+ $this->processClassMessage(translate('Cannot open/overwrite the configuration file (FTP connection '
+ . 'failed)!') . '::', $this->strErrorMessage);
+ if ((string)$arrError['message'] !== '') {
+ $this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage);
}
$intReturn = 1;
}
error_reporting($intErrorReporting);
- } elseif (($intReturn == 0) && ($intDirection == 1)) {
- if (file_exists($strFileLocal) && is_readable($strFileLocal)) {
- $intErrorReporting = error_reporting();
- error_reporting(0);
- if (!ssh2_scp_send($this->resConnectId, $strFileLocal, $strFileRemote, 0644)) {
- $this->processClassMessage(translate('Cannot write a remote file (remote file is not writeable)'
- .' - remote file: '). $strFileRemote . '::', $this->strErrorMessage);
- $intReturn = 1;
- }
+ ftp_close($this->conFTPConId);
+ fclose($resConfigFile);
+ }
+ } elseif ($intMethod === 3) { /* SSH access */
+ /* SSH Possible */
+ if (!function_exists('ssh2_scp_send')) {
+ $this->processClassMessage(translate('SSH module not loaded!') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ } else {
+ $intErrorReporting = error_reporting();
+ error_reporting(0);
+ if (!ssh2_scp_send($this->resSSHConId, $strConfigFile, $strBaseDir . '/' . $strFile, 0644)) {
+ $arrError = error_get_last();
error_reporting($intErrorReporting);
- } else {
- $this->processClassMessage(translate('Cannot copy a local file to remote because the local file '.
- 'does not exist or is not readable - local file: ').
- $strFileLocal . '::', $this->strErrorMessage);
+ $this->processClassMessage(translate('Cannot open/overwrite the configuration file (remote SFTP)!') .
+ '::', $this->strErrorMessage);
+ if ((string)$arrError['message'] !== '') {
+ $this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage);
+ }
$intReturn = 1;
}
+ error_reporting($intErrorReporting);
+ fclose($resConfigFile);
+ unlink($strConfigFile);
+ $this->resSSHConId = null;
}
}
- return $intReturn;
- }
-
- /**
- * Add files of a given directory to an array
- * @param string $strSourceDir Source directory
- * @param string $strIncPattern Include file pattern
- * @param string $strExcPattern Exclude file pattern
- * @param array $arrOutput Output array (by reference)
- * @param string $strErrorMessage Error messages (by reference)
- */
- public function storeDirToArray($strSourceDir, $strIncPattern, $strExcPattern, &$arrOutput, &$strErrorMessage)
- {
- // Define variables
- $arrDir = array();
- while (substr($strSourceDir, -1) == '/' or substr($strSourceDir, -1) == "\\") {
- $strSourceDir = substr($strSourceDir, 0, -1);
- }
- $resHandle = opendir($strSourceDir);
- if ($resHandle === false) {
- if ($this->intDomainId != 0) {
- $strErrorMessage .= translate('Could not open directory'). ': ' .$strSourceDir;
- }
- } else {
- $booBreak = true;
- while ($booBreak) {
- if (!$arrDir[] = readdir($resHandle)) {
- $booBreak = false;
- }
- }
- closedir($resHandle);
- sort($arrDir);
- /** @var string $file */
- foreach ($arrDir as $file) {
- /** @noinspection StrlenInEmptyStringCheckContextInspection */
- if (!preg_match("/^\.{1,2}/", $file) && \strlen($file)) {
- if (is_dir($strSourceDir. '/' .$file)) {
- $this->storeDirToArray(
- $strSourceDir. '/' .$file,
- $strIncPattern,
- $strExcPattern,
- $arrOutput,
- $strErrorMessage
- );
- } else {
- if (preg_match('/' .$strIncPattern. '/', $file) && (($strExcPattern == '') ||
- !preg_match('/' .$strExcPattern. '/', $file))) {
- if (0 === stripos(PHP_OS, 'WIN')) {
- $strSourceDir=str_replace('/', "\\", $strSourceDir);
- $arrOutput [] = $strSourceDir."\\".$file;
- } else {
- $arrOutput [] = $strSourceDir. '/' .$file;
- }
- }
- }
- }
- }
- }
- }
-
- /**
- * Determines the dates of the last data table change and the last modification to the configuration files
- * @param string $strTableName Name of the data table
- * @param array $arrTimeData Array with time data of table and all config files
- * @param string $strCheckConfig Information string (text message)
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function lastModifiedFile($strTableName, &$arrTimeData, &$strCheckConfig)
- {
- // Variable definitions
- $intEnableCommon = 0;
- $arrDataset = array();
- $strFileName = '';
- $strCheckConfig = '';
- $intReturn = 0;
- // Get configuration filename based on table name
- $arrConfigData = $this->getConfData();
- if (isset($arrConfigData[$strTableName])) {
- $strFileName = $arrConfigData[$strTableName]['filename'];
- } else {
- $intReturn = 1;
- }
- // Get table times
- $arrTimeData = array();
- $arrTimeData['table'] = 'unknown';
- // Clear status cache
- clearstatcache();
- $intRetVal1 = $this->getDomainData('enable_common', $intEnableCommon);
- // Get last change of date table
- if ($intRetVal1 == 0) {
- $strSQLAdd = '';
- if ($intEnableCommon == 1) {
- $strSQLAdd = 'OR `domainId`=0';
- }
- $strSQL = 'SELECT `updateTime` FROM `tbl_tablestatus` '
- . 'WHERE (`domainId`=' .$this->intDomainId." $strSQLAdd) AND `tableName`='".$strTableName."' "
- . 'ORDER BY `updateTime` DESC LIMIT 1';
- $booReturn = $this->myDBClass->hasSingleDataset($strSQL, $arrDataset);
- if ($booReturn && isset($arrDataset['updateTime'])) {
- $arrTimeData['table'] = $arrDataset['updateTime'];
- } else {
- $strSQL = 'SELECT `last_modified` FROM `' .$strTableName. '` '
- . 'WHERE `config_id`=' .$this->intDomainId. ' ORDER BY `last_modified` DESC LIMIT 1';
- $booReturn = $this->myDBClass->hasSingleDataset($strSQL, $arrDataset);
- if (($booReturn == true) && isset($arrDataset['last_modified'])) {
- $arrTimeData['table'] = $arrDataset['last_modified'];
- }
- }
- }
- // Get config sets
- $arrConfigId = array();
- $strTarget = '';
- $strBaseDir = '';
- $intFileStampTemp = 0;
- $intRetVal2 = $this->getConfigSets($arrConfigId);
- if ($intRetVal2 == 0) {
- foreach ($arrConfigId as $intConfigId) {
- // Get configuration file data
- $this->getConfigData($intConfigId, 'target', $strTarget);
- $this->getConfigData($intConfigId, 'basedir', $strBaseDir);
- // Get time data
- $intReturn = $this->getFileDate(
- $intConfigId,
- $strFileName,
- $strBaseDir,
- $intFileStampTemp,
- $arrTimeData[$strTarget]
- );
- if ($intFileStampTemp != 0 && strtotime($arrTimeData['table']) > $intFileStampTemp) {
- $strCheckConfig = translate('Warning: configuration file is out of date!');
- }
- if ($arrTimeData[$strTarget] == 'unknown') {
- $strCheckConfig = translate('Warning: configuration file is out of date!');
- }
- }
- } else {
- $strCheckConfig = translate('Warning: no configuration target defined!');
- }
- return $intReturn;
- }
-
- /**
- * Writes a configuration file including all datasets of a configuration table or returns the output as a text
- * file for download. (Public master function)
- * @param string $strTableName Table name
- * @param int $intMode 0 = Write file to filesystem
- * 1 = Return Textfile for download test
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function createConfig($strTableName, $intMode = 0)
- {
- // Define Variables
- $intReturn = 0;
- // Do not create configs in common domain
- if ($this->intDomainId == 0) {
- $this->processClassMessage(translate('It is not possible to write config files directly from the common '
- . 'domain!'). '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- if ($intReturn == 0) {
- // Get configuration targets
- $this->getConfigSets($arrConfigID);
- if (($arrConfigID != 1) && \is_array($arrConfigID)) {
- foreach ($arrConfigID as $intConfigID) {
- $intReturn = $this->writeConfTemplate($intConfigID, $strTableName, $intMode);
- }
- } else {
- $this->processClassMessage(translate('Warning: no configuration target defined!').
- '::', $this->strErrorMessage);
- $intReturn = 1;
- }
+ if ($intReturn === 0) {
+ $this->myDataClass->writeLog(translate('Configuration successfully written:') . ' ' . $strFile);
+ $this->processClassMessage(translate('Configuration file successfully written!') .
+ '::', $this->strInfoMessage);
}
return $intReturn;
}
@@ -1050,51 +2439,54 @@ class NagConfigClass
/**
* Writes a configuration file including one single datasets of a configuration table or returns the output as
* a text file for download.
- * @param string $strTableName Table name
- * @param int $intDbId Data ID
- * @param int $intMode 0 = Write file to filesystem
- * 1 = Return Textfile for download test
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
+ * @param string $strTableName Table name
+ * @param int $intDbId Data ID
+ * @param int $intMode 0 = Write file to filesystem
+ * 1 = Return Textfile for download test
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
*/
- public function createConfigSingle($strTableName, $intDbId = 0, $intMode = 0)
+ public function createConfigSingle(string $strTableName, int $intDbId = 0, int $intMode = 0): int
{
- // Define Variables
- $arrData = array();
- $intDataCount = 0;
- $setEnableCommon = 0;
- $intReturn = 0;
- $strDomainWhere = ' (`config_id`=' .$this->intDomainId. ') ';
- // Read some settings and informations
- $this->getDomainData('enable_common', $setEnableCommon);
- // Variable rewritting
- if ($setEnableCommon != 0) {
+ /* Define variables */
+ $arrData = array();
+ $intDataCount = 0;
+ $setEnableCommon = 0;
+ $intReturn = 0;
+ $strDomainWhere = ' (`config_id`=' . $this->intDomainId . ') ';
+ /* Read some settings and information */
+ if ($this->getDomainData('enable_common', $strEnableCommon) === 0) {
+ $setEnableCommon = (int)$strEnableCommon;
+ }
+ /* Variable rewriting */
+ if ($setEnableCommon !== 0) {
$strDomainWhere = str_replace(')', ' OR `config_id`=0)', $strDomainWhere);
}
- // Do not create configs in common domain
- if ($this->intDomainId == 0) {
+ /* Do not create configs in common domain */
+ if ($this->intDomainId === 0) {
$this->processClassMessage(translate('It is not possible to write config files directly from the common '
- . 'domain!'). '::', $this->strErrorMessage);
+ . 'domain!') . '::', $this->strErrorMessage);
$intReturn = 1;
}
- if ($intReturn == 0) {
- if ($intDbId == 0) {
- $strSQL = 'SELECT * FROM `' .$strTableName."` WHERE $strDomainWhere AND `active`='1' ORDER BY `id`";
+ if ($intReturn === 0) {
+ if ($intDbId === 0) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTableName . "` WHERE $strDomainWhere AND `active`='1' ORDER BY `id`";
} else {
- $strSQL = 'SELECT * FROM `' .$strTableName."` WHERE $strDomainWhere AND `active`='1' AND `id`=$intDbId";
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTableName . "` WHERE $strDomainWhere AND `active`='1' AND `id`=$intDbId";
}
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if (($booReturn != false) && ($intDataCount != 0)) {
- /** @noinspection ForeachInvariantsInspection */
+ if (($booReturn !== false) && ($intDataCount !== 0)) {
for ($i = 0; $i < $intDataCount; $i++) {
- // Process form POST variable
- $strChbName = 'chbId_' .$arrData[$i]['id'];
- // Check if this POST variable exists or the data ID parameter matches
- if ((($intDbId != 0) && ($intDbId == $arrData[$i]['id'])) ||
+ /* Process form POST variable */
+ $strChbName = 'chbId_' . $arrData[$i]['id'];
+ /* Check if this POST variable exists or the data ID parameter matches */
+ if ((($intDbId !== 0) && ($intDbId === (int)$arrData[$i]['id'])) ||
(filter_input(INPUT_POST, $strChbName) !== null)) {
- // Get configuration targets
+ /* Get configuration targets */
$this->getConfigSets($arrConfigID);
- if (($arrConfigID != 1) && \is_array($arrConfigID)) {
+ if (($arrConfigID !== 1) && is_array($arrConfigID)) {
foreach ($arrConfigID as $intConfigID) {
$intReturn = $this->writeConfTemplate(
$intConfigID,
@@ -1105,7 +2497,7 @@ class NagConfigClass
);
}
} else {
- $this->processClassMessage(translate('Warning: no configuration target defined!').
+ $this->processClassMessage(translate('Warning: no configuration target defined!') .
'::', $this->strErrorMessage);
$intReturn = 1;
}
@@ -1115,1334 +2507,10 @@ class NagConfigClass
$this->myDataClass->writeLog(translate('Writing of the configuration failed - no dataset or not '
. 'activated dataset found'));
$this->processClassMessage(translate('Writing of the configuration failed - no dataset or not '
- . 'activated dataset found'). '::', $this->strErrorMessage);
+ . 'activated dataset found') . '::', $this->strErrorMessage);
$intReturn = 1;
}
}
return $intReturn;
}
-
-
- // PRIVATE functions
-
- /**
- * Determines the configuration data for each database table
- * @return array filename (configuration file name)
- * order_field (database order field)
- */
- public function getConfData()
- {
- $arrConfData['tbl_timeperiod'] = array('filename' => 'timeperiods.cfg',
- 'order_field' => 'timeperiod_name');
- $arrConfData['tbl_command'] = array('filename' => 'commands.cfg',
- 'order_field' => 'command_name');
- $arrConfData['tbl_contact'] = array('filename' => 'contacts.cfg',
- 'order_field' => 'contact_name');
- $arrConfData['tbl_contacttemplate'] = array('filename' => 'contacttemplates.cfg',
- 'order_field' => 'template_name');
- $arrConfData['tbl_contactgroup'] = array('filename' => 'contactgroups.cfg',
- 'order_field' => 'contactgroup_name');
- $arrConfData['tbl_hosttemplate'] = array('filename' => 'hosttemplates.cfg',
- 'order_field' => 'template_name');
- $arrConfData['tbl_servicetemplate'] = array('filename' => 'servicetemplates.cfg',
- 'order_field' => 'template_name');
- $arrConfData['tbl_hostgroup'] = array('filename' => 'hostgroups.cfg',
- 'order_field' => 'hostgroup_name');
- $arrConfData['tbl_servicegroup'] = array('filename' => 'servicegroups.cfg',
- 'order_field' => 'servicegroup_name');
- $arrConfData['tbl_hostdependency'] = array('filename' => 'hostdependencies.cfg',
- 'order_field' => 'dependent_host_name');
- $arrConfData['tbl_servicedependency'] = array('filename' => 'servicedependencies.cfg',
- 'order_field' => 'config_name');
- $arrConfData['tbl_hostescalation'] = array('filename' => 'hostescalations.cfg',
- 'order_field' => 'host_name`,`hostgroup_name');
- $arrConfData['tbl_serviceescalation'] = array('filename' => 'serviceescalations.cfg',
- 'order_field' => 'config_name');
- $arrConfData['tbl_hostextinfo'] = array('filename' => 'hostextinfo.cfg',
- 'order_field' => 'host_name');
- $arrConfData['tbl_serviceextinfo'] = array('filename' => 'serviceextinfo.cfg',
- 'order_field' => 'host_name');
- return $arrConfData;
- }
-
- /**
- * Writes a configuration file including all datasets of a configuration table or returns the output as a text
- * file for download. (Private worker function)
- * @param int $intConfigID Configuration target ID
- * @param string $strTableName Table name
- * @param int $intMode 0 = Write file to filesystem
- * 1 = Return Textfile for download test
- * @param array $arrTableData Dataset array for host and services only
- * @param int $intID Key for dataset array
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- /** @noinspection ArrayTypeOfParameterByDefaultValueInspection */
- private function writeConfTemplate($intConfigID, $strTableName, $intMode, $arrTableData = array(), $intID = 0)
- {
- // Variable definitions
- $strSQL = '';
- $strOrderField = '';
- $strFileString = '';
- $arrTplOptions = array('use_preg' => false);
- $strDomainWhere = ' (`config_id`=' . $this->intDomainId . ') ';
- $intType = 0;
- $intReturn = 0;
- // Read some settings and informations
- $this->getConfigData($intConfigID, 'utf8_decode', $setUTF8Decode);
- $this->getDomainData('enable_common', $setEnableCommon);
- $this->getConfigData($intConfigID, 'version', $intNagiosVersion);
- $arrConfigData = $this->getConfData();
- if (isset($arrConfigData[$strTableName])) {
- $strFileString = str_replace('.cfg', '', $arrConfigData[$strTableName]['filename']);
- $strOrderField = $arrConfigData[$strTableName]['order_field'];
- }
- // Variable rewritting
- if ($setEnableCommon != 0) {
- $strDomainWhere = str_replace(')', ' OR `config_id`=0)', $strDomainWhere);
- }
- // Special processing for table host and service
- $setTemplate = $strFileString. '.tpl.dat';
- if (($strTableName == 'tbl_host') || ($strTableName == 'tbl_service')) {
- // Define variable names based on table name
- switch ($strTableName) {
- case 'tbl_host':
- $strFileString = $arrTableData[$intID]['host_name'];
- $intDomainId = $arrTableData[$intID]['config_id'];
- $setTemplate = 'hosts.tpl.dat';
- $intType = 1;
- $strSQL = 'SELECT * FROM `' . $strTableName . "` WHERE `host_name`='$strFileString' "
- . "AND `active`='1' AND `config_id`=$intDomainId";
- break;
- case 'tbl_service':
- $strFileString = $arrTableData[$intID]['config_name'];
- $intDomainId = $arrTableData[$intID]['config_id'];
- $setTemplate = 'services.tpl.dat';
- $intType = 2;
- $strSQL = 'SELECT * FROM `' . $strTableName . "` WHERE `config_name`='$strFileString' "
- . "AND `active`='1' AND `config_id`=$intDomainId ORDER BY `service_description`";
- break;
- }
- } else {
- $strSQL = 'SELECT * FROM `' .$strTableName."` WHERE $strDomainWhere AND `active`='1' ".
- 'ORDER BY `' .$strOrderField. '`';
- }
- $strFile = $strFileString. '.cfg';
- // Load configuration template file
- $tplConf = new \HTML_Template_IT($this->arrSettings['path']['base_path']. '/templates/files/');
- $tplConf->loadTemplatefile($setTemplate, true, true);
- $tplConf->setOptions($arrTplOptions);
- $tplConf->setVariable('CREATE_DATE', date('Y-m-d H:i:s'));
- $tplConf->setVariable('NAGIOS_QL_VERSION', $this->arrSettings['db']['version']);
- $tplConf->setVariable('VERSION', $this->getVersionString($intConfigID));
- // Write data from configuration table
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn && ($intDataCount != 0) && ($strFileString != '')) {
- // Process every data set
- /** @noinspection ForeachInvariantsInspection */
- for ($i = 0; $i < $intDataCount; $i++) {
- $intDataId = 0;
- /** @noinspection ForeachSourceInspection */
- foreach ($arrData[$i] as $key => $value) {
- if ($key == 'id') {
- $intDataId = $value;
- }
- if ($key == 'config_name') {
- $key = '#NAGIOSQL_CONFIG_NAME';
- }
- // UTF8 decoded vaules
- if ($setUTF8Decode == 1) {
- $value = utf8_decode($value);
- }
- // Pass special fields (NagiosQL data fields not used by Nagios itselves)
- if ($this->skipEntries($strTableName, $intNagiosVersion, $key, $value) == 1) {
- continue;
- }
- // Get relation data
- $intSkip = $this->getRelationData($strTableName, $tplConf, $arrData[$i], $key, $value);
- // Rename field names
- $this->renameFields($strTableName, $intConfigID, $intDataId, $key, $value, $intSkip);
- // Inset data field
- if ($intSkip != 1) {
- // Insert fill spaces
- $strFillLen = (30- \strlen($key));
- $strSpace = ' ';
- for ($f = 0; $f < $strFillLen; $f++) {
- $strSpace .= ' ';
- }
- // Write key and value to template
- $tplConf->setVariable('ITEM_TITLE', $key.$strSpace);
- // Short values
- if (($intNagiosVersion != 3) || (\strlen($value) < 800)) {
- $tplConf->setVariable('ITEM_VALUE', $value);
- $tplConf->parse('configline');
- } else { // Long values
- $arrValueTemp = explode(',', $value);
- $strValueNew = '';
- $intArrCount = \count($arrValueTemp);
- $intCounter = 0;
- $strSpace = ' ';
- for ($f = 0; $f < 30; $f++) {
- $strSpace .= ' ';
- }
- foreach ($arrValueTemp as $elem) {
- if (\strlen($strValueNew) < 800) {
- $strValueNew .= $elem. ',';
- } else {
- if (substr($strValueNew, -1) == ',') {
- $strValueNew = substr($strValueNew, 0, -1);
- }
- if ($intCounter < $intArrCount) {
- $strValueNew .= ",\\";
- $tplConf->setVariable('ITEM_VALUE', $strValueNew);
- $tplConf->parse('configline');
- $tplConf->setVariable('ITEM_TITLE', $strSpace);
- } else {
- $tplConf->setVariable('ITEM_VALUE', $strValueNew);
- $tplConf->parse('configline');
- $tplConf->setVariable('ITEM_TITLE', $strSpace);
- }
- $strValueNew = $elem. ',';
- }
- $intCounter++;
- }
- if ($strValueNew != '') {
- if (substr($strValueNew, -1) == ',') {
- $strValueNew = substr($strValueNew, 0, -1);
- }
- $tplConf->setVariable('ITEM_VALUE', $strValueNew);
- $tplConf->parse('configline');
- }
- }
- }
- }
- // Special processing for time periods
- if ($strTableName == 'tbl_timeperiod') {
- $arrDataTime = array();
- $strSQLTime = 'SELECT `definition`, `range` '
- . 'FROM `tbl_timedefinition` WHERE `tipId` = ' .$arrData[$i]['id'];
- $booReturn = $this->myDBClass->hasDataArray($strSQLTime, $arrDataTime, $intDataCountTime);
- if ($booReturn && $intDataCountTime != 0) {
- foreach ($arrDataTime as $data) {
- // Skip other values than weekdays in nagios version below 3
- if ($intNagiosVersion < 3) {
- $arrWeekdays = array('monday','tuesday','wednesday','thursday','friday','saturday',
- 'sunday');
- if (!\in_array($data['definition'], $arrWeekdays, true)) {
- continue;
- }
- }
- // Insert fill spaces
- $strFillLen = (30- \strlen($data['definition']));
- $strSpace = ' ';
- for ($f = 0; $f < $strFillLen; $f++) {
- $strSpace .= ' ';
- }
- // Write key and value
- $tplConf->setVariable('ITEM_TITLE', $data['definition'].$strSpace);
- $tplConf->setVariable('ITEM_VALUE', $data['range']);
- $tplConf->parse('configline');
- }
- }
- }
- // Write configuration set
- $tplConf->parse('configset');
- }
- } elseif ($booReturn && ($intDataCount == 0) && ($strFileString != '')) {
- $this->processClassMessage(translate('Error while selecting data from database:')
- . '::', $this->strErrorMessage);
- $this->processClassMessage($this->myDBClass->strErrorMessage, $this->strErrorMessage);
- $intReturn = 1;
- } else {
- $this->myDataClass->writeLog(translate('Writing of the configuration failed - no dataset '
- . 'or not activated dataset found'));
- $this->processClassMessage(translate('Writing of the configuration failed - no dataset '
- . 'or not activated dataset found'). '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- if ($intMode == 0) {
- $intReturn = $this->getConfigFile($strFile, $intConfigID, $intType, $resCfgFile, $strCfgFile);
- if ($intReturn == 0) {
- $tplConf->parse();
- $strContent = $tplConf->get();
- $intReturn = $this->writeConfigFile(
- $strContent,
- $strFile,
- $intType,
- $intConfigID,
- $resCfgFile,
- $strCfgFile
- );
- }
- } elseif ($intMode == 1) {
- $tplConf->show();
- }
- return $intReturn;
- }
-
- /**
- * Get Nagios version string
- * @param int $intConfigID Configuration target ID
- * @return string Version string
- */
- private function getVersionString($intConfigID)
- {
- $arrVersion = array(
- 'Nagios 2.x config file',
- 'Nagios 2.9 config file',
- 'Nagios 3.x config file',
- 'Nagios 4.x config file'
- );
- $this->getConfigData($intConfigID, 'version', $intVersion);
- if (($intVersion >= 1) && ($intVersion <= \count($arrVersion))) {
- $strVersion = $arrVersion[$intVersion - 1];
- } else {
- $strVersion = '';
- }
- return $strVersion;
- }
-
- /**
- * Skip database values based on Nagios version
- * @param string $strTableName Table name
- * @param int $intVersionValue Nagios version value
- * @param string $key Data key
- * @param string $value Data value
- * @return int
- */
- private function skipEntries($strTableName, $intVersionValue, $key, &$value)
- {
- // Define variables
- $arrOption = array();
- $intReturn = 0;
- // Skip common fields
- $strSpecial = 'id,active,last_modified,access_rights,access_group,config_id,template,nodelete,command_type,';
- $strSpecial .= 'import_hash';
-
- // Skip fields of special tables
- if ($strTableName == 'tbl_hosttemplate') {
- $strSpecial .= ',parents_tploptions,hostgroups_tploptions,contacts_tploptions';
- $strSpecial .= ',contact_groups_tploptions,use_template_tploptions';
- }
- if ($strTableName == 'tbl_servicetemplate') {
- $strSpecial .= ',host_name_tploptions,hostgroup_name_tploptions,parents_tploptions,contacts_tploptions';
- $strSpecial .= ',servicegroups_tploptions,contact_groups_tploptions,use_template_tploptions';
- }
- if ($strTableName == 'tbl_contact') {
- $strSpecial .= ',use_template_tploptions,contactgroups_tploptions';
- $strSpecial .= ',host_notification_commands_tploptions,service_notification_commands_tploptions';
- }
- if ($strTableName == 'tbl_contacttemplate') {
- $strSpecial .= ',use_template_tploptions,contactgroups_tploptions';
- $strSpecial .= ',host_notification_commands_tploptions,service_notification_commands_tploptions';
- }
- if ($strTableName == 'tbl_host') {
- $strSpecial .= ',parents_tploptions,hostgroups_tploptions,contacts_tploptions';
- $strSpecial .= ',contact_groups_tploptions,use_template_tploptions';
- }
- if ($strTableName == 'tbl_service') {
- $strSpecial .= ',host_name_tploptions,hostgroup_name_tploptions,parents_tploptions';
- $strSpecial .= ',servicegroups_tploptions,contacts_tploptions,contact_groups_tploptions';
- $strSpecial .= ',use_template_tploptions';
- }
-
- // Pass fields based on nagios version lower than 3.x
- if ($intVersionValue < 3) {
- if ($strTableName == 'tbl_timeperiod') {
- $strSpecial .= ',use_template,exclude,name';
- }
- if (($strTableName == 'tbl_contact') || ($strTableName == 'tbl_contacttemplate')) {
- $strSpecial .= ',host_notifications_enabled,service_notifications_enabled,can_submit_commands';
- $strSpecial .= ',retain_status_information,retain_nonstatus_information';
- $arrOption['host_notification_options'] = ',s';
- $arrOption['service_notification_options'] = ',s';
- }
- if ($strTableName == 'tbl_contactgroup') {
- $strSpecial .= ',contactgroup_members';
- }
- if ($strTableName == 'tbl_hostgroup') {
- $strSpecial .= ',hostgroup_members,notes,notes_url,action_url';
- }
- if ($strTableName == 'tbl_servicegroup') {
- $strSpecial .= ',servicegroup_members,notes,notes_url,action_url';
- }
- if ($strTableName == 'tbl_hostdependency') {
- $strSpecial .= ',dependent_hostgroup_name,hostgroup_name,dependency_period';
- }
- if ($strTableName == 'tbl_hostescalation') {
- $strSpecial .= ',contacts';
- }
- if ($strTableName == 'tbl_servicedependency') {
- $strSpecial .= ',dependent_hostgroup_name,hostgroup_name,dependency_period,dependent_servicegroup_name';
- $strSpecial .= ',servicegroup_name';
- }
- if ($strTableName == 'tbl_serviceescalation') {
- $strSpecial .= ',hostgroup_name,contacts,servicegroup_name';
- }
- if (($strTableName == 'tbl_host') || ($strTableName == 'tbl_hosttemplate')) {
- $strSpecial .= ',initial_state,flap_detection_options,contacts,notes,notes_url,action_url';
- $strSpecial .= ',icon_image,icon_image_alt,vrml_image,statusmap_image,2d_coords,3d_coords';
- $arrOption['notification_options'] = ',s';
- }
- // Services
- if (($strTableName == 'tbl_service') || ($strTableName == 'tbl_servicetemplate')) {
- $strSpecial .= ',initial_state,flap_detection_options,contacts,notes,notes_url,action_url';
- $strSpecial .= ',icon_image,icon_image_alt';
- $arrOption['notification_options'] = ',s';
- }
- }
- // Pass fields based on nagios version higher than 2.x
- if ($intVersionValue > 2) {
- if ($strTableName == 'tbl_servicetemplate') {
- $strSpecial .= ',parallelize_check ';
- }
- if ($strTableName == 'tbl_service') {
- $strSpecial .= ',parallelize_check';
- }
- }
- // Pass fields based on nagios version lower than 4.x
- if ($intVersionValue < 4) {
- if (($strTableName == 'tbl_contact') || ($strTableName == 'tbl_contacttemplate')) {
- $strSpecial .= ',minimum_importance';
- }
- if ($strTableName == 'tbl_host') {
- $strSpecial .= ',importance';
- }
- if (($strTableName == 'tbl_service') || ($strTableName == 'tbl_servicetemplate')) {
- $strSpecial .= ',importance,parents';
- }
- }
- if ($intVersionValue == 1) {
- $strSpecial .= '';
- }
- // Reduce option values
- if (array_key_exists($key, $arrOption) && (\count($arrOption) != 0)) {
- $value = str_replace(array($arrOption[$key], str_replace(',', '', $arrOption[$key])), '', $value);
- if ($value == '') {
- $intReturn = 1;
- }
- }
- if ($intReturn == 0) {
- // Skip entries
- $arrSpecial = explode(',', $strSpecial);
- if (($value == '') || \in_array($key, $arrSpecial, true)) {
- $intReturn = 1;
- }
- }
- if ($intReturn == 0) {
- // Do not write config data (based on 'skip' option)
- $strNoTwo = 'active_checks_enabled,passive_checks_enabled,obsess_over_host,check_freshness,';
- $strNoTwo .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,';
- $strNoTwo .= 'retain_nonstatus_information,notifications_enabled,parallelize_check,is_volatile,';
- $strNoTwo .= 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
- $strNoTwo .= 'obsess_over_service';
- foreach (explode(',', $strNoTwo) as $elem) {
- if (($key == $elem) && ($value == '2')) {
- $intReturn = 1;
- }
- if (($intVersionValue < 3) && ($key == $elem) && ($value == '3')) {
- $intReturn = 1;
- }
- }
- }
- return $intReturn;
- }
-
- /**
- * Get related data
- * @param string $strTableName Table name
- * @param \HTML_Template_IT $resTemplate Template ressource
- * @param array $arrData Dataset array
- * @param string $strDataKey Data key
- * @param string $strDataValue Data value
- * @return int 0 = use data / 1 = skip data
- * Status message is stored in message class variables
- */
- private function getRelationData($strTableName, $resTemplate, $arrData, $strDataKey, &$strDataValue)
- {
- // Define Variables
- $intReturn = 0;
- $intSkipProc = 0;
- $arrRelations = array();
- // Pass function for tbl_command
- if ($strTableName == 'tbl_command') {
- $intSkipProc = 1;
- }
- // Get relation info and store the value in a class variable (speedup export)
- if (($intSkipProc == 0) && ($this->strRelTable != $strTableName)) {
- $intReturn = $this->myDataClass->tableRelations($strTableName, $arrRelations);
- $this->strRelTable = $strTableName;
- $this->arrRelData = $arrRelations;
- } elseif ($intSkipProc == 0) {
- $arrRelations = $this->arrRelData;
- $intReturn = 0;
- }
- if (($intSkipProc == 0) && (!\is_array($arrRelations)) && (\count($arrRelations) == 0)) {
- $intSkipProc = 1;
- $intReturn = 1;
- }
- if ($intSkipProc == 0) {
- // Common domain is enabled?
- $this->getDomainData('enable_common', $intCommonEnable);
- if ($intCommonEnable == 1) {
- $strDomainWhere1 = ' (`config_id`=' . $this->intDomainId . ' OR `config_id`=0) ';
- } else {
- $strDomainWhere1 = ' `config_id`=' . $this->intDomainId . ' ';
- }
- // Process relations
- foreach ($arrRelations as $elem) {
- if ($elem['fieldName'] == $strDataKey) {
- // Process normal 1:n relations (1 = only data / 2 = including a * value)
- if (($elem['type'] == 2) && (($strDataValue == 1) || ($strDataValue == 2))) {
- $intReturn = $this->processRelation1($arrData, $strDataValue, $elem, $strDomainWhere1);
- // Process normal 1:1 relations
- } elseif ($elem['type'] == 1) {
- $intReturn = $this->processRelation2($arrData, $strDataValue, $elem, $strDomainWhere1);
- // Process normal 1:n relations with special table and idSort (template tables)
- } elseif (($elem['type'] == 3) && ($strDataValue == 1)) {
- $intReturn = $this->processRelation3($arrData, $strDataValue, $elem, $strDomainWhere1);
- // Process special 1:n:str relations with string values (servicedependencies)
- } elseif (($elem['type'] == 6) && (($strDataValue == 1) || ($strDataValue == 2))) {
- $intReturn = $this->processRelation4($arrData, $strDataValue, $elem, $strDomainWhere1);
- // Process special relations for free variables
- } elseif (($elem['type'] == 4) && ($strDataValue == 1) && ($this->intNagVersion >= 3)) {
- $intReturn = $this->processRelation5($resTemplate, $arrData, $elem);
- // Process special relations for service groups
- } elseif (($elem['type'] == 5) && ($strDataValue == 1)) {
- $intReturn = $this->processRelation6($arrData, $strDataValue, $elem, $strDomainWhere1);
- // Process special relations for service parents
- } elseif (($elem['type'] == 7) && ($strDataValue == 1)) {
- $intReturn = $this->processRelation7($arrData, $strDataValue, $elem);
- // Process "*"
- } elseif ($strDataValue == 2) {
- $strDataValue = '*';
- } else {
- $intReturn = 1;
- }
- }
- }
- }
- return $intReturn;
- }
-
- /**
- * Rename field names
- * @param string $strTableName Table name
- * @param int $intConfigID Configuration target ID
- * @param int $intDataId Data ID
- * @param string $key Data key (by reference)
- * @param string $value Data value (by reference)
- * @param int $intSkip Skip value (by reference) 1 = skip / 0 = pass
- */
- private function renameFields($strTableName, $intConfigID, $intDataId, &$key, &$value, &$intSkip)
- {
- if ($this->intNagVersion == 0) {
- $this->getConfigData($intConfigID, 'version', $this->intNagVersion);
- }
- // Picture path
- if ($this->strPicPath == 'none') {
- $this->getConfigData($intConfigID, 'picturedir', $this->strPicPath);
- }
- if ($key == 'icon_image') {
- $value = $this->strPicPath.$value;
- }
- if ($key == 'vrml_image') {
- $value = $this->strPicPath.$value;
- }
- if ($key == 'statusmap_image') {
- $value = $this->strPicPath.$value;
- }
- // Tables
- if ($strTableName == 'tbl_host') {
- if ($key == 'use_template') {
- $key = 'use';
- }
- $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,';
- $strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,';
- $strVIValues .= 'retain_nonstatus_information,notifications_enabled';
- if (\in_array($key, explode(',', $strVIValues), true)) {
- if ($value == -1) {
- $value = 'null';
- }
- if ($value == 3) {
- $value = 'null';
- }
- }
- if ($key == 'parents') {
- $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_host', $intDataId, $intSkip);
- }
- if ($key == 'hostgroups') {
- $value = $this->checkTpl($value, 'hostgroups_tploptions', 'tbl_host', $intDataId, $intSkip);
- }
- if ($key == 'contacts') {
- $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_host', $intDataId, $intSkip);
- }
- if ($key == 'contact_groups') {
- $value = $this->checkTpl($value, 'contact_groups_tploptions', 'tbl_host', $intDataId, $intSkip);
- }
- if ($key == 'use') {
- $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_host', $intDataId, $intSkip);
- }
- if ($key == 'check_command') {
- $value = str_replace("\::bang::", "\!", $value);
- }
- if ($key == 'check_command') {
- $value = str_replace('::bang::', "\!", $value);
- }
- }
- if ($strTableName == 'tbl_service') {
- if ($key == 'use_template') {
- $key = 'use';
- }
- if ($this->intNagVersion < 2) {
- if ($key == 'check_interval') {
- $key = 'normal_check_interval';
- }
- if ($key == 'retry_interval') {
- $key = 'retry_check_interval';
- }
- }
- $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,';
- $strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,';
- $strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,';
- $strVIValues .= 'notifications_enabled';
- if (\in_array($key, explode(',', $strVIValues), true)) {
- if ($value == -1) {
- $value = 'null';
- }
- if ($value == 3) {
- $value = 'null';
- }
- }
- if ($key == 'host_name') {
- $value = $this->checkTpl($value, 'host_name_tploptions', 'tbl_service', $intDataId, $intSkip);
- }
- if ($key == 'hostgroup_name') {
- $value = $this->checkTpl($value, 'hostgroup_name_tploptions', 'tbl_service', $intDataId, $intSkip);
- }
- if ($key == 'parents') {
- $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_service', $intDataId, $intSkip);
- }
- if ($key == 'servicegroups') {
- $value = $this->checkTpl($value, 'servicegroups_tploptions', 'tbl_service', $intDataId, $intSkip);
- }
- if ($key == 'contacts') {
- $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_service', $intDataId, $intSkip);
- }
- if ($key == 'contact_groups') {
- $value = $this->checkTpl($value, 'contact_groups_tploptions', 'tbl_service', $intDataId, $intSkip);
- }
- if ($key == 'use') {
- $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_service', $intDataId, $intSkip);
- }
- if ($key == 'check_command') {
- $value = str_replace("\::bang::", "\!", $value);
- }
- if ($key == 'check_command') {
- $value = str_replace('::bang::', "\!", $value);
- }
- }
- if ($strTableName == 'tbl_hosttemplate') {
- if ($key == 'template_name') {
- $key = 'name';
- }
- if ($key == 'use_template') {
- $key = 'use';
- }
- $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,';
- $strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,';
- $strVIValues .= 'retain_nonstatus_information,notifications_enabled';
- if (\in_array($key, explode(',', $strVIValues), true)) {
- if ($value == -1) {
- $value = 'null';
- }
- if ($value == 3) {
- $value = 'null';
- }
- }
- if ($key == 'parents') {
- $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
- }
- if ($key == 'hostgroups') {
- $value = $this->checkTpl($value, 'hostgroups_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
- }
- if ($key == 'contacts') {
- $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
- }
- if ($key == 'contact_groups') {
- $value = $this->checkTpl($value, 'contact_groups_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
- }
- if ($key == 'use') {
- $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip);
- }
- }
- if ($strTableName == 'tbl_servicetemplate') {
- if ($key == 'template_name') {
- $key = 'name';
- }
- if ($key == 'use_template') {
- $key = 'use';
- }
- if ($this->intNagVersion < 2) {
- if ($key == 'check_interval') {
- $key = 'normal_check_interval';
- }
- if ($key == 'retry_interval') {
- $key = 'retry_check_interval';
- }
- }
- $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,';
- $strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,';
- $strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,';
- $strVIValues .= 'notifications_enabled';
- if (\in_array($key, explode(',', $strVIValues), true)) {
- if ($value == -1) {
- $value = 'null';
- }
- if ($value == 3) {
- $value = 'null';
- }
- }
- if ($key == 'host_name') {
- $value = $this->checkTpl($value, 'host_name_tploptions', 'tbl_servicetemplate', $intDataId, $intSkip);
- }
- if ($key == 'hostgroup_name') {
- $value = $this->checkTpl(
- $value,
- 'hostgroup_name_tploptions',
- 'tbl_servicetemplate',
- $intDataId,
- $intSkip
- );
- }
- if ($key == 'parents') {
- $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_servicetemplate', $intDataId, $intSkip);
- }
- if ($key == 'servicegroups') {
- $value = $this->checkTpl(
- $value,
- 'servicegroups_tploptions',
- 'tbl_servicetemplate',
- $intDataId,
- $intSkip
- );
- }
- if ($key == 'contacts') {
- $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_servicetemplate', $intDataId, $intSkip);
- }
- if ($key == 'contact_groups') {
- $value = $this->checkTpl(
- $value,
- 'contact_groups_tploptions',
- 'tbl_servicetemplate',
- $intDataId,
- $intSkip
- );
- }
- if ($key == 'use') {
- $value = $this->checkTpl(
- $value,
- 'use_template_tploptions',
- 'tbl_servicetemplate',
- $intDataId,
- $intSkip
- );
- }
- }
- if ($strTableName == 'tbl_contact') {
- if ($key == 'use_template') {
- $key = 'use';
- }
- $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
- $strVIValues .= 'retain_status_information,retain_nonstatus_information';
- if (\in_array($key, explode(',', $strVIValues), true)) {
- if ($value == -1) {
- $value = 'null';
- }
- if ($value == 3) {
- $value = 'null';
- }
- }
- if ($key == 'contactgroups') {
- $value = $this->checkTpl($value, 'contactgroups_tploptions', 'tbl_contact', $intDataId, $intSkip);
- }
- if ($key == 'host_notification_commands') {
- $value = $this->checkTpl(
- $value,
- 'host_notification_commands_tploptions',
- 'tbl_contact',
- $intDataId,
- $intSkip
- );
- }
- if ($key == 'service_notification_commands') {
- $value = $this->checkTpl(
- $value,
- 'service_notification_commands_tploptions',
- 'tbl_contact',
- $intDataId,
- $intSkip
- );
- }
- if ($key == 'use') {
- $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_contact', $intDataId, $intSkip);
- }
- }
- if ($strTableName == 'tbl_contacttemplate') {
- if ($key == 'template_name') {
- $key = 'name';
- }
- if ($key == 'use_template') {
- $key = 'use';
- }
- $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
- $strVIValues .= 'retain_status_information,retain_nonstatus_information';
- if (in_array($key, explode(',', $strVIValues), true)) {
- if ($value == -1) {
- $value = 'null';
- }
- if ($value == 3) {
- $value = 'null';
- }
- }
- if ($key == 'contactgroups') {
- $value = $this->checkTpl(
- $value,
- 'contactgroups_tploptions',
- 'tbl_contacttemplate',
- $intDataId,
- $intSkip
- );
- }
- if ($key == 'host_notification_commands') {
- $value = $this->checkTpl(
- $value,
- 'host_notification_commands_tploptions',
- 'tbl_contacttemplate',
- $intDataId,
- $intSkip
- );
- }
- if ($key == 'service_notification_commands') {
- $value = $this->checkTpl(
- $value,
- 'service_notification_commands_tploptions',
- 'tbl_contacttemplate',
- $intDataId,
- $intSkip
- );
- }
- if ($key == 'use') {
- $value = $this->checkTpl(
- $value,
- 'use_template_tploptions',
- 'tbl_contacttemplate',
- $intDataId,
- $intSkip
- );
- }
- }
- if ((($strTableName == 'tbl_hosttemplate') || ($strTableName == 'tbl_servicetemplate') ||
- ($strTableName == 'tbl_contacttemplate')) && $key == 'register') {
- $value = '0';
- }
- if ($strTableName == 'tbl_timeperiod' && $key == 'use_template') {
- $key = 'use';
- }
- }
-
- /**
- * Open configuration file
- * @param string $strFile File name
- * @param int $intConfigID Configuration ID
- * @param int $intType Type ID
- * @param resource|bool $resConfigFile Temporary or configuration file ressource (by reference)
- * @param string $strConfigFile Configuration file name (by reference)
- * @return int 0 = successful / 1 = error
- */
- private function getConfigFile($strFile, $intConfigID, $intType, &$resConfigFile, &$strConfigFile)
- {
- // Variable definitions
- $strBaseDir = '';
- $intMethod = 1;
- $intReturn = 0;
- // Get config data
- if ($intType == 1) {
- $this->getConfigData($intConfigID, 'hostconfig', $strBaseDir);
- $strType = 'host';
- } elseif ($intType == 2) {
- $this->getConfigData($intConfigID, 'serviceconfig', $strBaseDir);
- $strType = 'service';
- } else {
- $this->getConfigData($intConfigID, 'basedir', $strBaseDir);
- $strType = 'basic';
- }
- $this->getConfigData($intConfigID, 'method', $intMethod);
- // Backup config file
- $this->moveFile($strType, $strFile, $intConfigID);
- // Variable definition
- $strConfigFile = $strBaseDir. '/' .$strFile;
- // Local file system
- if ($intMethod == 1) {
- // Save configuration file
- if (is_writable($strConfigFile) || (!file_exists($strConfigFile) && is_writable($strBaseDir))) {
- $resConfigFile = fopen($strConfigFile, 'wb');
- chmod($strConfigFile, 0644);
- } else {
- $this->myDataClass->writeLog(translate('Configuration write failed:'). ' ' .$strFile);
- $this->processClassMessage(translate('Cannot open/overwrite the configuration file (check the '
- .'permissions)!'). '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- } elseif ($intMethod == 2) { // Remote file (FTP)
- // Check connection
- if (empty($this->resConnectId) || !\is_resource($this->resConnectId) ||
- ($this->resConnectType != 'FTP')) {
- $intReturn = $this->getFTPConnection($intConfigID);
- }
- if ($intReturn == 0) {
- // Open the config file
- if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) {
- $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql');
- } else {
- $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql');
- }
- $resConfigFile = fopen($strConfigFile, 'wb');
- }
- } elseif ($intMethod == 3) { // Remote file (SFTP)
- // Check connection
- if (empty($this->resConnectId) || !\is_resource($this->resConnectId) ||
- ($this->resConnectType != 'SSH')) {
- $intReturn = $this->getSSHConnection($intConfigID);
- }
- if ($intReturn == 0) {
- if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) {
- $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql');
- } else {
- $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql');
- }
- $resConfigFile = fopen($strConfigFile, 'wb');
- }
- }
- return $intReturn;
- }
-
- /**
- * Write configuration file
- * @param string $strData Data string
- * @param string $strFile File name
- * @param int $intType Type ID
- * @param int $intConfigID Configuration target ID
- * @param resource $resConfigFile Temporary or configuration file ressource
- * @param string $strConfigFile Configuration file name
- * @return int 0 = successful / 1 = error
- */
- private function writeConfigFile($strData, $strFile, $intType, $intConfigID, $resConfigFile, $strConfigFile)
- {
- // Variable definitions
- $intReturn = 0;
- // Get config data
- if ($intType == 1) {
- $this->getConfigData($intConfigID, 'hostconfig', $strBaseDir);
- } elseif ($intType == 2) {
- $this->getConfigData($intConfigID, 'serviceconfig', $strBaseDir);
- } else {
- $this->getConfigData($intConfigID, 'basedir', $strBaseDir);
- }
- $this->getConfigData($intConfigID, 'method', $intMethod);
- $strData = str_replace("\r\n", "\n", $strData);
- fwrite($resConfigFile, $strData);
- // Local filesystem
- if ($intMethod == 1) {
- fclose($resConfigFile);
- } elseif ($intMethod == 2) { // FTP access
- // SSH Possible
- if (!\function_exists('ftp_put')) {
- $this->processClassMessage(translate('FTP module not loaded!'). '::', $this->strErrorMessage);
- $intReturn = 1;
- } else {
- $intErrorReporting = error_reporting();
- error_reporting(0);
- if (!ftp_put($this->resConnectId, $strBaseDir . '/' . $strFile, $strConfigFile, FTP_ASCII)) {
- $arrError = error_get_last();
- error_reporting($intErrorReporting);
- $this->processClassMessage(translate('Cannot open/overwrite the configuration file (FTP connection '
- .'failed)!') . '::', $this->strErrorMessage);
- if ($arrError['message'] != '') {
- $this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage);
- }
- $intReturn = 1;
- }
- error_reporting($intErrorReporting);
- ftp_close($this->resConnectId);
- fclose($resConfigFile);
- }
- } elseif ($intMethod == 3) { // SSH access
- // SSH Possible
- if (!\function_exists('ssh2_scp_send')) {
- $this->processClassMessage(translate('SSH module not loaded!'). '::', $this->strErrorMessage);
- $intReturn = 1;
- } else {
- $intErrorReporting = error_reporting();
- error_reporting(0);
- if (!ssh2_scp_send($this->resConnectId, $strConfigFile, $strBaseDir . '/' . $strFile, 0644)) {
- $arrError = error_get_last();
- error_reporting($intErrorReporting);
- $this->processClassMessage(translate('Cannot open/overwrite the configuration file (remote SFTP)!').
- '::', $this->strErrorMessage);
- if ($arrError['message'] != '') {
- $this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage);
- }
- $this->resConnectId = null;
- $intReturn = 1;
- }
- error_reporting($intErrorReporting);
- fclose($resConfigFile);
- unlink($strConfigFile);
- $this->resConnectId = null;
- }
- }
- if ($intReturn == 0) {
- $this->myDataClass->writeLog(translate('Configuration successfully written:') . ' ' . $strFile);
- $this->processClassMessage(translate('Configuration file successfully written!').
- '::', $this->strInfoMessage);
- }
- return $intReturn;
- }
-
- /**
- * Process special settings based on template option
- * @param string $strValue Original data value
- * @param string $strKeyField Template option field name
- * @param string $strTable Table name
- * @param int $intId Dataset ID
- * @param int $intSkip Skip value (by reference)
- * @return string Manipulated data value
- */
- public function checkTpl($strValue, $strKeyField, $strTable, $intId, &$intSkip)
- {
- if ($this->intNagVersion < 3) {
- return $strValue;
- }
- $strSQL = 'SELECT `' .$strKeyField. '` FROM `' .$strTable."` WHERE `id` = $intId";
- $intValue = $this->myDBClass->getFieldData($strSQL);
- if ($intValue == 0) {
- return('+' .$strValue);
- }
- if ($intValue == 1) {
- $intSkip = 0;
- return 'null';
- }
- return $strValue;
- }
-
- /**
- * @param array $arrData Dataset array
- * @param string $strDataValue Data value
- * @param array $elem Relation data array
- * @param string $strDomainWhere1 SQL WHERE add-in
- * @return int 0 = use data / 1 = skip data
- */
- private function processRelation1($arrData, &$strDataValue, $elem, $strDomainWhere1)
- {
- // Define variables
- $arrDataRel = array();
- $intDataCountRel = 0;
- $intReturn = 0;
- // Get relation data
- $strSQLRel = 'SELECT `' . $elem['tableName1'] . '`.`' . $elem['target1'] . '`, `' . $elem['linkTable'] .
- '`.`exclude` FROM `' . $elem['linkTable'] . '` LEFT JOIN `' . $elem['tableName1'] .
- '` ON `' . $elem['linkTable'] . '`.`idSlave` = `' . $elem['tableName1'] . '`.`id`' .
- 'WHERE `idMaster`=' . $arrData['id'] . " AND `active`='1' AND $strDomainWhere1" .
- 'ORDER BY `' . $elem['tableName1'] . '`.`' . $elem['target1'] . '`';
- $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
- if ($booReturn && ($intDataCountRel != 0)) {
- // Rewrite $strDataValue with returned relation data
- if ($strDataValue == 2) {
- $strDataValue = '*,';
- } else {
- $strDataValue = '';
- }
- foreach ($arrDataRel as $data) {
- if ($data['exclude'] == 0) {
- $strDataValue .= $data[$elem['target1']] . ',';
- } elseif ($this->intNagVersion >= 3) {
- $strDataValue .= '!' . $data[$elem['target1']] . ',';
- }
- }
- $strDataValue = substr($strDataValue, 0, -1);
- if ($strDataValue == '') {
- $intReturn = 1;
- }
- } else {
- if ($strDataValue == 2) {
- $strDataValue = '*';
- } else {
- $intReturn = 1;
- }
- }
- return $intReturn;
- }
-
- /**
- * @param array $arrData Dataset array
- * @param string $strDataValue Data value
- * @param array $elem Relation data array
- * @param string $strDomainWhere1 SQL WHERE add-in
- * @return int 0 = use data / 1 = skip data
- */
- private function processRelation2($arrData, &$strDataValue, $elem, $strDomainWhere1)
- {
- // Define variables
- $arrDataRel = array();
- $arrField = array();
- $intDataCountRel = 0;
- $intReturn = 0;
- $strCommand = '';
- // Get relation data
- if (($elem['tableName1'] == 'tbl_command') &&
- (substr_count($arrData[$elem['fieldName']], '!') != 0)) {
- $arrField = explode('!', $arrData[$elem['fieldName']]);
- $strCommand = strstr($arrData[$elem['fieldName']], '!');
- $strSQLRel = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '`' .
- 'WHERE `id`=' . $arrField[0] . " AND `active`='1' AND $strDomainWhere1";
- } else {
- $strSQLRel = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '`' .
- 'WHERE `id`=' . $arrData[$elem['fieldName']] . " AND `active`='1' AND $strDomainWhere1";
- }
- $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
- if ($booReturn && ($intDataCountRel != 0)) {
- // Rewrite $strDataValue with returned relation data
- if (($elem['tableName1'] == 'tbl_command') && (substr_count($strDataValue, '!') != 0)) {
- $strDataValue = $arrDataRel[0][$elem['target1']] . $strCommand;
- } else {
- $strDataValue = $arrDataRel[0][$elem['target1']];
- }
- } else {
- if (($elem['tableName1'] == 'tbl_command') && (substr_count($strDataValue, '!') != 0) &&
- ($arrField[0] == -1)) {
- $strDataValue = 'null';
- } else {
- $intReturn = 1;
- }
- }
- return $intReturn;
- }
-
- /**
- * @param array $arrData Dataset array
- * @param string $strDataValue Data value
- * @param array $elem Relation data array
- * @param string $strDomainWhere1 SQL WHERE add-in
- * @return int 0 = use data / 1 = skip data
- */
- private function processRelation3($arrData, &$strDataValue, $elem, $strDomainWhere1)
- {
- // Define variables
- $arrDataRel = array();
- $intDataCountRel = 0;
- $intReturn = 0;
- // Get relation data
- $strSQLRel = 'SELECT * FROM `' .$elem['linkTable']. '` WHERE `idMaster`=' .$arrData['id']. ' ORDER BY idSort';
- $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
- if ($booReturn && ($intDataCountRel != 0)) {
- // Rewrite $strDataValue with returned relation data
- $strDataValue = '';
- foreach ($arrDataRel as $data) {
- if ($data['idTable'] == 1) {
- $strSQLName = 'SELECT `' .$elem['target1']. '` FROM `' .$elem['tableName1']. '`' .
- "WHERE `active`='1' AND $strDomainWhere1 AND `id`=".$data['idSlave'];
- } else {
- $strSQLName = 'SELECT `' .$elem['target2']. '` FROM `' .$elem['tableName2']. '`' .
- "WHERE `active`='1' AND $strDomainWhere1 AND `id`=".$data['idSlave'];
- }
- $strDataValue .= $this->myDBClass->getFieldData($strSQLName) . ',';
- }
- $strDataValue = substr($strDataValue, 0, -1);
- } else {
- $intReturn = 1;
- }
- return $intReturn;
- }
-
- /**
- * @param array $arrData Dataset array
- * @param string $strDataValue Data value
- * @param array $elem Relation data array
- * @param string $strDomainWhere1 SQL WHERE add-in
- * @return int 0 = use data / 1 = skip data
- */
- private function processRelation4($arrData, &$strDataValue, $elem, $strDomainWhere1)
- {
- // Define variables
- $arrDataRel = array();
- $intDataCountRel = 0;
- $intReturn = 0;
- // Get relation data
- $strSQLRel = 'SELECT `' .$elem['linkTable']. '`.`strSlave`, `' .$elem['linkTable']. '`.`exclude` ' .
- 'FROM `' .$elem['linkTable']. '` ' .
- 'LEFT JOIN `tbl_service` ON `' .$elem['linkTable']. '`.`idSlave`=`tbl_service`.`id` ' .
- 'WHERE `' .$elem['linkTable']. '`.`idMaster`=' .$arrData['id']." AND `active`='1' AND ".
- $strDomainWhere1. ' ' .
- 'ORDER BY `' .$elem['linkTable']. '`.`strSlave`';
- $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
- if ($booReturn && ($intDataCountRel != 0)) {
- // Rewrite $strDataValue with returned relation data
- if ($strDataValue == 2) {
- $strDataValue = '*,';
- } else {
- $strDataValue = '';
- }
- foreach ($arrDataRel as $data) {
- if ($data['exclude'] == 0) {
- $strDataValue .= $data['strSlave'] . ',';
- } elseif ($this->intNagVersion >= 3) {
- $strDataValue .= '!' . $data['strSlave'] . ',';
- }
- }
- $strDataValue = substr($strDataValue, 0, -1);
- if ($strDataValue == '') {
- $intReturn = 1;
- }
- } else {
- if ($strDataValue == 2) {
- $strDataValue = '*';
- } else {
- $intReturn = 1;
- }
- }
- return $intReturn;
- }
-
- /**
- * @param \HTML_Template_IT $resTemplate Template object
- * @param array $arrData Dataset array
- * @param array $elem Relation data array
- * @return int 0 = use data / 1 = skip data
- */
- private function processRelation5($resTemplate, $arrData, $elem)
- {
- // Define variables
- $arrDataRel = array();
- $intDataCountRel = 0;
- $strSQLRel = 'SELECT * FROM `tbl_variabledefinition` LEFT JOIN `' .$elem['linkTable']. '` ' .
- 'ON `id`=`idSlave` WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `name`';
- $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel);
- if ($booReturn && ($intDataCountRel != 0)) {
- foreach ($arrDataRel as $vardata) {
- // Insert fill spaces
- $strFillLen = (30 - \strlen($vardata['name']));
- $strSpace = ' ';
- for ($f = 0; $f < $strFillLen; $f++) {
- $strSpace .= ' ';
- }
- $resTemplate->setVariable('ITEM_TITLE', $vardata['name'] . $strSpace);
- $resTemplate->setVariable('ITEM_VALUE', $vardata['value']);
- $resTemplate->parse('configline');
- }
- }
- return 1;
- }
-
- /**
- * @param array $arrData Dataset array
- * @param string $strDataValue Data value
- * @param array $elem Relation data array
- * @param string $strDomainWhere1 SQL WHERE add-in
- * @return int 0 = use data / 1 = skip data
- */
- private function processRelation6($arrData, &$strDataValue, $elem, $strDomainWhere1)
- {
- // Define variables
- $arrDataRel = array();
- $arrHG1 = array();
- $arrHG2 = array();
- $intDataCountRel = 0;
- $intHG1 = 0;
- $intHG2 = 0;
- $intReturn = 0;
- // Get relation data
- $strSQLMaster = 'SELECT * FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData['id'];
- $booReturn = $this->myDBClass->hasDataArray($strSQLMaster, $arrDataRel, $intDataCountRel);
- if ($booReturn && ($intDataCountRel != 0)) {
- // Rewrite $strDataValue with returned relation data
- $strDataValue = '';
- foreach ($arrDataRel as $data) {
- if ($data['idSlaveHG'] != 0) {
- $strSQLSrv = 'SELECT `' . $elem['target2'] . '` FROM `' . $elem['tableName2'] .
- '` WHERE `id`=' . $data['idSlaveS'];
- $strService = $this->myDBClass->getFieldData($strSQLSrv);
- $strSQLHG1 = 'SELECT `host_name` FROM `tbl_host` ' .
- 'LEFT JOIN `tbl_lnkHostgroupToHost` ON `id`=`idSlave` ' .
- 'WHERE `idMaster`=' . $data['idSlaveHG'] . " AND `active`='1' AND $strDomainWhere1";
- $booReturn = $this->myDBClass->hasDataArray($strSQLHG1, $arrHG1, $intHG1);
- if ($booReturn && ($intHG1 != 0)) {
- foreach ($arrHG1 as $elemHG1) {
- if (substr_count($strDataValue, $elemHG1['host_name'] . ',' . $strService) == 0) {
- $strDataValue .= $elemHG1['host_name'] . ',' . $strService . ',';
- }
- }
- }
- $strSQLHG2 = 'SELECT `host_name` FROM `tbl_host` ' .
- 'LEFT JOIN `tbl_lnkHostToHostgroup` ON `id`=`idMaster` ' .
- 'WHERE `idSlave`=' . $data['idSlaveHG'] . " AND `active`='1' AND $strDomainWhere1";
- $booReturn = $this->myDBClass->hasDataArray($strSQLHG2, $arrHG2, $intHG2);
- if ($booReturn && ($intHG2 != 0)) {
- foreach ($arrHG2 as $elemHG2) {
- if (substr_count($strDataValue, $elemHG2['host_name'] . ',' . $strService) == 0) {
- $strDataValue .= $elemHG2['host_name'] . ',' . $strService . ',';
- }
- }
- }
- } else {
- $strSQLHost = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '` ' .
- 'WHERE `id`=' . $data['idSlaveH'] . " AND `active`='1' AND $strDomainWhere1";
- $strHost = $this->myDBClass->getFieldData($strSQLHost);
- $strSQLSrv = 'SELECT `' . $elem['target2'] . '` FROM `' . $elem['tableName2'] . '` ' .
- 'WHERE `id`=' . $data['idSlaveS'] . " AND `active`='1' AND $strDomainWhere1";
- $strService = $this->myDBClass->getFieldData($strSQLSrv);
- if (($strHost != '') && ($strService != '') &&
- substr_count($strDataValue, $strHost . ',' . $strService) == 0) {
- $strDataValue .= $strHost . ',' . $strService . ',';
- }
- }
- }
- $strDataValue = substr($strDataValue, 0, -1);
- if ($strDataValue == '') {
- $intReturn = 1;
- }
- } else {
- $intReturn = 1;
- }
- return $intReturn;
- }
-
- /**
- * @param array $arrData Dataset array
- * @param string $strDataValue Data value
- * @param array $elem Relation data array
- * @return int 0 = use data / 1 = skip data
- */
- private function processRelation7($arrData, &$strDataValue, $elem)
- {
- $intReturn = 1;
- // Get relation data
- $strSQLMaster = 'SELECT * FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData['id'];
- $booReturn = $this->myDBClass->hasDataArray($strSQLMaster, $arrDataRel, $intDataCountRel);
- if ($booReturn && ($intDataCountRel != 0)) {
- // Rewrite $strDataValue with returned relation data
- $strDataValue = '';
- /** @var array $arrDataRel */
- foreach ($arrDataRel as $data) {
- $strSQL = 'SELECT host_name FROM tbl_host WHERE id=' .$data['idHost'];
- $strHost = $this->myDBClass->getFieldData($strSQL);
- $strSQL = 'SELECT service_description FROM tbl_service WHERE id=' .$data['idSlave'];
- $strService = $this->myDBClass->getFieldData($strSQL);
- $strDataValue .= $strHost . ',' . $strService . ',';
- $intReturn = 0;
- }
- $strDataValue = substr($strDataValue, 0, -1);
- }
- return $intReturn;
- }
-}
+}
\ No newline at end of file
diff --git a/functions/NagContentClass.php b/functions/NagContentClass.php
index bd57d43..a35ae9f 100644
--- a/functions/NagContentClass.php
+++ b/functions/NagContentClass.php
@@ -1,90 +1,84 @@
arrSettings = $arrSession['SETS'];
}
if (isset($arrSession['domain'])) {
- $this->intDomainId = $arrSession['domain'];
+ $this->intDomainId = (int)$arrSession['domain'];
}
- $this->arrSession = $arrSession;
+ $this->arrSession = $arrSession;
}
/**
* Data list view - form initialization
- * @param \HTML_Template_IT $objTemplate Form template object
+ * @param HTML_Template_IT $objTemplate Form template object
*/
- public function listViewInit($objTemplate)
+ public function listViewInit(HTML_Template_IT $objTemplate): void
{
- // Language text replacements from fieldvars.php file
+ /* Language text replacements from fieldvars.php file */
foreach ($this->arrDescription as $elem) {
$objTemplate->setVariable($elem['name'], $elem['string']);
}
- // Some single replacements
+ /* Some single replacements */
$objTemplate->setVariable('LIMIT', $this->intLimit);
- $objTemplate->setVariable('ACTION_MODIFY', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING));
+ $objTemplate->setVariable('ACTION_MODIFY', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_UNSAFE_RAW));
$objTemplate->setVariable('TABLE_NAME', $this->strTableName);
if (isset($this->arrSession['search'][$this->strSearchSession])) {
$objTemplate->setVariable('DAT_SEARCH', $this->arrSession['search'][$this->strSearchSession]);
@@ -95,41 +89,42 @@ class NagContentClass
/**
* Data list view - value insertions
- * @param \HTML_Template_IT $objTemplate Form template object
- * @param array $arrData Database values
- * @param int $intDLCount1 Total count of data lines for one page
- * @param int $intDLCount2 Total count of data lines (all data)
- * @param string $strField1 Field name for data field 1
- * @param string $strField2 Field name for data field 2
- * @param int $intLimit Actual data char limit for field 2
+ * @param HTML_Template_IT $objTemplate Form template object
+ * @param array $arrData Database values
+ * @param int $intDLCount1 Total count of data lines for one page
+ * @param int $intDLCount2 Total count of data lines (all data)
+ * @param string $strField1 Fieldname for data field 1
+ * @param string $strField2 Fieldname for data field 2
+ * @param int $intLimit Actual data char limit for field 2
*/
public function listData(
- $objTemplate,
- $arrData,
- $intDLCount1,
- $intDLCount2,
- $strField1,
- $strField2,
- $intLimit = 0
- ) {
- // Template block names
+ HTML_Template_IT $objTemplate,
+ array $arrData,
+ int $intDLCount1,
+ int $intDLCount2,
+ string $strField1,
+ string $strField2,
+ int $intLimit = 0
+ ): void
+ {
+ /* Template block names */
$strTplPart = 'datatable';
- $strTplRow = 'datarow';
- if ($this->strTableName == 'tbl_host') {
+ $strTplRow = 'datarow';
+ if ($this->strTableName === 'tbl_host') {
$strTplPart = 'datatablehost';
- $strTplRow = 'datarowhost';
+ $strTplRow = 'datarowhost';
}
- if ($this->strTableName == 'tbl_service') {
+ if ($this->strTableName === 'tbl_service') {
$strTplPart = 'datatableservice';
- $strTplRow = 'datarowservice';
+ $strTplRow = 'datarowservice';
}
- if (($this->strTableName == 'tbl_user') || ($this->strTableName == 'tbl_group') ||
- ($this->strTableName == 'tbl_datadomain') || ($this->strTableName == 'tbl_configtarget')) {
+ if (($this->strTableName === 'tbl_user') || ($this->strTableName === 'tbl_group') ||
+ ($this->strTableName === 'tbl_datadomain') || ($this->strTableName === 'tbl_configtarget')) {
$strTplPart = 'datatablecommon';
- $strTplRow = 'datarowcommon';
+ $strTplRow = 'datarowcommon';
}
- // Some single replacements
- $objTemplate->setVariable('IMAGE_PATH_HEAD', $this->arrSettings['path']['base_url']. 'images/');
+ /* Some single replacements */
+ $objTemplate->setVariable('IMAGE_PATH_HEAD', $this->arrSettings['path']['base_url'] . 'images/');
$objTemplate->setVariable('CELLCLASS_L', 'tdlb');
$objTemplate->setVariable('CELLCLASS_M', 'tdmb');
$objTemplate->setVariable('DISABLED', 'disabled');
@@ -141,13 +136,13 @@ class NagContentClass
$objTemplate->setVariable('PICTURE_CLASS', 'elementHide');
$objTemplate->setVariable('DOMAIN_SPECIAL', ' ');
$objTemplate->setVariable('SORT_BY', $this->intSortBy);
- // Inserting data values
- if ($intDLCount1 != 0) {
+ /* Inserting data values */
+ if ($intDLCount1 !== 0) {
$intMinID = 0;
$intMaxID = 0;
- for ($i=0; $i<$intDLCount1; $i++) {
- // Get biggest and smalest value
- if ($i == 0) {
+ for ($i = 0; $i < $intDLCount1; $i++) {
+ /* Get biggest and smalest value */
+ if ($i === 0) {
$intMinID = $arrData[$i]['id'];
$intMaxID = $arrData[$i]['id'];
}
@@ -159,27 +154,27 @@ class NagContentClass
}
$objTemplate->setVariable('MAX_ID', $intMaxID);
$objTemplate->setVariable('MIN_ID', $intMinID);
- // Line colours
+ /* Line colours */
$strClassL = 'tdld';
$strClassM = 'tdmd';
- if ($i%2 == 1) {
+ if ($i % 2 === 1) {
$strClassL = 'tdlb';
$strClassM = 'tdmb';
}
- if (isset($arrData[$i]['register']) && ($arrData[$i]['register'] == 0)) {
+ if (isset($arrData[$i]['register']) && ((int)$arrData[$i]['register'] === 0)) {
$strRegister = translate('No');
} else {
$strRegister = translate('Yes');
}
- if ($arrData[$i]['active'] == 0) {
- $strActive = translate('No');
+ if ((int)$arrData[$i]['active'] === 0) {
+ $strActive = translate('No');
} else {
- $strActive = translate('Yes');
+ $strActive = translate('Yes');
}
- // Get file date for hosts and services
+ /* Get file date for hosts and services */
$intTimeInfo = 0;
$arrTimeData = array();
- if ($this->strTableName == 'tbl_host') {
+ if ($this->strTableName === 'tbl_host') {
$intReturn = $this->myConfigClass->lastModifiedDir(
$this->strTableName,
$arrData[$i]['host_name'],
@@ -187,11 +182,11 @@ class NagContentClass
$arrTimeData,
$intTimeInfo
);
- if ($intReturn == 1) {
+ if ($intReturn === 1) {
$this->strErrorMessage = $this->myConfigClass->strErrorMessage;
}
}
- if ($this->strTableName == 'tbl_service') {
+ if ($this->strTableName === 'tbl_service') {
$intReturn = $this->myConfigClass->lastModifiedDir(
$this->strTableName,
$arrData[$i]['config_name'],
@@ -199,16 +194,16 @@ class NagContentClass
$arrTimeData,
$intTimeInfo
);
- if ($intReturn == 1) {
+ if ($intReturn === 1) {
$this->strErrorMessage = $this->myConfigClass->strErrorMessage;
}
}
- // Set datafields
+ /* Set datafields */
foreach ($this->arrDescription as $elem) {
$objTemplate->setVariable($elem['name'], $elem['string']);
}
- if ($arrData[$i][$strField1] == '') {
- $arrData[$i][$strField1] = 'NOT DEFINED - ' .$arrData[$i]['id'];
+ if ((string)$arrData[$i][$strField1] === '') {
+ $arrData[$i][$strField1] = 'NOT DEFINED - ' . $arrData[$i]['id'];
}
$objTemplate->setVariable('DATA_FIELD_1', htmlentities($arrData[$i][$strField1], ENT_COMPAT, 'UTF-8'));
$objTemplate->setVariable('DATA_FIELD_1S', addslashes(htmlentities(
@@ -216,7 +211,7 @@ class NagContentClass
ENT_COMPAT,
'UTF-8'
)));
- if ($strField2 == 'process_field') {
+ if ($strField2 === 'process_field') {
$arrData[$i]['process_field'] = $this->processField($arrData[$i], $this->strTableName);
} else {
$objTemplate->setVariable('DATA_FIELD_2S', addslashes(htmlentities(
@@ -225,8 +220,8 @@ class NagContentClass
'UTF-8'
)));
}
- if ($intLimit != 0) {
- if (\strlen($arrData[$i][$strField2]) > $intLimit) {
+ if ($intLimit !== 0) {
+ if (strlen($arrData[$i][$strField2]) > $intLimit) {
$strAdd = ' ...';
} else {
$strAdd = '';
@@ -235,7 +230,7 @@ class NagContentClass
$arrData[$i][$strField2],
0,
$intLimit
- ), ENT_COMPAT, 'UTF-8').$strAdd);
+ ), ENT_COMPAT, 'UTF-8') . $strAdd);
} else {
$objTemplate->setVariable('DATA_FIELD_2', htmlentities(
$arrData[$i][$strField2],
@@ -244,130 +239,256 @@ class NagContentClass
));
}
$objTemplate->setVariable('DATA_REGISTERED', $strRegister);
- if (substr_count($this->strTableName, 'template') != 0) {
+ if (substr_count($this->strTableName, 'template') !== 0) {
$objTemplate->setVariable('DATA_REGISTERED', '-');
}
$objTemplate->setVariable('DATA_ACTIVE', $strActive);
- $objTemplate->setVariable('DATA_FILE', ''.translate('out-of-date').'');
- if ($intTimeInfo == 4) {
+ $objTemplate->setVariable('DATA_FILE', '' . translate('out-of-date') . '');
+ if ($intTimeInfo === 4) {
$objTemplate->setVariable('DATA_FILE', translate('no target'));
}
- if ($intTimeInfo == 3) {
- $objTemplate->setVariable('DATA_FILE', ''.translate('missed').'');
+ if ($intTimeInfo === 3) {
+ $objTemplate->setVariable('DATA_FILE', '' . translate('missed') . '');
}
- if ($intTimeInfo == 2) {
- $objTemplate->setVariable('DATA_FILE', ''.translate('missed').'');
+ if ($intTimeInfo === 2) {
+ $objTemplate->setVariable('DATA_FILE', '' . translate('missed') . '');
}
- if ($intTimeInfo == 0) {
+ if ($intTimeInfo === 0) {
$objTemplate->setVariable('DATA_FILE', translate('up-to-date'));
}
$objTemplate->setVariable('LINE_ID', $arrData[$i]['id']);
$objTemplate->setVariable('CELLCLASS_L', $strClassL);
$objTemplate->setVariable('CELLCLASS_M', $strClassM);
- $objTemplate->setVariable('IMAGE_PATH', $this->arrSettings['path']['base_url']. 'images/');
+ $objTemplate->setVariable('IMAGE_PATH', $this->arrSettings['path']['base_url'] . 'images/');
$objTemplate->setVariable('PICTURE_CLASS', 'elementShow');
- $objTemplate->setVariable('DOMAIN_SPECIAL', '');
- $objTemplate->setVariable('DISABLED', '');
- // Disable common domain objects
+ $objTemplate->setVariable('DOMAIN_SPECIAL');
+ $objTemplate->setVariable('DISABLED');
+ /* Disable common domain objects */
if (isset($arrData[$i]['config_id'])) {
- if ($arrData[$i]['config_id'] != $this->intDomainId) {
+ if ((int)$arrData[$i]['config_id'] !== $this->intDomainId) {
$objTemplate->setVariable('PICTURE_CLASS', 'elementHide');
$objTemplate->setVariable('DOMAIN_SPECIAL', ' [common]');
$objTemplate->setVariable('DISABLED', 'disabled');
- } else {
- // Inactive items should not be written/downloaded
- if ($arrData[$i]['active'] == 0) {
- $objTemplate->setVariable('ACTIVE_CONTROL', 'elementHide');
- }
+ } else if ((int)$arrData[$i]['active'] === 0) {
+ $objTemplate->setVariable('ACTIVE_CONTROL', 'elementHide');
}
}
- // Check access rights for list objects
+ /* Check access rights for list objects */
if (isset($arrData[$i]['access_group'])) {
- if ($this->myVisClass->checkAccountGroup($arrData[$i]['access_group'], 'write') != 0) {
- $objTemplate->setVariable('LINE_CONTROL', 'elementHide');
- }
- } else {
- if ($this->intGlobalWriteAccess != 0) {
+ if ($this->myVisClass->checkAccountGroup($arrData[$i]['access_group'], 'write') !== 0) {
$objTemplate->setVariable('LINE_CONTROL', 'elementHide');
}
+ } else if ($this->intGlobalWriteAccess !== 0) {
+ $objTemplate->setVariable('LINE_CONTROL', 'elementHide');
}
- // Check global access rights for list objects
- if ($this->intGlobalWriteAccess != 0) {
+ /* Check global access rights for list objects */
+ if ($this->intGlobalWriteAccess !== 0) {
$objTemplate->setVariable('LINE_CONTROL', 'elementHide');
}
$objTemplate->parse($strTplRow);
}
} else {
- $objTemplate->setVariable('IMAGE_PATH', $this->arrSettings['path']['base_url']. 'images/');
+ $objTemplate->setVariable('IMAGE_PATH', $this->arrSettings['path']['base_url'] . 'images/');
$objTemplate->parse($strTplRow);
}
$objTemplate->setVariable('BUTTON_CLASS', 'elementShow');
- if ($this->intDomainId == 0) {
+ if ($this->intDomainId === 0) {
$objTemplate->setVariable('BUTTON_CLASS', 'elementHide');
}
- // Check access rights for adding new objects
- if ($this->intGlobalWriteAccess != 0) {
+ /* Check access rights for adding new objects */
+ if ($this->intGlobalWriteAccess !== 0) {
$objTemplate->setVariable('ADD_CONTROL', 'disabled="disabled"');
}
- // Show page numbers
+ /* Show page numbers */
$objTemplate->setVariable('PAGES', $this->myVisClass->buildPageLinks(filter_input(
INPUT_SERVER,
'PHP_SELF',
- FILTER_SANITIZE_STRING
+ FILTER_UNSAFE_RAW
), $intDLCount2, $this->intLimit, $this->intSortBy, $this->strSortDir));
$objTemplate->parse($strTplPart);
$objTemplate->show($strTplPart);
}
+ /**
+ * Process field view
+ * @param array $arrData Data array
+ * @param string $strTableName Table name
+ * @return string String includung field data
+ */
+ public function processField(array $arrData, string $strTableName): string
+ {
+ $strField = '';
+ $arrDataHosts = array();
+ $arrDataHostgroups = array();
+ $arrDataService = array();
+ $arrDataServices = array();
+ /* Hostdependency table */
+ if ($strTableName === 'tbl_hostdependency') {
+ if ((int)$arrData['dependent_host_name'] !== 0) {
+ $strSQLHost = 'SELECT `host_name`, `exclude` FROM `tbl_host` ' .
+ 'LEFT JOIN `tbl_lnkHostdependencyToHost_DH` ON `id`=`idSlave` ' .
+ 'WHERE `idMaster`=' . $arrData['id'] . ' ORDER BY `host_name`';
+ $this->myDBClass->hasDataArray($strSQLHost, $arrDataHosts, $intDCHost);
+ if ($intDCHost !== 0) {
+ foreach ($arrDataHosts as $elem) {
+ if ((int)$elem['exclude'] === 1) {
+ $strField .= 'H:!' . $elem['host_name'] . ',';
+ } else {
+ $strField .= 'H:' . $elem['host_name'] . ',';
+ }
+ }
+ }
+ }
+ if ((int)$arrData['dependent_hostgroup_name'] !== 0) {
+ $strSQLHost = 'SELECT `hostgroup_name`, `exclude` FROM `tbl_hostgroup` ' .
+ 'LEFT JOIN `tbl_lnkHostdependencyToHostgroup_DH` ON `id`=`idSlave` ' .
+ 'WHERE `idMaster`=' . $arrData['id'] . ' ORDER BY `hostgroup_name`';
+ $this->myDBClass->hasDataArray($strSQLHost, $arrDataHostgroups, $intDCHostgroup);
+ if ($intDCHostgroup !== 0) {
+ foreach ($arrDataHostgroups as $elem) {
+ if ((int)$elem['exclude'] === 1) {
+ $strField .= 'HG:!' . $elem['hostgroup_name'] . ',';
+ } else {
+ $strField .= 'HG:' . $elem['hostgroup_name'] . ',';
+ }
+ }
+ }
+ }
+ }
+ /* Hostescalation table */
+ if ($strTableName === 'tbl_hostescalation') {
+ if ((int)$arrData['host_name'] !== 0) {
+ $strSQLHost = 'SELECT `host_name` FROM `tbl_host` ' .
+ 'LEFT JOIN `tbl_lnkHostescalationToHost` ON `id`=`idSlave` ' .
+ 'WHERE `idMaster`=' . $arrData['id'] . ' ORDER BY `host_name`';
+ $this->myDBClass->hasDataArray($strSQLHost, $arrDataHosts, $intDCHost);
+ if ($intDCHost !== 0) {
+ foreach ($arrDataHosts as $elem) {
+ $strField .= 'H:' . $elem['host_name'] . ',';
+ }
+ }
+ }
+ if ((int)$arrData['hostgroup_name'] !== 0) {
+ $strSQLHost = 'SELECT `hostgroup_name` FROM `tbl_hostgroup` ' .
+ 'LEFT JOIN `tbl_lnkHostescalationToHostgroup` ON `id`=`idSlave` ' .
+ 'WHERE `idMaster`=' . $arrData['id'] . ' ORDER BY `hostgroup_name`';
+ $this->myDBClass->hasDataArray($strSQLHost, $arrDataHostgroups, $intDCHostgroup);
+ if ($intDCHostgroup !== 0) {
+ foreach ($arrDataHostgroups as $elem) {
+ $strField .= 'HG:' . $elem['hostgroup_name'] . ',';
+ }
+ }
+ }
+ }
+ /* Servicedependency table */
+ if ($strTableName === 'tbl_servicedependency') {
+ if ((int)$arrData['dependent_service_description'] === 2) {
+ $strField .= '*';
+ } elseif ((int)$arrData['dependent_service_description'] !== 0) {
+ $strSQLService = 'SELECT `strSlave` FROM `tbl_lnkServicedependencyToService_DS` ' .
+ 'WHERE `idMaster`=' . $arrData['id'] . ' ORDER BY `strSlave`';
+ $this->myDBClass->hasDataArray($strSQLService, $arrDataService, $intDCService);
+ if ($intDCService !== 0) {
+ foreach ($arrDataService as $elem) {
+ $strField .= $elem['strSlave'] . ',';
+ }
+ }
+ }
+ if ($strField === '') {
+ $strSQLService = 'SELECT `servicegroup_name` FROM `tbl_servicegroup` ' .
+ 'LEFT JOIN `tbl_lnkServicedependencyToServicegroup_DS` ON `idSlave`=`id` ' .
+ 'WHERE `idMaster`=' . $arrData['id'] . ' ORDER BY `servicegroup_name`';
+ $this->myDBClass->hasDataArray($strSQLService, $arrDataService, $intDCService);
+ if ($intDCService !== 0) {
+ foreach ($arrDataService as $elem) {
+ $strField .= $elem['servicegroup_name'] . ',';
+ }
+ }
+ }
+ }
+ /* Serviceescalation table */
+ if ($strTableName === 'tbl_serviceescalation') {
+ if ((int)$arrData['service_description'] === 2) {
+ $strField .= '*';
+ } elseif ((int)$arrData['service_description'] !== 0) {
+ $strSQLService = 'SELECT `strSlave` FROM `tbl_lnkServiceescalationToService` ' .
+ 'WHERE `idMaster`=' . $arrData['id'];
+ $this->myDBClass->hasDataArray($strSQLService, $arrDataServices, $intDCServices);
+ if ($intDCServices !== 0) {
+ foreach ($arrDataServices as $elem) {
+ $strField .= $elem['strSlave'] . ',';
+ }
+ }
+ }
+ if ($strField === '') {
+ $strSQLService = 'SELECT `servicegroup_name` FROM `tbl_servicegroup` ' .
+ 'LEFT JOIN `tbl_lnkServiceescalationToServicegroup` ON `idSlave`=`id` ' .
+ 'WHERE `idMaster`=' . $arrData['id'] . ' ORDER BY `servicegroup_name`';
+ $this->myDBClass->hasDataArray($strSQLService, $arrDataService, $intDCService);
+ if ($intDCService !== 0) {
+ foreach ($arrDataService as $elem) {
+ $strField .= $elem['servicegroup_name'] . ',';
+ }
+ }
+ }
+ }
+ /* Some string manipulations - remove comma at line end */
+ if (substr($strField, -1) === ',') {
+ $strField = substr($strField, 0, -1);
+ }
+ return $strField;
+ }
+
/**
* Display information messages
- * @param \HTML_Template_IT $objTemplate Form template object
- * @param string $strErrorMessage Error messages
- * @param string $strInfoMessage Information messages
- * @param string $strConsistMessage Consistency messages
- * @param array $arrTimeData Time data array
- * @param string $strTimeInfoString Time information message
- * @param int $intNoTime Status value for showing time information (0 = show time)
+ * @param HTML_Template_IT $objTemplate Form template object
+ * @param string $strErrorMessage Error messages
+ * @param string $strInfoMessage Information messages
+ * @param string $strConsistMessage Consistency messages
+ * @param array $arrTimeData Time data array
+ * @param string $strTimeInfoString Time information message
+ * @param int $intNoTime Status value for showing time information (0 = show time)
*/
public function showMessages(
- $objTemplate,
- $strErrorMessage,
- $strInfoMessage,
- $strConsistMessage,
- $arrTimeData,
- $strTimeInfoString,
- $intNoTime = 0
- ) {
- // Display info messages
- if ($strInfoMessage != '') {
+ HTML_Template_IT $objTemplate,
+ string $strErrorMessage,
+ string $strInfoMessage,
+ string $strConsistMessage,
+ array $arrTimeData,
+ string $strTimeInfoString,
+ int $intNoTime = 0
+ ): void
+ {
+ /* Display info messages */
+ if ($strInfoMessage !== '') {
$objTemplate->setVariable('INFOMESSAGE', $strInfoMessage);
$objTemplate->parse('infomessage');
}
- // Display error messages
- if ($strErrorMessage != '') {
+ /* Display error messages */
+ if ($strErrorMessage !== '') {
$objTemplate->setVariable('ERRORMESSAGE', $strErrorMessage);
$objTemplate->parse('errormessage');
}
- // Display time informations
- if (($this->intDomainId != 0) && ($intNoTime == 0)) {
+ /* Display time information */
+ if (($this->intDomainId !== 0) && ($intNoTime === 0)) {
foreach ($arrTimeData as $key => $elem) {
- if ($key == 'table') {
- $objTemplate->setVariable('LAST_MODIFIED_TABLE', translate('Last database update:'). ' ' .
- $elem. '');
+ if ($key === 'table') {
+ $objTemplate->setVariable('LAST_MODIFIED_TABLE', translate('Last database update:') . ' ' .
+ $elem . '');
$objTemplate->parse('table_time');
} else {
- $objTemplate->setVariable('LAST_MODIFIED_FILE', translate('Last file change of the configuration '.
- 'target '). ' ' .$key. ': ' .$elem. '');
+ $objTemplate->setVariable('LAST_MODIFIED_FILE', translate('Last file change of the configuration ' .
+ 'target ') . ' ' . $key . ': ' . $elem . '');
$objTemplate->parse('file_time');
}
}
- if ($strTimeInfoString != '') {
+ if ($strTimeInfoString !== '') {
$objTemplate->setVariable('MODIFICATION_STATUS', $strTimeInfoString);
$objTemplate->parse('modification_status');
}
}
- // Display consistency messages
- if ($strConsistMessage != '') {
+ /* Display consistency messages */
+ if ($strConsistMessage !== '') {
$objTemplate->setVariable('CONSIST_USAGE', $strConsistMessage);
$objTemplate->parse('consistency');
}
@@ -377,12 +498,12 @@ class NagContentClass
/**
* Display page footer
- * @param \HTML_Template_IT $objTemplate Form template object
- * @param string $setFileVersion NagiosQL version
+ * @param HTML_Template_IT $objTemplate Form template object
+ * @param string $setFileVersion NagiosQL version
*/
- public function showFooter($objTemplate, $setFileVersion)
+ public function showFooter(HTML_Template_IT $objTemplate, string $setFileVersion): void
{
- $objTemplate->setVariable('VERSION_INFO', "setVariable('VERSION_INFO', "NagiosQL $setFileVersion");
$objTemplate->parse('footer');
$objTemplate->show('footer');
@@ -390,18 +511,18 @@ class NagContentClass
/**
* Single data form initialization
- * @param \HTML_Template_IT $objTemplate Form template object
- * @param string $strChbFields Comma separated string of checkbox value names
+ * @param HTML_Template_IT $objTemplate Form template object
+ * @param string $strChbFields Comma separated string of checkbox value names
*/
- public function addFormInit($objTemplate, $strChbFields = '')
+ public function addFormInit(HTML_Template_IT $objTemplate, string $strChbFields = ''): void
{
- // Language text replacements from fieldvars.php file
+ /* Language text replacements from fieldvars.php file */
foreach ($this->arrDescription as $elem) {
$objTemplate->setVariable($elem['name'], $elem['string']);
}
- // Some single replacements
- $objTemplate->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING));
- $objTemplate->setVariable('IMAGE_PATH', $this->arrSettings['path']['base_url']. 'images/');
+ /* Some single replacements */
+ $objTemplate->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_UNSAFE_RAW));
+ $objTemplate->setVariable('IMAGE_PATH', $this->arrSettings['path']['base_url'] . 'images/');
$objTemplate->setVariable('DOCUMENT_ROOT', $this->arrSettings['path']['base_url']);
$objTemplate->setVariable('ACT_CHECKED', 'checked');
$objTemplate->setVariable('REG_CHECKED', 'checked');
@@ -409,31 +530,31 @@ class NagContentClass
$objTemplate->setVariable('VERSION', $this->intVersion);
$objTemplate->setVariable('LIMIT', $this->intLimit);
$objTemplate->setVariable('RELATION_CLASS', 'elementHide');
- $objTemplate->setVariable('IFRAME_SRC', $this->arrSettings['path']['base_url']. 'admin/commandline.php');
- // Some conditional replacements
- if ($this->strBrowser != 'msie') {
+ $objTemplate->setVariable('IFRAME_SRC', $this->arrSettings['path']['base_url'] . 'admin/commandline.php');
+ /* Some conditional replacements */
+ if ($this->strBrowser !== 'msie') {
$objTemplate->setVariable('MSIE_DISABLED', 'disabled="disabled"');
}
- if ($this->intGroupAdm == 0) {
+ if ($this->intGroupAdm === 0) {
$objTemplate->setVariable('RESTRICT_GROUP_ADMIN', 'class="elementHide"');
}
- if ($this->arrSettings['common']['seldisable'] == 0) {
- $objTemplate->setVariable('MSIE_DISABLED', '');
+ if ((int)$this->arrSettings['common']['seldisable'] === 0) {
+ $objTemplate->setVariable('MSIE_DISABLED');
}
- if ($this->arrSettings['common']['tplcheck'] == 0) {
+ if ((int)$this->arrSettings['common']['tplcheck'] === 0) {
$objTemplate->setVariable('CHECK_BYPASS', 'return true;');
$objTemplate->setVariable('CHECK_BYPASS_NEW', '1');
} else {
$objTemplate->setVariable('CHECK_BYPASS_NEW', '0');
}
- // Some replacements based on nagios version
+ /* Some replacements based on nagios version */
if ($this->intVersion < 3) {
$objTemplate->setVariable('VERSION_20_VISIBLE', 'elementShow');
$objTemplate->setVariable('VERSION_30_VISIBLE', 'elementHide');
$objTemplate->setVariable('VERSION_40_VISIBLE', 'elementHide');
$objTemplate->setVariable('VERSION_20_MUST', 'inpmust');
- $objTemplate->setVariable('VERSION_30_MUST', '');
- $objTemplate->setVariable('VERSION_40_MUST', '');
+ $objTemplate->setVariable('VERSION_30_MUST');
+ $objTemplate->setVariable('VERSION_40_MUST');
$objTemplate->setVariable('VERSION_20_STAR', '*');
$objTemplate->setVariable('NAGIOS_VERSION', '2');
}
@@ -441,10 +562,10 @@ class NagContentClass
$objTemplate->setVariable('VERSION_20_VISIBLE', 'elementHide');
$objTemplate->setVariable('VERSION_30_VISIBLE', 'elementShow');
$objTemplate->setVariable('VERSION_40_VISIBLE', 'elementHide');
- $objTemplate->setVariable('VERSION_20_MUST', '');
+ $objTemplate->setVariable('VERSION_20_MUST');
$objTemplate->setVariable('VERSION_30_MUST', 'inpmust');
- $objTemplate->setVariable('VERSION_40_MUST', '');
- $objTemplate->setVariable('VERSION_20_STAR', '');
+ $objTemplate->setVariable('VERSION_40_MUST');
+ $objTemplate->setVariable('VERSION_20_STAR');
$objTemplate->setVariable('NAGIOS_VERSION', '3');
}
if ($this->intVersion >= 4) {
@@ -452,194 +573,64 @@ class NagContentClass
$objTemplate->setVariable('VERSION_40_MUST', 'inpmust');
$objTemplate->setVariable('NAGIOS_VERSION', '4');
}
- // Checkbox and radio field value replacements
- if ($strChbFields != '') {
+ /* Checkbox and radio field value replacements */
+ if ($strChbFields !== '') {
foreach (explode(',', $strChbFields) as $elem) {
- $objTemplate->setVariable('DAT_' .$elem. '0_CHECKED', '');
- $objTemplate->setVariable('DAT_' .$elem. '1_CHECKED', '');
- $objTemplate->setVariable('DAT_' .$elem. '2_CHECKED', 'checked');
+ $objTemplate->setVariable('DAT_' . $elem . '0_CHECKED');
+ $objTemplate->setVariable('DAT_' . $elem . '1_CHECKED');
+ $objTemplate->setVariable('DAT_' . $elem . '2_CHECKED', 'checked');
}
}
}
/**
* Single data form - value insertion
- * @param \HTML_Template_IT $objTemplate Form template object
- * @param array $arrModifyData Database values
- * @param int $intLocked Data is locked (0 = no / 1 = yes)
- * @param string $strInfo Information string
- * @param string $strChbFields Comma separated string of checkbox value names
+ * @param HTML_Template_IT $objTemplate Form template object
+ * @param array $arrModifyData Database values
+ * @param int $intLocked Data is locked (0 = no / 1 = yes)
+ * @param string $strInfo Information string
+ * @param string $strChbFields Comma separated string of checkbox value names
*/
- public function addInsertData($objTemplate, $arrModifyData, $intLocked, $strInfo, $strChbFields = '')
+ public function addInsertData(HTML_Template_IT $objTemplate, array $arrModifyData, int $intLocked, string $strInfo, string $strChbFields = ''): void
{
- // Insert text data values
+ /* Insert text data values */
foreach ($arrModifyData as $key => $value) {
- if (($key == 'active') || ($key == 'register') || ($key == 'last_modified') || ($key == 'access_rights')) {
+ if (($key === 'active') || ($key === 'register') || ($key === 'last_modified') || ($key === 'access_rights')) {
continue;
}
- $objTemplate->setVariable('DAT_' .strtoupper($key), htmlentities($value, ENT_QUOTES, 'UTF-8'));
+ $objTemplate->setVariable('DAT_' . strtoupper($key), htmlentities($value, ENT_QUOTES, 'UTF-8'));
}
- // Insert checkbox data values
- if (isset($arrModifyData['active']) && ($arrModifyData['active'] != 1)) {
- $objTemplate->setVariable('ACT_CHECKED', '');
+ /* Insert checkbox data values */
+ if (isset($arrModifyData['active']) && ((int)$arrModifyData['active'] !== 1)) {
+ $objTemplate->setVariable('ACT_CHECKED');
}
- if (isset($arrModifyData['register']) && ($arrModifyData['register'] != 1)) {
- $objTemplate->setVariable('REG_CHECKED', '');
+ if (isset($arrModifyData['register']) && ((int)$arrModifyData['register'] !== 1)) {
+ $objTemplate->setVariable('REG_CHECKED');
}
- // Deselect any checkboxes
- if ($strChbFields != '') {
+ /* Deselect any checkboxes */
+ if ($strChbFields !== '') {
foreach (explode(',', $strChbFields) as $elem) {
- $objTemplate->setVariable('DAT_' .$elem. '0_CHECKED', '');
- $objTemplate->setVariable('DAT_' .$elem. '1_CHECKED', '');
- $objTemplate->setVariable('DAT_' .$elem. '2_CHECKED', '');
+ $objTemplate->setVariable('DAT_' . $elem . '0_CHECKED');
+ $objTemplate->setVariable('DAT_' . $elem . '1_CHECKED');
+ $objTemplate->setVariable('DAT_' . $elem . '2_CHECKED');
}
}
- // Change some status values in locked data sets
- if ($intLocked != 0) {
+ /* Change some status values in locked data sets */
+ if ($intLocked !== 0) {
$objTemplate->setVariable('ACT_DISABLED', 'disabled');
$objTemplate->setVariable('ACT_CHECKED', 'checked');
$objTemplate->setVariable('ACTIVE', '1');
$objTemplate->setVariable('CHECK_MUST_DATA', $strInfo);
$objTemplate->setVariable('RELATION_CLASS', 'elementShow');
}
- // Change mode to modify
+ /* Change mode to modify */
$objTemplate->setVariable('MODUS', 'modify');
- // Check write permission
- if ($this->intWriteAccessId == 1) {
+ /* Check write permission */
+ if ($this->intWriteAccessId === 1) {
$objTemplate->setVariable('DISABLE_SAVE', 'disabled="disabled"');
}
- if ($this->intGlobalWriteAccess == 1) {
+ if ($this->intGlobalWriteAccess === 1) {
$objTemplate->setVariable('DISABLE_SAVE', 'disabled="disabled"');
}
}
-
- /**
- * Process field view
- * @param array $arrData Data array
- * @param string $strTableName Table name
- * @return string String includung field data
- */
- public function processField($arrData, $strTableName)
- {
- $strField = '';
- $arrDataHosts = array();
- $arrDataHostgroups = array();
- $arrDataService = array();
- $arrDataServices = array();
- // Hostdependency table
- if ($strTableName == 'tbl_hostdependency') {
- if ($arrData['dependent_host_name'] != 0) {
- $strSQLHost = 'SELECT `host_name`, `exclude` FROM `tbl_host` ' .
- 'LEFT JOIN `tbl_lnkHostdependencyToHost_DH` ON `id`=`idSlave` ' .
- 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `host_name`';
- $this->myDBClass->hasDataArray($strSQLHost, $arrDataHosts, $intDCHost);
- if ($intDCHost != 0) {
- foreach ($arrDataHosts as $elem) {
- if ($elem['exclude'] == 1) {
- $strField .= 'H:!' .$elem['host_name']. ',';
- } else {
- $strField .= 'H:' .$elem['host_name']. ',';
- }
- }
- }
- }
- if ($arrData['dependent_hostgroup_name'] != 0) {
- $strSQLHost = 'SELECT `hostgroup_name`, `exclude` FROM `tbl_hostgroup` ' .
- 'LEFT JOIN `tbl_lnkHostdependencyToHostgroup_DH` ON `id`=`idSlave` ' .
- 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `hostgroup_name`';
- $this->myDBClass->hasDataArray($strSQLHost, $arrDataHostgroups, $intDCHostgroup);
- if ($intDCHostgroup != 0) {
- foreach ($arrDataHostgroups as $elem) {
- if ($elem['exclude'] == 1) {
- $strField .= 'HG:!' .$elem['hostgroup_name']. ',';
- } else {
- $strField .= 'HG:' .$elem['hostgroup_name']. ',';
- }
- }
- }
- }
- }
- // Hostescalation table
- if ($strTableName == 'tbl_hostescalation') {
- if ($arrData['host_name'] != 0) {
- $strSQLHost = 'SELECT `host_name` FROM `tbl_host` ' .
- 'LEFT JOIN `tbl_lnkHostescalationToHost` ON `id`=`idSlave` ' .
- 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `host_name`';
- $this->myDBClass->hasDataArray($strSQLHost, $arrDataHosts, $intDCHost);
- if ($intDCHost != 0) {
- foreach ($arrDataHosts as $elem) {
- $strField .= 'H:' .$elem['host_name']. ',';
- }
- }
- }
- if ($arrData['hostgroup_name'] != 0) {
- $strSQLHost = 'SELECT `hostgroup_name` FROM `tbl_hostgroup` ' .
- 'LEFT JOIN `tbl_lnkHostescalationToHostgroup` ON `id`=`idSlave` ' .
- 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `hostgroup_name`';
- $this->myDBClass->hasDataArray($strSQLHost, $arrDataHostgroups, $intDCHostgroup);
- if ($intDCHostgroup != 0) {
- foreach ($arrDataHostgroups as $elem) {
- $strField .= 'HG:' .$elem['hostgroup_name']. ',';
- }
- }
- }
- }
- // Servicedependency table
- if ($strTableName == 'tbl_servicedependency') {
- if ($arrData['dependent_service_description'] == 2) {
- $strField .= '*';
- } elseif ($arrData['dependent_service_description'] != 0) {
- $strSQLService = 'SELECT `strSlave` FROM `tbl_lnkServicedependencyToService_DS` ' .
- 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `strSlave`';
- $this->myDBClass->hasDataArray($strSQLService, $arrDataService, $intDCService);
- if ($intDCService != 0) {
- foreach ($arrDataService as $elem) {
- $strField .= $elem['strSlave']. ',';
- }
- }
- }
- if ($strField == '') {
- $strSQLService = 'SELECT `servicegroup_name` FROM `tbl_servicegroup` ' .
- 'LEFT JOIN `tbl_lnkServicedependencyToServicegroup_DS` ON `idSlave`=`id` ' .
- 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `servicegroup_name`';
- $this->myDBClass->hasDataArray($strSQLService, $arrDataService, $intDCService);
- if ($intDCService != 0) {
- foreach ($arrDataService as $elem) {
- $strField .= $elem['servicegroup_name']. ',';
- }
- }
- }
- }
- // Serviceescalation table
- if ($strTableName == 'tbl_serviceescalation') {
- if ($arrData['service_description'] == 2) {
- $strField .= '*';
- } elseif ($arrData['service_description'] != 0) {
- $strSQLService = 'SELECT `strSlave` FROM `tbl_lnkServiceescalationToService` ' .
- 'WHERE `idMaster`=' .$arrData['id'];
- $this->myDBClass->hasDataArray($strSQLService, $arrDataServices, $intDCServices);
- if ($intDCServices != 0) {
- foreach ($arrDataServices as $elem) {
- $strField .= $elem['strSlave']. ',';
- }
- }
- }
- if ($strField == '') {
- $strSQLService = 'SELECT `servicegroup_name` FROM `tbl_servicegroup` ' .
- 'LEFT JOIN `tbl_lnkServiceescalationToServicegroup` ON `idSlave`=`id` ' .
- 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `servicegroup_name`';
- $this->myDBClass->hasDataArray($strSQLService, $arrDataService, $intDCService);
- if ($intDCService != 0) {
- foreach ($arrDataService as $elem) {
- $strField .= $elem['servicegroup_name']. ',';
- }
- }
- }
- }
- // Some string manipulations - remove comma on line end
- if (substr($strField, -1) == ',') {
- $strField = substr($strField, 0, -1);
- }
- return $strField;
- }
-}
+}
\ No newline at end of file
diff --git a/functions/NagDataClass.php b/functions/NagDataClass.php
index 0b5eb81..34ad462 100644
--- a/functions/NagDataClass.php
+++ b/functions/NagDataClass.php
@@ -1,59 +1,54 @@
intDomainId = $arrSession['domain'];
+ $this->intDomainId = (int)$arrSession['domain'];
}
if (isset($arrSession['username'])) {
$this->strUserName = $arrSession['username'];
@@ -61,152 +56,57 @@ class NagDataClass
$this->arrSession = $arrSession;
}
- /**
- * Saving a given string to the logbook
- * @param string $strLogMessage Message string
- * @return int 0 = successful / 1 = error
- */
- public function writeLog($strLogMessage)
- {
- // Variable definition
- $strRemoteAdress = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
- $intReturn = 0;
- // Write log message to database
- if ($strRemoteAdress != null) {
- // Webinterface
- $strUserName = $this->strUserName;
- $strDomain = $this->myDBClass->getFieldData('SELECT `domain` FROM `tbl_datadomain` ' .
- 'WHERE `id`=' .$this->intDomainId);
- $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',".
- "`time`=NOW(), `ipadress`='".$strRemoteAdress."', `domain`='$strDomain',".
- "`entry`='".addslashes($strLogMessage)."'");
- if ($booReturn == false) {
- $intReturn = 1;
- }
- } else {
- // Scriptinginterface
- $strUserName = 'scripting';
- $strRemoteUser = filter_input(INPUT_SERVER, 'REMOTE_USER', FILTER_SANITIZE_STRING);
- $strHostname = filter_input(INPUT_SERVER, 'REMOTE_HOST', FILTER_SANITIZE_STRING);
- $strSSHClient = filter_input(INPUT_SERVER, 'SSH_CLIENT', FILTER_SANITIZE_STRING);
- if ($strRemoteUser != null) {
- $strUserName .= ' - ' .$strRemoteUser;
- }
- $strDomain = $this->myDBClass->getFieldData('SELECT `domain` FROM `tbl_datadomain` ' .
- 'WHERE `id`=' .$this->intDomainId);
- if ($strHostname != null) {
- $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',".
- "`time`=NOW(), `ipadress`='".$strHostname."', `domain`='$strDomain', ".
- "`entry`='".addslashes($strLogMessage)."'");
- } elseif ($strSSHClient != null) {
- $arrSSHClient = explode(' ', $strSSHClient);
- $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',".
- "`time`=NOW(), `ipadress`='".$arrSSHClient[0]."', `domain`='$strDomain', ".
- "`entry`='".addslashes($strLogMessage)."'");
- } else {
- $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',".
- "`time`=NOW(), `ipadress`='unknown', `domain`='$strDomain', ".
- "`entry`='".addslashes($strLogMessage)."'");
- }
- if ($booReturn == false) {
- $intReturn = 1;
- }
- }
- return $intReturn;
- }
-
- /**
- * Sends an SQL string to the database server
- * @param string $strSQL SQL Command
- * @param int $intDataID Data ID of last inserted dataset (by reference)
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function dataInsert($strSQL, &$intDataID)
- {
- //Define variables
- $intReturn = 0;
- // Send the SQL command to the database server
- $booReturn = $this->myDBClass->insertData($strSQL);
- $intDataID = $this->myDBClass->intLastId;
- // Was the SQL command processed successfully?
- if ($booReturn) {
- $this->processClassMessage(translate('Data were successfully inserted to the data base!').
- '::', $this->strInfoMessage);
- } else {
- $this->processClassMessage(translate('Error while inserting the data into the database:').
- '::' .$this->myDBClass->strErrorMessage. '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- return $intReturn;
- }
-
- /**
- * Merge message strings and check for duplicate messages
- * @param string $strNewMessage New message to add
- * @param string $strOldMessage Modified message string (by reference)
- */
- public function processClassMessage($strNewMessage, &$strOldMessage)
- {
- $strNewMessage = str_replace('::::', '::', $strNewMessage);
- if (($strOldMessage != '') && ($strNewMessage != '')) {
- if (substr_count($strOldMessage, $strNewMessage) == 0) {
- $strOldMessage .= $strNewMessage;
- }
- } else {
- $strOldMessage .= $strNewMessage;
- }
- }
-
/**
* Copies one or more records in a data table. Alternatively, an individual record ID
* are specified, or the values of the $_POST['chbId_n'] variable is used where n
* is the record ID.
- * @param string $strTableName Table name
- * @param string $strKeyField Key field of the table
- * @param int $intDataId Single data ID to copy
- * @param int $intDomainId Target domain ID
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
+ * @param string $strTableName Table name
+ * @param string $strKeyField Key field of the table
+ * @param int $intDataId Single data ID to copy
+ * @param int $intDomainId Target domain ID
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
*/
- public function dataCopyEasy($strTableName, $strKeyField, $intDataId = 0, $intDomainId = -1)
+ public function dataCopyEasy(string $strTableName, string $strKeyField, int $intDataId = 0, int $intDomainId = -1): int
{
- // Define variables
+ /* Define variables */
$arrRelations = array();
- $intError = 0;
- $intNumber = 0;
- $intReturn = 0;
- $strAccess = $this->myVisClass->getAccessGroups('write');
- if ($intDomainId == -1) {
+ $intError = 0;
+ $intNumber = 0;
+ $intReturn = 0;
+ $strAccess = $this->myVisClass->getAccessGroups('write');
+ if ($intDomainId === -1) {
$intDomainId = $this->intDomainId;
}
- // Get all data ID from target table
+ /* Get all data ID from target table */
$strAccWhere = "WHERE `access_group` IN ($strAccess)";
- if (($strTableName == 'tbl_user') || ($strTableName == 'tbl_group')) {
+ if (($strTableName === 'tbl_user') || ($strTableName === 'tbl_group')) {
$strAccWhere = '';
}
- $strSQL = 'SELECT `id` FROM `' .$strTableName."` $strAccWhere ORDER BY `id`";
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTableName . "` $strAccWhere ORDER BY `id`";
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn == false) {
- $this->processClassMessage(translate('Error while selecting data from database:').
- '::' .$this->myDBClass->strErrorMessage. '::', $this->strErrorMessage);
+ if ($booReturn === false) {
+ $this->processClassMessage(translate('Error while selecting data from database:') .
+ '::' . $this->myDBClass->strErrorMessage . '::', $this->strErrorMessage);
return 1;
}
- if ($intDataCount != 0) {
- for ($i=0; $i<$intDataCount; $i++) {
- // Skip common domain value
- if ($arrData[$i]['id'] == 0) {
+ if ($intDataCount !== 0) {
+ for ($i = 0; $i < $intDataCount; $i++) {
+ /* Skip common domain value */
+ if ((int)$arrData[$i]['id'] === 0) {
continue;
}
- // Build the name of the form variable
- $strChbName = 'chbId_' .$arrData[$i]['id'];
- // If a form variable with this name exists or a matching single data ID was passed
- if (((filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) != null) && ($intDataId == 0)) ||
- ($intDataId == $arrData[$i]['id'])) {
- // Get all data of this data ID
- $strSQL = 'SELECT * FROM `' .$strTableName. '` WHERE `id`=' .$arrData[$i]['id'];
+ /* Build the name of the form variable */
+ $strChbName = 'chbId_' . $arrData[$i]['id'];
+ /* If a form variable with this name exists or a matching single data ID was passed */
+ if (((filter_input(INPUT_POST, $strChbName, FILTER_UNSAFE_RAW) !== null) && ($intDataId === 0)) ||
+ ($intDataId === (int)$arrData[$i]['id'])) {
+ /* Get all data of this data ID */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTableName . '` WHERE `id`=' . $arrData[$i]['id'];
$this->myDBClass->hasSingleDataset($strSQL, $arrData[$i]);
- // Build a temporary config name
+ /* Build a temporary config name */
$strNewName = $this->buildTempConfigName(
$strTableName,
$strKeyField,
@@ -215,1078 +115,295 @@ class NagDataClass
$arrData,
$i
);
- // Build the INSERT command based on the table name
- $strSQLInsert = $this->buildInsertSQL(
- $strTableName,
- $strKeyField,
- $intDomainId,
- $strNewName,
- $arrData,
- $i
- );
- // Insert the master dataset
- $intCheck = 0;
- $booReturn = $this->myDBClass->insertData($strSQLInsert);
+ /* Build the INSERT command based on the table name */
+ if ($strTableName === 'tbl_service') {
+ $strSQLInsert = $this->buildInsertSQL(
+ $strTableName,
+ 'service_description',
+ $intDomainId,
+ $strNewName,
+ $arrData,
+ $i);
+ } else {
+ $strSQLInsert = $this->buildInsertSQL(
+ $strTableName,
+ $strKeyField,
+ $intDomainId,
+ $strNewName,
+ $arrData,
+ $i);
+ }
+ /* Insert the master dataset */
+ $intCheck = 0;
+ $booReturn = $this->myDBClass->insertData($strSQLInsert);
$intMasterId = $this->myDBClass->intLastId;
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
- // Copy relations
- if (($this->tableRelations($strTableName, $arrRelations) == 0) && ($intCheck == 0)) {
+ /* Copy relations */
+ if (($this->tableRelations($strTableName, $arrRelations) === 0) && ($intCheck === 0)) {
foreach ($arrRelations as $elem) {
- // Normal 1:n relation
- if ($elem['type'] == '2') {
+ /* Normal 1:n relation */
+ if ((int)$elem['type'] === 2) {
$intCheck = $this->insertRelationType2($arrData, $i, $elem, $intMasterId, $intCheck);
- } elseif ($elem['type'] == '3') { // 1:n relation for templates
+ } elseif ((int)$elem['type'] === 3) { /* 1:n relation for templates */
$intCheck = $this->insertRelationType3($arrData, $i, $elem, $intMasterId, $intCheck);
- } elseif ($elem['type'] == '4') { // Special relation for free variables
+ } elseif ((int)$elem['type'] === 4) { /* Special relation for free variables */
$intCheck = $this->insertRelationType4($arrData, $i, $elem, $intMasterId, $intCheck);
- } elseif ($elem['type'] == '5') { // 1:n relation for tbl_lnkServicegroupToService
+ } elseif ((int)$elem['type'] === 5) { /* 1:n relation for tbl_lnkServicegroupToService */
$intCheck = $this->insertRelationType5($arrData, $i, $elem, $intMasterId, $intCheck);
- } elseif ($elem['type'] == '6') { // 1:n relation for services
+ } elseif ((int)$elem['type'] === 6) { /* 1:n relation for services */
$intCheck = $this->insertRelationType6($arrData, $i, $elem, $intMasterId, $intCheck);
}
}
- // 1:n relation for time definitions
- if ($strTableName == 'tbl_timeperiod') {
+ /* 1:n relation for time definitions */
+ if ($strTableName === 'tbl_timeperiod') {
$intCheck = $this->insertRelationTimedefinition($arrData, $i, $intMasterId, $intCheck);
}
- // 1:n relation for groups
- if ($strTableName == 'tbl_group') {
+ /* 1:n relation for groups */
+ if ($strTableName === 'tbl_group') {
$intCheck = $this->insertRelationGroup($arrData, $i, $intMasterId, $intCheck);
}
- // 1:n relation fot service to host connections
- if ($strTableName == 'tbl_host') {
+ /* 1:n relation for service to host connections */
+ if ($strTableName === 'tbl_host') {
$intCheck = $this->insertRelationHost($arrData, $i, $intMasterId, $intCheck);
}
}
- // Write logfile
- if ($intCheck != 0) {
- // Error
+ /* Write logfile */
+ if ($intCheck !== 0) {
+ /* Error */
$intError++;
- $this->writeLog(translate('Data set copy failed - table [new name]:'). ' ' .$strTableName
- . ' [' .$strNewName. ']');
- $this->processClassMessage(translate('Data set copy failed - table [new name]:'). ' ' .
- $strTableName. ' [' .$strNewName. ']::', $this->strInfoMessage);
+ $this->writeLog(translate('Data set copy failed - table [new name]:') . ' ' . $strTableName
+ . ' [' . $strNewName . ']');
+ $this->processClassMessage(translate('Data set copy failed - table [new name]:') . ' ' .
+ $strTableName . ' [' . $strNewName . ']::', $this->strInfoMessage);
} else {
- // Success
- $this->writeLog(translate('Data set copied - table [new name]:'). ' ' .$strTableName.
- ' [' .$strNewName. ']');
- $this->processClassMessage(translate('Data set copied - table [new name]:'). ' ' .
- $strTableName. ' [' .$strNewName. ']::', $this->strInfoMessage);
+ /* Success */
+ $this->writeLog(translate('Data set copied - table [new name]:') . ' ' . $strTableName .
+ ' [' . $strNewName . ']');
+ $this->processClassMessage(translate('Data set copied - table [new name]:') . ' ' .
+ $strTableName . ' [' . $strNewName . ']::', $this->strInfoMessage);
}
$intNumber++;
}
}
- // Error processing
+ /* Error processing */
if ($intNumber > 0) {
- if ($intError == 0) {
- // Success
+ if ($intError === 0) {
+ /* Success */
$this->processClassMessage(translate('Data were successfully inserted to the data base!')
. '::', $this->strInfoMessage);
$this->updateStatusTable($strTableName);
} else {
- // Error
+ /* Error */
$this->processClassMessage(translate('Error while inserting the data into the database:')
- . '::' .$this->myDBClass->strErrorMessage, $this->strInfoMessage);
+ . '::' . $this->myDBClass->strErrorMessage, $this->strInfoMessage);
$intReturn = 1;
}
} else {
- $this->processClassMessage(translate('No dataset copied. Maybe the dataset does not exist or you do '.
- 'not have write permission.'). '::', $this->strErrorMessage);
+ $this->processClassMessage(translate('No dataset copied. Maybe the dataset does not exist or you do ' .
+ 'not have write permission.') . '::', $this->strErrorMessage);
$intReturn = 1;
}
} else {
- $this->processClassMessage(translate('No dataset copied. Maybe the dataset does not exist or you do not '.
- 'have write permission.'). '::', $this->strErrorMessage);
+ $this->processClassMessage(translate('No dataset copied. Maybe the dataset does not exist or you do not ' .
+ 'have write permission.') . '::', $this->strErrorMessage);
$intReturn = 1;
}
return $intReturn;
}
+ /**
+ * Merge message strings and check for duplicate messages
+ * @param string $strNewMessage New message to add
+ * @param string|null $strOldMessage Modified message string (by reference)
+ */
+ public function processClassMessage(string $strNewMessage, string &$strOldMessage = null): int
+ {
+ $strNewMessage = str_replace('::::', '::', $strNewMessage);
+ if (($strOldMessage !== '') && ($strNewMessage !== '')) {
+ if (substr_count($strOldMessage, $strNewMessage) === 0) {
+ $strOldMessage .= $strNewMessage;
+ }
+ } else {
+ $strOldMessage .= $strNewMessage;
+ }
+ return 0;
+ }
+
+ /**
+ * Build a temporary configuration name
+ * @param string $strTableName Table name
+ * @param string $strKeyField Configuration field name
+ * @param int $intDomainId Domain ID
+ * @param int $intCount Dataset counter
+ * @param array $arrData Data array
+ * @param int $intID Data array key
+ * @return string Temporary configuration name
+ */
+ private function buildTempConfigName(string $strTableName, string $strKeyField, int $intDomainId, int $intCount, array $arrData, int $intID): string
+ {
+ /* Define variables */
+ $strNewName = '';
+ for ($y = 1; $y <= $intCount; $y++) {
+ $strNewName = $arrData[$intID][$strKeyField] . " ($y)";
+ if (($strTableName === 'tbl_user') || ($strTableName === 'tbl_group') ||
+ ($strTableName === 'tbl_datadomain') || ($strTableName === 'tbl_configtarget')) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTableName . '` WHERE `' . $strKeyField . "`='$strNewName'";
+ } else if ($strTableName === 'tbl_service') {
+ $strNewName = $arrData[$intID]['service_description'] . " ($y)";
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTableName . '` WHERE `' . $strKeyField . "`='" .
+ $arrData[$intID][$strKeyField] . "' AND `service_description`='$strNewName'";
+ } else {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTableName . '` ' .
+ 'WHERE `' . $strKeyField . "`='$strNewName' AND `config_id`=$intDomainId";
+ }
+ $strFieldData = $this->myDBClass->getFieldData($strSQL);
+ /* If the name is unused -> break the loop */
+ if ($strFieldData === '') {
+ break;
+ }
+ }
+ /* Manually overwrite new name for extinfo tables */
+ if ($strTableName === 'tbl_hostextinfo') {
+ $strNewName = '0';
+ }
+ if ($strTableName === 'tbl_serviceextinfo') {
+ $strNewName = '0';
+ }
+ return $strNewName;
+ }
+
+ /**
+ * Build an INSERT command based on the table name
+ * @param string $strTableName Table name
+ * @param string $strKeyField Configuration field name
+ * @param int $intDomainId Domain ID
+ * @param string $strNewName New configuration name
+ * @param array $arrData Data array
+ * @param int $intID Data array key
+ * @return string SQL INSERT command
+ */
+ private function buildInsertSQL(string $strTableName, string $strKeyField, int $intDomainId, string $strNewName, array $arrData, int $intID): string
+ {
+ /** @noinspection SqlResolve */
+ $strSQLInsert = 'INSERT INTO `' . $strTableName . '` SET `' . $strKeyField . "`='" . $strNewName . "'";
+ foreach ($arrData[$intID] as $key => $value) {
+ if ($value === null) {
+ $value = '';
+ }
+ if (($key !== $strKeyField) && ($key !== 'active') && ($key !== 'last_modified') &&
+ ($key !== 'id') && ($key !== 'config_id')) {
+ /* Manually set some NULL values based on field names */
+ $value = $this->setNullValues($strTableName, $key, $value);
+ /* If the data value is not "NULL", add single quotes to the value */
+ if ($value !== 'NULL') {
+ $strSQLInsert .= ',`' . $key . "`='" . addslashes($value) . "'";
+ } else {
+ $strSQLInsert .= ',`' . $key . '`=' . $value;
+ }
+ }
+ }
+ if (($strTableName === 'tbl_user') || ($strTableName === 'tbl_group') ||
+ ($strTableName === 'tbl_datadomain') || ($strTableName === 'tbl_configtarget')) {
+ $strSQLInsert .= ",`active`='0', `last_modified`=NOW()";
+ } else {
+ $strSQLInsert .= ",`active`='0', `config_id`=$intDomainId, `last_modified`=NOW()";
+ }
+ return $strSQLInsert;
+ }
+
+ /**
+ * Manually set some NULL values based on field names (key)
+ * @param string $strTableName Table name
+ * @param string $key Data key (field name)
+ * @param string $value Data value (field key)
+ * @return NULL|string Manipulated data value
+ */
+ private function setNullValues(string $strTableName, string $key, string $value): ?string
+ {
+ $arrNull = array('normal_check_interval', 'retry_check_interval', 'max_check_attempts', 'low_flap_threshold',
+ 'high_flap_threshold', 'freshness_threshold', 'notification_interval', 'first_notification_delay',
+ 'check_interval', 'retry_interval');
+ if (in_array($key, $arrNull, true) && ($value === '')) {
+ $value = 'NULL';
+ }
+ /* manually set some NULL values based on table name */
+ if (($strTableName === 'tbl_serviceextinfo') && ($key === 'service_description')) {
+ $value = '0';
+ }
+ /* Do not copy the password in tbl_user */
+ if (($strTableName === 'tbl_user') && ($key === 'password')) {
+ $value = 'xxxxxxx';
+ }
+ /* Do not copy nodelete and webserver authentification values in tbl_user */
+ if ($key === 'nodelete') {
+ $value = '0';
+ }
+ if ($key === 'wsauth') {
+ $value = '0';
+ }
+ return $value;
+ }
+
/**
* Returns an array of all datafields of a table, which has an 1:1 or 1:n relation
* to another table.
- * @param string $strTable Table name
- * @param array $arrRelations Array with relations
- * @return int 0 = successful / 1 = error
+ * @param string $strTable Table name
+ * @param array|null $arrRelations Array with relations
+ * @return int 0 = successful / 1 = error
*/
- public function tableRelations($strTable, &$arrRelations)
+ public function tableRelations(string $strTable, array &$arrRelations = null): int
{
- // Define variable
+ /* Define variable */
$arrRelations = array();
- $arrData = array();
- $intDC = 0;
- $intReturn = 1;
- // Get relation data
- $strSQL = "SELECT * FROM `tbl_relationinformation` WHERE `master`='$strTable' AND `fullRelation`=0";
+ $arrData = array();
+ $intDC = 0;
+ $intReturn = 1;
+ /* Get relation data */
+ $strSQL = "SELECT * FROM `tbl_relationinformation` WHERE `master`='$strTable' AND `fullRelation`=0";
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booReturn && ($intDC != 0)) {
+ if ($booReturn && ($intDC !== 0)) {
foreach ($arrData as $elem) {
$arrRelations[] = array('tableName1' => $elem['tableName1'], 'tableName2' => $elem['tableName2'],
- 'fieldName' => $elem['fieldName'], 'linkTable' => $elem['linkTable'],
- 'target1' => $elem['target1'], 'target2' => $elem['target2'],
- 'type' => $elem['type']);
+ 'fieldName' => $elem['fieldName'], 'linkTable' => $elem['linkTable'],
+ 'target1' => $elem['target1'], 'target2' => $elem['target2'],
+ 'type' => $elem['type']);
}
$intReturn = 0;
}
return $intReturn;
}
- /**
- * Update the date inside the status table (used for last modified date)
- * @param string $strTable Table name
- * @return int 0 = successful / 1 = error
- */
- public function updateStatusTable($strTable)
- {
- // Define variable
- $arrData = array();
- $intDC = 0;
- $intReturn = 1;
- // Does the entry exist?
- $strSQL = "SELECT * FROM `tbl_tablestatus` WHERE `tableName`='$strTable' AND `domainId`=".$this->intDomainId;
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booReturn && ($intDC != 0)) {
- $strSQL = 'UPDATE `tbl_tablestatus` SET `updateTime`=NOW() ' .
- "WHERE `tableName`='$strTable' AND `domainId`=".$this->intDomainId;
- $booReturn = $this->dataInsert($strSQL, $intDataID);
- if ($booReturn) {
- $intReturn = 0;
- }
- } elseif ($booReturn) {
- $strSQL = 'INSERT INTO `tbl_tablestatus` ' .
- "SET `updateTime`=NOW(), `tableName`='$strTable', `domainId`=".$this->intDomainId;
- $booReturn = $this->dataInsert($strSQL, $intDataID);
- if ($booReturn) {
- $intReturn = 0;
- }
- }
- return $intReturn;
- }
-
- /**
- * Removes one or more dataset(s) from a table. Optinal a single data ID can be passed or the values will be
- * processed through the POST variable $_POST['chbId_n'] where 'n' represents the data ID.
- * -> This function does not delete any relation data! <-
- * @param string $strTableName Table name
- * @param int $intDataId Single data ID
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function dataDeleteEasy($strTableName, $intDataId = 0)
- {
- // Define variables
- $strNoDelete = '';
- $intReturn = 0;
- $arrData = array();
- // Special rule for tables with "nodelete" cells
- if (($strTableName == 'tbl_datadomain') || ($strTableName == 'tbl_configtarget') ||
- ($strTableName == 'tbl_user')) {
- $strNoDelete = "AND `nodelete` <> '1'";
- }
- // Delete a single data set
- if ($intDataId != 0) {
- $strSQL = 'DELETE FROM `' .$strTableName."` WHERE `id` = $intDataId $strNoDelete";
- $booReturn = $this->myDBClass->insertData($strSQL);
- if ($booReturn == false) {
- $this->processClassMessage(translate('Delete failed because a database error:').
- '::' .$this->myDBClass->strErrorMessage. '::', $this->strInfoMessage);
- $intReturn = 1;
- } elseif ($this->myDBClass->intAffectedRows == 0) {
- $this->processClassMessage(translate('No data deleted. The dataset probably does not exist or '.
- 'is protected from deletion.'). '::', $this->strErrorMessage);
- $intReturn = 1;
- } else {
- $this->strInfoMessage .= translate('Dataset successfully deleted. Affected rows:'). ' ' .
- $this->myDBClass->intAffectedRows. '::';
- $this->writeLog(translate('Delete dataset id:')." $intDataId ".translate('- from table:').
- " $strTableName ".translate('- with affected rows:'). ' ' .$this->myDBClass->intAffectedRows);
- $this->updateStatusTable($strTableName);
- }
- // Delete data sets based on form POST parameter
- } else {
- $strSQL = 'SELECT `id` FROM `' .$strTableName. '` WHERE 1=1 ';
- $strSQL .= $strNoDelete;
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn && ($intDataCount != 0)) {
- $intDeleteCount = 0;
- foreach ($arrData as $elem) {
- $strChbName = 'chbId_' .$elem['id'];
- // Should this data id to be deleted?
- if ((filter_input(INPUT_POST, $strChbName) != null) &&
- (filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) == 'on')) {
- $strSQL = 'DELETE FROM `' .$strTableName. '` WHERE `id` = ' .$elem['id'];
- $booReturn = $this->myDBClass->insertData($strSQL);
- if ($booReturn == false) {
- $this->processClassMessage(translate('Delete failed because a database error:').
- '::' .$this->myDBClass->strErrorMessage. '::', $this->strInfoMessage);
- $intReturn = 1;
- } else {
- $intDeleteCount += $this->myDBClass->intAffectedRows;
- }
- }
- }
- // Process messsages
- if ($intDeleteCount == 0) {
- $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or '.
- 'it is protected from delete.'). '::', $this->strErrorMessage);
- $intReturn = 1;
- } elseif ($intReturn == 0) {
- $this->processClassMessage(translate('Dataset successfully deleted. Affected rows:'). ' ' .
- $intDeleteCount. '::', $this->strInfoMessage);
- $this->writeLog(translate('Deleted data from table:')." $strTableName ".
- translate('- with affected rows:'). ' ' .$this->myDBClass->intAffectedRows);
- $this->updateStatusTable($strTableName);
- }
- } else {
- $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or it is '.
- 'protected from delete.'). '::', $this->strErrorMessage);
- $intReturn = 1;
- }
- }
- return $intReturn;
- }
-
- /**
- * Removes one or more dataset(s) from a table. Optinal a single data ID can be passed or the values will be
- * processed through the POST variable $_POST['chbId_n'] where 'n' represents the data ID.
- * -> This function does also delete relation data! <-
- * @param string $strTableName Table name
- * @param int $intDataId Single data ID
- * @param int $intForce Force deletion (1 = force, 1 = no force)
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function dataDeleteFull($strTableName, $intDataId = 0, $intForce = 0)
- {
- // Define variables
- $arrRelations = array();
- $arrData = array();
- $arrConfigId = array();
- // Get write access groups
- $strAccess = $this->myVisClass->getAccessGroups('write');
- // Get all relations
- $this->fullTableRelations($strTableName, $arrRelations);
- // Get all datasets
- if ($strTableName == 'tbl_group') {
- $strSQL = 'SELECT `id` FROM `' .$strTableName. '`';
- } else {
- $strSQL = 'SELECT `id` FROM `' .$strTableName. '` ' .
- 'WHERE `config_id`=' .$this->intDomainId." AND `access_group` IN ($strAccess)";
- }
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn && ($intDataCount != 0)) {
- $intDeleteCount = 0;
- $strInfoMessage = '';
- $strErrorMessage = '';
-
- foreach ($arrData as $elem) {
- $strChbName = 'chbId_' .$elem['id'];
- // Single ID
- if (($intDataId != 0) && ($intDataId != $elem['id'])) {
- continue;
- }
- // Should this data id to be deleted?
- if ((($intDataId == $elem['id']) || ((filter_input(INPUT_POST, $strChbName) != null) &&
- (filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) == 'on'))) &&
- (($this->infoRelation($strTableName, $elem['id'], 'id', 1) == 0) || ($intForce == 1))) {
- // Delete relations
- if (!\is_array($arrRelations)) {
- $arrRelations = array();
- }
- foreach ($arrRelations as $rel) {
- $strSQL = '';
- // Process flags
- $arrFlags = explode(',', $rel['flags']);
- // Simple 1:n relation
- if ($arrFlags[3] == 1) {
- $strSQL = 'DELETE FROM `' .$rel['tableName1']. '` ' .
- 'WHERE `' .$rel['fieldName']. '`=' .$elem['id'];
- }
- // Simple 1:1 relation
- if ($arrFlags[3] == 0) {
- // Delete relation
- if ($arrFlags[2] == 0) {
- $strSQL = 'DELETE FROM `' .$rel['tableName1']. '` ' .
- 'WHERE `' .$rel['fieldName']. '`=' .$elem['id'];
- // Set slave to 0
- } elseif ($arrFlags[2] == 2) {
- $strSQL = 'UPDATE `' .$rel['tableName1']. '` SET `' .$rel['fieldName']. '`=0 ' .
- 'WHERE `' .$rel['fieldName']. '`=' .$elem['id'];
- }
- }
- // Special 1:n relation for variables
- if ($arrFlags[3] == 2) {
- $strSQL = 'SELECT * FROM `' .$rel['tableName1']. '` WHERE `idMaster`=' .$elem['id'];
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn && ($intDataCount != 0)) {
- foreach ($arrData as $vardata) {
- $strSQL = 'DELETE FROM `tbl_variabledefinition` ' .
- 'WHERE `id`=' .$vardata['idSlave'];
- $this->myDBClass->insertData($strSQL);
- }
- }
- $strSQL = 'DELETE FROM `' .$rel['tableName1']. '` WHERE `idMaster`=' .$elem['id'];
- }
- // Special 1:n relation for time definitions
- if ($arrFlags[3] == 3) {
- $strSQL = 'DELETE FROM `tbl_timedefinition` WHERE `tipId`=' .$elem['id'];
- $this->myDBClass->insertData($strSQL);
- }
- if ($strSQL != '') {
- $this->myDBClass->insertData($strSQL);
- }
- }
- // Delete host configuration file
- if (($strTableName == 'tbl_host') && ($this->intDomainId != 0)) {
- $strSQL = 'SELECT `host_name` FROM `tbl_host` WHERE `id`=' .$elem['id'];
- $strHost = $this->myDBClass->getFieldData($strSQL);
- $this->myConfigClass->getConfigSets($arrConfigId);
- if ($arrConfigId != 1) {
- $intReturn = 0;
- foreach ($arrConfigId as $intConfigId) {
- $intReturn += $this->myConfigClass->moveFile(
- 'host',
- $strHost. '.cfg',
- $intConfigId
- );
- }
- if ($intReturn == 0) {
- $this->processClassMessage(translate('The assigned, no longer used configuration '.
- 'files were deleted successfully!'). '::', $strInfoMessage);
- $this->writeLog(translate('Host file deleted:'). ' ' .$strHost. '.cfg');
- } else {
- $strErrorMessage .= translate('Errors while deleting the old configuration file - '.
- 'please check!:'). ' ::' .$this->myConfigClass->strErrorMessage . '::';
- }
- }
- }
- // Delete service configuration file
- if (($strTableName == 'tbl_service') && ($this->intDomainId != 0)) {
- $strSQL = 'SELECT `config_name` FROM `tbl_service` WHERE `id`=' .$elem['id'];
- $strService = $this->myDBClass->getFieldData($strSQL);
- $strSQL = "SELECT * FROM `tbl_service` WHERE `config_name` = '$strService'";
- $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($intDataCount == 1) {
- $this->myConfigClass->getConfigSets($arrConfigId);
- if ($arrConfigId != 1) {
- $intReturn = 0;
- foreach ($arrConfigId as $intConfigId) {
- $intReturn += $this->myConfigClass->moveFile(
- 'service',
- $strService. '.cfg',
- $intConfigId
- );
- }
- if ($intReturn == 0) {
- $this->processClassMessage(translate('The assigned, no longer used '.
- 'configuration files were deleted successfully!').
- '::', $strInfoMessage);
- $this->writeLog(translate('Host file deleted:'). ' ' .$strService. '.cfg');
- } else {
- $strErrorMessage .= translate('Errors while deleting the old configuration '.
- 'file - please check!:'). '::' .
- $this->myConfigClass->strErrorMessage. '::';
- }
- }
- }
- }
- // Delete main entry
- $strSQL = 'DELETE FROM `' .$strTableName. '` WHERE `id`=' .$elem['id'];
- $this->myDBClass->insertData($strSQL);
- $intDeleteCount++;
- }
- }
- // Process messages
- if ($intDeleteCount == 0) {
- $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist, it is '.
- 'protected from deletion, you do not have write permission or it has relations to other '.
- 'configurations which cannot be deleted. Use the "info" function for detailed informations '.
- 'about relations!'). '::', $this->strErrorMessage);
- return 1;
- }
-
- $this->updateStatusTable($strTableName);
- $this->processClassMessage(translate('Dataset successfully deleted. Affected rows:'). ' ' .
- $intDeleteCount. '::', $this->strInfoMessage);
- $this->writeLog(translate('Deleted data from table:')." $strTableName ".
- translate('- with affected rows:'). ' ' .$intDeleteCount);
- $this->processClassMessage($strInfoMessage, $this->strInfoMessage);
- $this->processClassMessage($strErrorMessage, $this->strErrorMessage);
- return 0;
- }
- $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist, it is '.
- 'protected from deletion or you do not have write permission.'). '::' .
- $this->myDBClass->strErrorMessage, $this->strErrorMessage);
- return 1;
- }
-
- /**
- * Returns an array with any data fields from a table with existing relations to another table. This function
- * returns also passive relations which are not used in configurations.
- * This function is used for a full deletion of a configuration entry or to find out if a configuration is used
- * in another way.
- * @param string $strTable Table name
- * @param array $arrRelations Array with relations
- * @return int 0 = no field with relation / 1 = at least one field with relation
- * Status message is stored in message class variables
- * Data array: tableName Table include the relation data
- * fieldName Field name include the relation data
- * flags Pos 1 -> 0=Normal field / 1=Required field (field type)
- * Pos 2 -> 0=delete / 1=keep data / 2=set to 0 (normal deletion option)
- * Pos 3 -> 0=delete / 2=set to 0 (force deletion option)
- * Pos 4 -> 0=1:1 / 1=1:n / (relation type)
- * 2=1:n (variables) / 3=1:n (timedef)
- */
- public function fullTableRelations($strTable, &$arrRelations)
- {
- // Define variable
- $arrRelations = array();
- $arrData = array();
- $intDC = 0;
- $intReturn = 0;
- // Get relation data
- $strSQL = "SELECT * FROM `tbl_relationinformation` WHERE `master`='$strTable' AND `fullRelation`=1";
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booReturn && ($intDC != 0)) {
- foreach ($arrData as $elem) {
- $arrRelations[] = array('tableName1' => $elem['tableName1'], 'fieldName' => $elem['fieldName'],
- 'target1' => $elem['target1'], 'targetKey' => $elem['targetKey'],
- 'flags' => $elem['flags']);
- }
- $intReturn = 1;
- }
- return $intReturn;
- }
-
- /**
- * Searches any relation in the database and returns them as relation information
- * @param string $strTable Database table name
- * @param int $intMasterId Data ID from master table
- * @param string $strMasterfield Info field name from master table
- * @param int $intReporting Output as text - 0=yes, 1=no
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function infoRelation($strTable, $intMasterId, $strMasterfield, $intReporting = 0)
- {
- $intDeletion = 0;
- $arrDSCount = array();
- $arrRelations = array();
- $arrData = array();
- $arrDataCheck = array();
- $intReturn = $this->fullTableRelations($strTable, $arrRelations);
- if ($intReturn == 1) {
- // Get master field data
- $strNewMasterfield = str_replace(',', '`,`', $strMasterfield);
- $strSQL = 'SELECT `' .$strNewMasterfield. '` FROM `' .$strTable."` WHERE `id` = $intMasterId";
- $this->myDBClass->hasSingleDataset($strSQL, $arrSource);
- if (substr_count($strMasterfield, ',') != 0) {
- $arrTarget = explode(',', $strMasterfield);
- $strName = $arrSource[$arrTarget[0]]. '-' .$arrSource[$arrTarget[1]];
- } else {
- $strName = $arrSource[$strMasterfield];
- }
- $this->strInfoMessage .= '' .translate('Relation information for ').
- $strName.translate(' of table ').$strTable. ':::';
- $this->strInfoMessage .= '';
- // Walk through relations
- foreach ($arrRelations as $elem) {
- // Process flags
- $arrFlags = explode(',', $elem['flags']);
- if ($elem['fieldName'] == 'check_command') {
- $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` ' .
- 'WHERE SUBSTRING_INDEX(`' .$elem['fieldName']."`,'!',1)= $intMasterId";
- } else {
- $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` WHERE `' .$elem['fieldName']."`= $intMasterId";
- }
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- // Take only used relations
- if ($booReturn && ($intDataCount != 0)) {
- // Relation type
- if ($arrFlags[3] == 1) {
- foreach ($arrData as $data) {
- if ($elem['fieldName'] == 'idMaster') {
- $strRef = 'idSlave';
- // Process special tables
- if ($elem['target1'] == 'tbl_service') {
- if ($elem['tableName1'] == 'tbl_lnkServicegroupToService') {
- $strRef = 'idSlaveS';
- }
- } elseif ($elem['target1'] == 'tbl_host') {
- if ($elem['tableName1'] == 'tbl_lnkServicegroupToService') {
- $strRef = 'idSlaveH';
- }
- } elseif ($elem['target1'] == 'tbl_hostgroup') {
- if ($elem['tableName1'] == 'tbl_lnkServicegroupToService') {
- $strRef = 'idSlaveHG';
- }
- }
- } else {
- $strRef = 'idMaster';
- }
- // Get data
- $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` ' .
- 'LEFT JOIN `' .$elem['target1']. '` ON `' .$strRef. '` = `id` ' .
- 'WHERE `' .$elem['fieldName']. '` = ' .$data[$elem['fieldName']]. ' ' .
- 'AND `' .$strRef. '`=' .$data[$strRef];
- $this->myDBClass->hasSingleDataset($strSQL, $arrDSTarget);
- if (substr_count($elem['targetKey'], ',') != 0) {
- $arrTarget = explode(',', $elem['targetKey']);
- $strTarget = $arrDSTarget[$arrTarget[0]]. '-' .$arrDSTarget[$arrTarget[1]];
- } else {
- $strTarget = $arrDSTarget[$elem['targetKey']];
- }
- // If the field is market as "required", check for any other entries
- if ($arrFlags[0] == 1) {
- $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` ' .
- 'WHERE `' .$strRef. '` = ' .$arrDSTarget[$strRef];
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDSCount, $intDCCount);
- if ($booReturn && ($intDCCount > 1)) {
- $this->strInfoMessage .= translate('Relation to ').$elem['target1'].
- translate(', entry ').$strTarget.
- ' - ' .translate('deletion possible').
- '::';
- } else {
- $this->strInfoMessage .= translate('Relation to ').$elem['target1'].
- translate(', entry ').$strTarget.
- ' - ' .
- translate('deletion not possible'). '::';
- $intDeletion = 1;
- }
- } else {
- $this->strInfoMessage .= translate('Relation to ').$elem['target1'].
- translate(', entry ').$strTarget. ' - ' .
- translate('deletion possible'). '::';
- }
- }
- } elseif ($arrFlags[3] == 0) {
- // Fetch remote entry
- $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` '
- . 'WHERE `' .$elem['fieldName']."`=$intMasterId";
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataCheck, $intDCCheck);
- if ($booReturn && ($intDCCheck != 0)) {
- foreach ($arrDataCheck as $data) {
- if (substr_count($elem['targetKey'], ',') != 0) {
- $arrTarget = explode(',', $elem['targetKey']);
- $strTarget = $data[$arrTarget[0]]. '-' .$data[$arrTarget[1]];
- } else {
- $strTarget = $data[$elem['targetKey']];
- }
- if ($arrFlags[0] == 1) {
- $this->strInfoMessage .= translate('Relation to ').$elem['tableName1'].
- translate(', entry ').$strTarget.
- ' - ' .
- translate('deletion not possible'). '::';
- $intDeletion = 1;
- } else {
- $this->strInfoMessage .= translate('Relation to ').$elem['tableName1'].
- translate(', entry ').$strTarget.
- ' - ' .
- translate('deletion possible'). '::';
- }
- }
- }
- }
- }
- }
- $this->strInfoMessage .= '::';
- }
- if ($intReporting == 1) {
- $this->strInfoMessage = '';
- }
- return $intDeletion;
- }
-
- /**
- * Inserts any necessary dataset for an 1:n (optional 1:n:n) relation to the database table
- * @param string $strTable Database table name
- * @param int $intMasterId Data ID from master table
- * @param array $arrSlaveId Array with all data IDs from slave table
- * @param int $intMulti 0 = for 1:n relations
- * 1 = for 1:n:n relations
- * @return int 0 = successful / 1 = error
- */
- public function dataInsertRelation($strTable, $intMasterId, $arrSlaveId, $intMulti = 0)
- {
- // Define variables
- $intReturn = 0;
- $intDataId = 0;
- $strSQL = '';
- // Walk through the slave data ID array
- foreach ($arrSlaveId as $elem) {
- // Pass empty and '*' values
- if ($elem == '0') {
- continue;
- }
- if ($elem == '*') {
- continue;
- }
- // Process exclude values
- if (0 === strpos($elem, 'e')) {
- $elem = str_replace('e', '', $elem);
- $intExclude = 1;
- } else {
- $intExclude = 0;
- }
- // Define the SQL statement
- if ($intMulti != 0) {
- $arrValues = explode('::', $elem);
- $strSQL = 'INSERT INTO `' .$strTable."` SET `idMaster`=$intMasterId, `idSlaveH`=".$arrValues[0]
- . ', `idSlaveHG`=' .$arrValues[1]. ', `idSlaveS`=' .$arrValues[2].", `exclude`=$intExclude";
- } else {
- if (($strTable == 'tbl_lnkServicedependencyToService_DS') ||
- ($strTable == 'tbl_lnkServicedependencyToService_S') ||
- ($strTable == 'tbl_lnkServiceescalationToService')) {
- // Get service description
- $strSQLSrv = "SELECT `service_description` FROM `tbl_service` WHERE id=$elem";
- $strService = $this->myDBClass->getFieldData($strSQLSrv);
- $strSQL = 'INSERT INTO `' .$strTable."` SET `idMaster`=$intMasterId, `idSlave`=$elem, ".
- "`strSlave`='".addslashes($strService)."', `exclude`=$intExclude";
- } elseif (($strTable == 'tbl_lnkServiceToService') ||
- ($strTable == 'tbl_lnkServicetemplateToService')) {
- $arrValues = explode('-', $elem);
- if (isset($arrValues[0]) && isset($arrValues[1])) {
- $strSQL = 'INSERT INTO `' .$strTable."` SET `idMaster`=$intMasterId, `idSlave`=$arrValues[0], "
- ." `idHost`=$arrValues[1]";
- }
- } elseif (($strTable != 'tbl_lnkTimeperiodToTimeperiod') &&
- ($strTable != 'tbl_lnkDatadomainToConfigtarget')) {
- $strSQL = 'INSERT INTO `' . $strTable . '` ' .
- "SET `idMaster`=$intMasterId, `idSlave`=$elem, `exclude`=$intExclude";
- } else {
- $strSQL = 'INSERT INTO `' .$strTable."` SET `idMaster`=$intMasterId, `idSlave`=$elem";
- }
- }
- // Insert data
- $intReturn = $this->dataInsert($strSQL, $intDataId);
- if ($intReturn != 0) {
- $intReturn = 1;
- }
- }
- return $intReturn;
- }
-
- /**
- * Update the datasets for 1:n (optional 1:n:m) relations in the database table
- * @param string $strTable Database table name
- * @param int $intMasterId Data ID from master table
- * @param array $arrSlaveId Array with all data IDs from slave table
- * @param int $intMulti 0 = for 1:n relations
- * 1 = for 1:n:n relations
- * @return int 0 = successful / 1 = error
- */
- public function dataUpdateRelation($strTable, $intMasterId, $arrSlaveId, $intMulti = 0)
- {
- $intReturn = 0;
- // Remove any old relations
- $intReturn1 = $this->dataDeleteRelation($strTable, $intMasterId);
- if ($intReturn1 != 0) {
- $intReturn = 1;
- }
- // Insert the new relations
- if ($intReturn == 0) {
- $intReturn2 = $this->dataInsertRelation($strTable, $intMasterId, $arrSlaveId, $intMulti);
- if ($intReturn2 != 0) {
- $intReturn = 1;
- }
- }
- return $intReturn;
- }
-
- /**
- * Removes any relation from the database
- * @param string $strTable Database table name
- * @param int $intMasterId Data ID from master table
- * @return int 0 = successful / 1 = error
- */
- public function dataDeleteRelation($strTable, $intMasterId)
- {
- // Define variables
- $intDataId = 0;
- // Define the SQL statement
- $strSQL = 'DELETE FROM `' .$strTable."` WHERE `idMaster`=$intMasterId";
- return $this->dataInsert($strSQL, $intDataId);
- }
-
- /**
- * Deactivates one or many datasets in the table be setting 'active' to '0'. Alternatively, a single record
- * ID can be specified or evaluated by the values of $_POST['chbId_n'] passed parameters, where n is the
- * record ID must match.
- * @param string $strTableName Table name
- * @param int $intDataId Individual record ID, which is to be activate
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function dataDeactivate($strTableName, $intDataId = 0)
- {
- // Define variables
- $intReturn = 1;
- $arrData = array();
- // Get write access groups
- $strAccess = $this->myVisClass->getAccessGroups('write');
- // Activate datasets
- $strSQL = 'SELECT `id` FROM `' .$strTableName. '` ' .
- 'WHERE `config_id`=' .$this->intDomainId." AND `access_group` IN ($strAccess)";
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn && ($intDataCount != 0)) {
- $intActivateCount = 0;
- foreach ($arrData as $elem) {
- $strChbName = 'chbId_' .$elem['id'];
- // was the current record is marked for activate?
- if ((($intDataId == $elem['id']) || ((filter_input(INPUT_POST, $strChbName) != null) &&
- (filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) == 'on'))) &&
- $this->infoRelation($strTableName, $elem['id'], 'id', 1) == 0) {
- // Update dataset
- if (($strTableName == 'tbl_service') || ($strTableName == 'tbl_host')) {
- $strSQL = 'UPDATE `' .$strTableName."` SET `active`='0', `last_modified`=now() ".
- 'WHERE `id`=' .$elem['id'];
- } else {
- $strSQL = 'UPDATE `' .$strTableName."` SET `active`='0' WHERE `id`=".$elem['id'];
- }
- $this->myDBClass->insertData($strSQL);
- $intActivateCount++;
- }
- }
- // Process informations
- if ($intActivateCount == 0) {
- $this->processClassMessage(translate('No dataset deactivated. Maybe the dataset does not exist, it '.
- 'is protected from deactivation, no dataset was selected or you do not have write permission. '.
- 'Use the "info" function for detailed informations about relations!').
- '::', $this->strErrorMessage);
- } else {
- $this->updateStatusTable($strTableName);
- $this->processClassMessage(translate('Dataset successfully deactivated. Affected rows:'). ' ' .
- $intActivateCount. '::', $this->strInfoMessage);
- $this->writeLog(translate('Deactivate dataset from table:')." $strTableName ".
- translate('- with affected rows:'). ' ' .$this->myDBClass->intAffectedRows);
- $intReturn = 0;
- }
- } else {
- $this->processClassMessage(translate('No dataset deactivated. Maybe the dataset does not exist or you '.
- 'do not have write permission.'). '::', $this->strErrorMessage);
- }
- return $intReturn;
- }
-
- /**
- * Activates one or many datasets in the table be setting 'active' to '1'. Alternatively, a single record ID can
- * be specified or evaluated by the values of $_POST['chbId_n'] passed parameters, where n is the record ID must
- * match.
- * @param string $strTableName Table name
- * @param int $intDataId Individual record ID, which is to be activate
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function dataActivate($strTableName, $intDataId = 0)
- {
- // Define variables
- $intReturn = 1;
- $arrData = array();
- // Get write access groups
- $strAccess = $this->myVisClass->getAccessGroups('write');
- // Activate datasets
- $strSQL = 'SELECT `id` FROM `' .$strTableName. '` ' .
- 'WHERE `config_id`=' .$this->intDomainId." AND `access_group` IN ($strAccess)";
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn && ($intDataCount != 0)) {
- $intActivateCount = 0;
- foreach ($arrData as $elem) {
- $strChbName = 'chbId_' .$elem['id'];
- // was the current record is marked for activate?
- if (($intDataId == $elem['id']) || ((filter_input(INPUT_POST, $strChbName) != null) &&
- (filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) == 'on'))) {
- // Update dataset
- if (($strTableName == 'tbl_service') || ($strTableName == 'tbl_host')) {
- $strSQL = 'UPDATE `' .$strTableName."` SET `active`='1', `last_modified`=now() ".
- 'WHERE `id`=' .$elem['id'];
- } else {
- $strSQL = 'UPDATE `' .$strTableName."` SET `active`='1' WHERE `id`=".$elem['id'];
- }
- $this->myDBClass->insertData($strSQL);
- $intActivateCount++;
- }
- }
- // Process informations
- if ($intActivateCount == 0) {
- $this->processClassMessage(translate('No dataset activated. Maybe the dataset does not exist, no '.
- 'dataset was selected or you do not have write permission.'). '::', $this->strErrorMessage);
- } else {
- $this->updateStatusTable($strTableName);
- $this->processClassMessage(translate('Dataset successfully activated. Affected rows:'). ' ' .
- $intActivateCount. '::', $this->strInfoMessage);
- $this->writeLog(translate('Activate dataset from table:')." $strTableName ".
- translate('- with affected rows:'). ' ' .$this->myDBClass->intAffectedRows);
- $intReturn = 0;
- }
- } else {
- $this->processClassMessage(translate('No dataset activated. Maybe the dataset does not exist or you do '.
- 'not have write permission.'). '::', $this->strErrorMessage);
- }
- return $intReturn;
- }
-
- /**
- * Updates the hash field im some configuration objects
- * @param string $strTable Table name
- * @param int $intId Data ID
- * @return int 0 = successful / 1 = error
- * Status message is stored in message class variables
- */
- public function updateHash($strTable, $intId)
- {
- // Define variables
- $strRawString = '';
- $arrData = array();
- $intDC = 0;
- $intDataID = 0;
- // Service table
- if ($strTable == 'tbl_service') {
- // Get any hosts and host_groups
- $strSQL = 'SELECT `host_name` AS `item_name` FROM `tbl_host` ' .
- "LEFT JOIN `tbl_lnkServiceToHost` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION SELECT `hostgroup_name` AS `item_name` FROM `tbl_hostgroup` ' .
- 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `idSlave`=`id` ' .
- 'WHERE `idMaster`=' .$intId. ' ORDER BY `item_name`';
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booRet && ($intDC != 0)) {
- foreach ($arrData as $elem) {
- $strRawString .= $elem['item_name']. ',';
- }
- }
- $strSQL = 'SELECT * FROM `tbl_service` WHERE `id`=' .$intId;
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booRet && ($intDC != 0)) {
- if ($arrData[0]['service_description'] != '') {
- $strRawString .= $arrData[0]['service_description']. ',';
- }
- if ($arrData[0]['display_name'] != '') {
- $strRawString .= $arrData[0]['display_name']. ',';
- }
- if ($arrData[0]['check_command'] != '') {
- $arrField = explode('!', $arrData[0]['check_command']);
- $strCommand = strstr($arrData[0]['check_command'], '!');
- $strSQLRel = 'SELECT `command_name` FROM `tbl_command` WHERE `id`=' .$arrField[0];
- $strName = $this->myDBClass->getFieldData($strSQLRel);
- $strRawString .= $strName.$strCommand. ',';
- }
- }
- }
- if (($strTable == 'tbl_hostdependency') || ($strTable == 'tbl_servicedependency')) {
- // Get * values
- $strSQL = 'SELECT * FROM `' .$strTable. '` WHERE `id`=' .$intId;
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booRet && ($intDC != 0)) {
- if (isset($arrData[0]['dependent_host_name']) && ($arrData[0]['dependent_host_name'] == 2)) {
- $strRawString .= 'any,';
- }
- if (isset($arrData[0]['dependent_hostgroup_name']) && ($arrData[0]['dependent_hostgroup_name'] == 2)) {
- $strRawString .= 'any,';
- }
- if (isset($arrData[0]['host_name']) && ($arrData[0]['host_name'] == 2)) {
- $strRawString .= 'any,';
- }
- if (isset($arrData[0]['hostgroup_name']) && ($arrData[0]['hostgroup_name'] == 2)) {
- $strRawString .= 'any,';
- }
- if (isset($arrData[0]['dependent_service_description']) &&
- ($arrData[0]['dependent_service_description'] == 2)) {
- $strRawString .= 'any,';
- }
- if (isset($arrData[0]['service_description']) && ($arrData[0]['service_description'] == 2)) {
- $strRawString .= 'any,';
- }
- }
- if ($strTable == 'tbl_hostdependency') {
- // Get any hosts and host_groups
- $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
- "LEFT JOIN `tbl_lnkHostdependencyToHost_DH` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
- "LEFT JOIN `tbl_lnkHostdependencyToHostgroup_DH` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
- "LEFT JOIN `tbl_lnkHostdependencyToHost_H` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
- 'LEFT JOIN `tbl_lnkHostdependencyToHostgroup_H` ON `idSlave`=`id` WHERE `idMaster`=' .$intId;
- }
- if ($strTable == 'tbl_servicedependency') {
- // Get any hosts and host_groups
- $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
- "LEFT JOIN `tbl_lnkServicedependencyToHost_DH` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
- 'LEFT JOIN `tbl_lnkServicedependencyToHostgroup_DH` ON `idSlave`=`id` ' .
- "WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
- "LEFT JOIN `tbl_lnkServicedependencyToHost_H` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
- 'LEFT JOIN `tbl_lnkServicedependencyToHostgroup_H` ON `idSlave`=`id` ' .
- "WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `strSlave` AS `item_name`, exclude ' .
- "FROM `tbl_lnkServicedependencyToService_DS` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `strSlave` AS `item_name`, exclude ' .
- "FROM `tbl_lnkServicedependencyToService_S` WHERE `idMaster`=$intId";
- }
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booRet && ($intDC != 0)) {
- foreach ($arrData as $elem) {
- if ($elem['exclude'] == 0) {
- $strRawString .= $elem['item_name']. ',';
- } else {
- $strRawString .= 'not_' .$elem['item_name']. ',';
- }
- }
- $strRawString = substr($strRawString, 0, -1);
- }
- }
- if (($strTable == 'tbl_hostescalation') || ($strTable == 'tbl_serviceescalation')) {
- // Get * values
- $strSQL = 'SELECT * FROM `' .$strTable. '` WHERE `id`=' .$intId;
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booRet && ($intDC != 0)) {
- if (isset($arrData[0]['host_name']) && ($arrData[0]['host_name'] == 2)) {
- $strRawString .= 'any,';
- }
- if (isset($arrData[0]['hostgroup_name']) && ($arrData[0]['hostgroup_name'] == 2)) {
- $strRawString .= 'any,';
- }
- if (isset($arrData[0]['contacts']) && ($arrData[0]['contacts'] == 2)) {
- $strRawString .= 'any,';
- }
- if (isset($arrData[0]['contact_groups']) && ($arrData[0]['contact_groups'] == 2)) {
- $strRawString .= 'any,';
- }
- if (isset($arrData[0]['service_description']) && ($arrData[0]['service_description'] == 2)) {
- $strRawString .= 'any,';
- }
- }
- // Get any hosts, host_groups, contacts and contact_groups
- if ($strTable == 'tbl_hostescalation') {
- $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
- "LEFT JOIN `tbl_lnkHostescalationToHost` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
- "LEFT JOIN `tbl_lnkHostescalationToHostgroup` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `contact_name` AS `item_name`, exclude FROM `tbl_contact` ' .
- "LEFT JOIN `tbl_lnkHostescalationToContact` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `contactgroup_name` AS `item_name`, exclude FROM `tbl_contactgroup` ' .
- "LEFT JOIN `tbl_lnkHostescalationToContactgroup` ON `idSlave`=`id` WHERE `idMaster`=$intId";
- }
- if ($strTable == 'tbl_serviceescalation') {
- $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
- "LEFT JOIN `tbl_lnkServiceescalationToHost` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
- "LEFT JOIN `tbl_lnkServiceescalationToHostgroup` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `contact_name` AS `item_name`, exclude FROM `tbl_contact` ' .
- "LEFT JOIN `tbl_lnkServiceescalationToContact` ON `idSlave`=`id` WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `contactgroup_name` AS `item_name`, exclude FROM `tbl_contactgroup` ' .
- 'LEFT JOIN `tbl_lnkServiceescalationToContactgroup` ON `idSlave`=`id` ' .
- "WHERE `idMaster`=$intId ".
- 'UNION ALL SELECT `strSlave` AS `item_name`, exclude ' .
- "FROM `tbl_lnkServiceescalationToService` WHERE `idMaster`=$intId";
- }
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booRet && ($intDC != 0)) {
- foreach ($arrData as $elem) {
- if ($elem['exclude'] == 0) {
- $strRawString .= $elem['item_name']. ',';
- } else {
- $strRawString .= 'not_' .$elem['item_name']. ',';
- }
- }
- $strRawString = substr($strRawString, 0, -1);
- }
- }
- if ($strTable == 'tbl_serviceextinfo') {
- // Get any hosts and host_groups
- $strSQL = 'SELECT `tbl_host`.`host_name` AS `item_name` FROM `tbl_host` ' .
- 'LEFT JOIN `tbl_serviceextinfo` ON `tbl_host`.`id`=`tbl_serviceextinfo`.`host_name` ' .
- "WHERE `tbl_serviceextinfo`.`id`=$intId ".
- 'UNION SELECT `tbl_service`.`service_description` AS `item_name` FROM `tbl_service` ' .
- 'LEFT JOIN `tbl_serviceextinfo` ON ' .
- '`tbl_service`.`id`=`tbl_serviceextinfo`.`service_description` ' .
- "WHERE `tbl_serviceextinfo`.`id`=$intId ORDER BY `item_name`";
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booRet && ($intDC != 0)) {
- foreach ($arrData as $elem) {
- $strRawString .= $elem['item_name']. ',';
- }
- $strRawString = substr($strRawString, 0, -1);
- }
- }
- // Remove blanks
- while (substr_count($strRawString, ' ') != 0) {
- $strRawString = str_replace(' ', '', $strRawString);
- }
- // Sort hash string
- $arrTemp = explode(',', $strRawString);
- sort($arrTemp);
- $strRawString = implode(',', $arrTemp);
- // Update has in database
- $strSQL = 'UPDATE `' .$strTable."` SET `import_hash`='".sha1($strRawString)."' WHERE `id`='$intId'";
- //echo "Hash: ".$strRawString." --> ".sha1($strRawString)." ";
- return $this->dataInsert($strSQL, $intDataID);
- }
-
- /**
- * PRIVATE functions
- */
-
- /**
- * Manually set some NULL values based on field names (key)
- * @param string $strTableName Table name
- * @param string $key Data key (field name)
- * @param string $value Data value (field key)
- * @return NULL|string Manipulated data value
- */
- private function setNullValues($strTableName, $key, $value)
- {
- $arrNull = array('normal_check_interval', 'retry_check_interval', 'max_check_attempts', 'low_flap_threshold',
- 'high_flap_threshold', 'freshness_threshold', 'notification_interval', 'first_notification_delay',
- 'check_interval', 'retry_interval');
- if (\in_array($key, $arrNull, true) && ($value == '')) {
- $value = 'NULL';
- }
- // manually set some NULL values based on table name
- if (($strTableName == 'tbl_serviceextinfo') && ($key == 'service_description')) {
- $value = '0';
- }
- // Do not copy the password in tbl_user
- if (($strTableName == 'tbl_user') && ($key == 'password')) {
- $value = 'xxxxxxx';
- }
- // Do not copy nodelete and webserver authentification values in tbl_user
- if ($key == 'nodelete') {
- $value = '0';
- }
- if ($key == 'wsauth') {
- $value = '0';
- }
- return $value;
- }
-
/**
* Insert a normal 1:n relation
- * @param array $arrData Database value array
- * @param integer $intID Database array key
- * @param array $elem Link table information
- * @param integer $intMasterId Data ID of master table
- * @param integer $intCheck Check error counter (before processing)
- * @return integer Check error counter (after processing)
+ * @param array $arrData Database value array
+ * @param integer $intID Database array key
+ * @param array $elem Link table information
+ * @param integer $intMasterId Data ID of master table
+ * @param integer $intCheck Check error counter (before processing)
+ * @return integer Check error counter (after processing)
*/
- private function insertRelationType2($arrData, $intID, $elem, $intMasterId, $intCheck)
+ private function insertRelationType2(array $arrData, int $intID, array $elem, int $intMasterId, int $intCheck): int
{
- $arrRelData = array();
+ $arrRelData = array();
$intRelDataCount = 0;
- if ($arrData[$intID][$elem['fieldName']] != 0) {
- $strSQL = 'SELECT `idSlave`, `exclude` FROM `' .$elem['linkTable']. '` ' .
- 'WHERE `idMaster`=' .$arrData[$intID]['id'];
+ if ((int)$arrData[$intID][$elem['fieldName']] !== 0) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `idSlave`, `exclude` FROM `' . $elem['linkTable'] . '` ' .
+ 'WHERE `idMaster`=' . $arrData[$intID]['id'];
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount);
- if ($booReturn && ($intRelDataCount != 0)) {
+ if ($booReturn && ($intRelDataCount !== 0)) {
foreach ($arrRelData as $elem2) {
+ /** @noinspection SqlResolve */
$strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' .
"SET `idMaster`=$intMasterId, `idSlave`=" . $elem2['idSlave'] . ', ' .
'`exclude`=' . $elem2['exclude'];
$booReturn = $this->myDBClass->insertData($strSQLRel);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
}
@@ -1297,28 +414,30 @@ class NagDataClass
/**
* Insert a 1:n relation for templates
- * @param array $arrData Database value array
- * @param integer $intID Database array key
- * @param array $elem Link table information
- * @param integer $intMasterId Data ID of master table
- * @param integer $intCheck Check error counter (before processing)
- * @return integer Check error counter (after processing)
+ * @param array $arrData Database value array
+ * @param integer $intID Database array key
+ * @param array $elem Link table information
+ * @param integer $intMasterId Data ID of master table
+ * @param integer $intCheck Check error counter (before processing)
+ * @return integer Check error counter (after processing)
*/
- private function insertRelationType3($arrData, $intID, $elem, $intMasterId, $intCheck)
+ private function insertRelationType3(array $arrData, int $intID, array $elem, int $intMasterId, int $intCheck): int
{
- $arrRelData = array();
+ $arrRelData = array();
$intRelDataCount = 0;
- if ($arrData[$intID][$elem['fieldName']] == 1) {
+ if ((int)$arrData[$intID][$elem['fieldName']] === 1) {
+ /** @noinspection SqlResolve */
$strSQL = 'SELECT `idSlave`,`idSort`,`idTable` FROM `' . $elem['linkTable'] . '` ' .
'WHERE `idMaster`=' . $arrData[$intID]['id'];
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount);
- if ($booReturn && ($intRelDataCount != 0)) {
+ if ($booReturn && ($intRelDataCount !== 0)) {
foreach ($arrRelData as $elem2) {
+ /** @noinspection SqlResolve */
$strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' .
"SET `idMaster`=$intMasterId, `idSlave`=" . $elem2['idSlave'] . ', ' .
'`idTable`=' . $elem2['idTable'] . ', `idSort`=' . $elem2['idSort'];
$booReturn = $this->myDBClass->insertData($strSQLRel);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
}
@@ -1329,42 +448,44 @@ class NagDataClass
/**
* Insert a special relation for free variables
- * @param array $arrData Database value array
- * @param integer $intID Database array key
- * @param array $elem Link table information
- * @param integer $intMasterId Data ID of master table
- * @param integer $intCheck Check error counter (before processing)
- * @return integer Check error counter (after processing)
+ * @param array $arrData Database value array
+ * @param integer $intID Database array key
+ * @param array $elem Link table information
+ * @param integer $intMasterId Data ID of master table
+ * @param integer $intCheck Check error counter (before processing)
+ * @return integer Check error counter (after processing)
*/
- private function insertRelationType4($arrData, $intID, $elem, $intMasterId, $intCheck)
+ private function insertRelationType4(array $arrData, int $intID, array $elem, int $intMasterId, int $intCheck): int
{
- $arrRelData = array();
- $arrDataVar = array();
+ $arrRelData = array();
+ $arrDataVar = array();
$intRelDataCount = 0;
- $intDCVar = 0;
- if ($arrData[$intID][$elem['fieldName']] != 0) {
+ $intDCVar = 0;
+ if ((int)$arrData[$intID][$elem['fieldName']] !== 0) {
+ /** @noinspection SqlResolve */
$strSQL = 'SELECT `idSlave` FROM `' . $elem['linkTable'] . '` ' .
'WHERE `idMaster` = ' . $arrData[$intID]['id'];
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount);
- if ($booReturn && ($intRelDataCount != 0)) {
+ if ($booReturn && ($intRelDataCount !== 0)) {
foreach ($arrRelData as $elem2) {
- // Copy variables and link them to the new master
+ /* Copy variables and link them to the new master */
$strSQLVar = 'SELECT * FROM `tbl_variabledefinition` WHERE `id`=' . $elem2['idSlave'];
$booReturn = $this->myDBClass->hasDataArray($strSQLVar, $arrDataVar, $intDCVar);
- if ($booReturn && ($intDCVar != 0)) {
+ if ($booReturn && ($intDCVar !== 0)) {
$strSQLInsVar = 'INSERT INTO `tbl_variabledefinition` ' .
"SET `name`='" . addslashes($arrDataVar[0]['name']) . "', " .
"`value`='" . addslashes($arrDataVar[0]['value']) . "', " .
'`last_modified`=NOW()';
$booReturn = $this->myDBClass->insertData($strSQLInsVar);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
+ /** @noinspection SqlResolve */
$strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' .
"SET `idMaster`=$intMasterId, " .
'`idSlave`=' . $this->myDBClass->intLastId;
$booReturn = $this->myDBClass->insertData($strSQLRel);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
}
@@ -1376,28 +497,30 @@ class NagDataClass
/**
* Insert a 1:n relation for tbl_lnkServicegroupToService
- * @param array $arrData Database value array
- * @param integer $intID Database array key
- * @param array $elem Link table information
- * @param integer $intMasterId Data ID of master table
- * @param integer $intCheck Check error counter (before processing)
- * @return integer Check error counter (after processing)
+ * @param array $arrData Database value array
+ * @param integer $intID Database array key
+ * @param array $elem Link table information
+ * @param integer $intMasterId Data ID of master table
+ * @param integer $intCheck Check error counter (before processing)
+ * @return integer Check error counter (after processing)
*/
- private function insertRelationType5($arrData, $intID, $elem, $intMasterId, $intCheck)
+ private function insertRelationType5(array $arrData, int $intID, array $elem, int $intMasterId, int $intCheck): int
{
- $arrRelData = array();
+ $arrRelData = array();
$intRelDataCount = 0;
- if ($arrData[$intID][$elem['fieldName']] != 0) {
- $strSQL = 'SELECT `idSlaveH`,`idSlaveHG`,`idSlaveS` ' .
+ if ((int)$arrData[$intID][$elem['fieldName']] !== 0) {
+ $strSQL = 'SELECT `idSlaveH`,`idSlaveHG`,`idSlaveS`,`exclude` ' .
'FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData[$intID]['id'];
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount);
- if ($booReturn && ($intRelDataCount != 0)) {
+ if ($booReturn && ($intRelDataCount !== 0)) {
foreach ($arrRelData as $elem2) {
+ /** @noinspection SqlResolve */
$strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' .
"SET `idMaster`=$intMasterId, `idSlaveH`=" . $elem2['idSlaveH'] . ', ' .
- '`idSlaveHG`=' . $elem2['idSlaveHG'] . ', `idSlaveS`=' . $elem2['idSlaveS'];
+ '`idSlaveHG`=' . $elem2['idSlaveHG'] . ', `idSlaveS`=' . $elem2['idSlaveS'] . ', `exclude`=' .
+ $elem2['exclude'];
$booReturn = $this->myDBClass->insertData($strSQLRel);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
}
@@ -1408,29 +531,30 @@ class NagDataClass
/**
* Insert a 1:n relation for services
- * @param array $arrData Database value array
- * @param integer $intID Database array key
- * @param array $elem Link table information
- * @param integer $intMasterId Data ID of master table
- * @param integer $intCheck Check error counter (before processing)
- * @return integer Check error counter (after processing)
+ * @param array $arrData Database value array
+ * @param integer $intID Database array key
+ * @param array $elem Link table information
+ * @param integer $intMasterId Data ID of master table
+ * @param integer $intCheck Check error counter (before processing)
+ * @return integer Check error counter (after processing)
*/
- private function insertRelationType6($arrData, $intID, $elem, $intMasterId, $intCheck)
+ private function insertRelationType6(array $arrData, int $intID, array $elem, int $intMasterId, int $intCheck): int
{
- $arrRelData = array();
+ $arrRelData = array();
$intRelDataCount = 0;
- if ($arrData[$intID][$elem['fieldName']] != 0) {
+ if ((int)$arrData[$intID][$elem['fieldName']] !== 0) {
$strSQL = 'SELECT `idSlave`, `strSlave`, `exclude` ' .
'FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData[$intID]['id'];
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount);
- if ($booReturn && ($intRelDataCount != 0)) {
+ if ($booReturn && ($intRelDataCount !== 0)) {
foreach ($arrRelData as $elem2) {
+ /** @noinspection SqlResolve */
$strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' .
"SET `idMaster`=$intMasterId, `idSlave`=" . $elem2['idSlave'] . ', ' .
"`strSlave`='" . addslashes($elem2['strSlave']) . "', " .
'`exclude`=' . $elem2['exclude'];
$booReturn = $this->myDBClass->insertData($strSQLRel);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
}
@@ -1441,25 +565,25 @@ class NagDataClass
/**
* Insert a 1:n relation for time definitions
- * @param array $arrData Database value array
- * @param integer $intID Database array key
- * @param integer $intMasterId Data ID of master table
- * @param integer $intCheck Check error counter (before processing)
- * @return integer Check error counter (after processing)
+ * @param array $arrData Database value array
+ * @param integer $intID Database array key
+ * @param integer $intMasterId Data ID of master table
+ * @param integer $intCheck Check error counter (before processing)
+ * @return integer Check error counter (after processing)
*/
- private function insertRelationTimedefinition($arrData, $intID, $intMasterId, $intCheck)
+ private function insertRelationTimedefinition(array $arrData, int $intID, int $intMasterId, int $intCheck): int
{
$arrRelDataTP = array();
$intRelDataCountTP = 0;
$strSQL = 'SELECT * FROM `tbl_timedefinition` WHERE `tipId`=' . $arrData[$intID]['id'];
$this->myDBClass->hasDataArray($strSQL, $arrRelDataTP, $intRelDataCountTP);
- if ($intRelDataCountTP != 0) {
+ if ($intRelDataCountTP !== 0) {
foreach ($arrRelDataTP as $elem) {
$strSQLRel = 'INSERT INTO `tbl_timedefinition` (`tipId`,`definition`,`range`,' .
"`last_modified`) VALUES ($intMasterId,'" . addslashes($elem['definition']) . "'," .
"'" . addslashes($elem['range']) . "',now())";
$booReturn = $this->myDBClass->insertData($strSQLRel);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
}
@@ -1469,25 +593,25 @@ class NagDataClass
/**
* Insert a 1:n relation for user groups
- * @param array $arrData Database value array
- * @param integer $intID Database array key
- * @param integer $intMasterId Data ID of master table
- * @param integer $intCheck Check error counter (before processing)
- * @return integer Check error counter (after processing)
+ * @param array $arrData Database value array
+ * @param integer $intID Database array key
+ * @param integer $intMasterId Data ID of master table
+ * @param integer $intCheck Check error counter (before processing)
+ * @return integer Check error counter (after processing)
*/
- private function insertRelationGroup($arrData, $intID, $intMasterId, $intCheck)
+ private function insertRelationGroup(array $arrData, int $intID, int $intMasterId, int $intCheck): int
{
$arrRelDataTP = array();
$intRelDataCountTP = 0;
$strSQL = 'SELECT * FROM `tbl_lnkGroupToUser` WHERE `idMaster`=' . $arrData[$intID]['id'];
$this->myDBClass->hasDataArray($strSQL, $arrRelDataTP, $intRelDataCountTP);
- if ($intRelDataCountTP != 0) {
+ if ($intRelDataCountTP !== 0) {
foreach ($arrRelDataTP as $elem2) {
$strSQLRel = 'INSERT INTO `tbl_lnkGroupToUser` (`idMaster`,`idSlave`,`read`,`write`,`link`) ' .
- "VALUES ($intMasterId,'" . $elem2['idSlave'] . "','" . $elem2['read'] . "',".
+ "VALUES ($intMasterId,'" . $elem2['idSlave'] . "','" . $elem2['read'] . "'," .
"'" . $elem2['write'] . "','" . $elem2['link'] . "')";
$booReturn = $this->myDBClass->insertData($strSQLRel);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
}
@@ -1497,24 +621,24 @@ class NagDataClass
/**
* Insert a 1:n relation fot service to host connections
- * @param array $arrData Database value array
- * @param integer $intID Database array key
- * @param integer $intMasterId Data ID of master table
- * @param integer $intCheck Check error counter (before processing)
- * @return integer Check error counter (after processing)
+ * @param array $arrData Database value array
+ * @param integer $intID Database array key
+ * @param integer $intMasterId Data ID of master table
+ * @param integer $intCheck Check error counter (before processing)
+ * @return integer Check error counter (after processing)
*/
- private function insertRelationHost($arrData, $intID, $intMasterId, $intCheck)
+ private function insertRelationHost(array $arrData, int $intID, int $intMasterId, int $intCheck): int
{
$arrRelDataSH = array();
$intRelDataCountSH = 0;
$strSQL = 'SELECT * FROM `tbl_lnkServiceToHost` WHERE `idSlave`=' . $arrData[$intID]['id'];
$this->myDBClass->hasDataArray($strSQL, $arrRelDataSH, $intRelDataCountSH);
- if ($intRelDataCountSH != 0) {
+ if ($intRelDataCountSH !== 0) {
foreach ($arrRelDataSH as $elem2) {
$strSQLRel = 'INSERT INTO `tbl_lnkServiceToHost` (`idMaster`,`idSlave`,`exclude`) ' .
"VALUES ('" . $elem2['idMaster'] . "',$intMasterId,'" . $elem2['exclude'] . "')";
$booReturn = $this->myDBClass->insertData($strSQLRel);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$intCheck++;
}
}
@@ -1523,78 +647,1000 @@ class NagDataClass
}
/**
- * Build an INSERT command based on the table name
- * @param string $strTableName Table name
- * @param string $strKeyField Configuration field name
- * @param int $intDomainId Domain ID
- * @param string $strNewName New configuration name
- * @param array $arrData Data array
- * @param int $intID Data array key
- * @return string SQL INSERT command
+ * Saving a given string to the logbook
+ * @param string $strLogMessage Message string
+ * @return int 0 = successful / 1 = error
*/
- private function buildInsertSQL($strTableName, $strKeyField, $intDomainId, $strNewName, $arrData, $intID)
+ public function writeLog(string $strLogMessage): int
{
- $strSQLInsert = 'INSERT INTO `' . $strTableName . '` SET `' . $strKeyField . "`='" . $strNewName . "'";
- /** @noinspection ForeachSourceInspection */
- foreach ($arrData[$intID] as $key => $value) {
- if (($key != $strKeyField) && ($key != 'active') && ($key != 'last_modified') &&
- ($key != 'id') && ($key != 'config_id')) {
- // manually set some NULL values based on field names
- $value = $this->setNullValues($strTableName, $key, $value);
- // If the data value is not "NULL", add single quotes to the value
- if ($value != 'NULL') {
- $strSQLInsert .= ',`' . $key . "`='" . addslashes($value) . "'";
- } else {
- $strSQLInsert .= ',`' . $key . '`=' . $value;
- }
+ /* Variable definition */
+ $strRemoteAdress = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
+ $intReturn = 0;
+ /* Write log message to database */
+ if ($strRemoteAdress !== null) {
+ /* Webinterface */
+ $strUserName = $this->strUserName;
+ $strDomain = $this->myDBClass->getFieldData('SELECT `domain` FROM `tbl_datadomain` ' .
+ 'WHERE `id`=' . $this->intDomainId);
+ $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='" . $strUserName . "'," .
+ "`time`=NOW(), `ipadress`='" . $strRemoteAdress . "', `domain`='$strDomain'," .
+ "`entry`='" . addslashes($strLogMessage) . "'");
+ } else {
+ /* Scriptinginterface */
+ $strUserName = 'scripting';
+ $strRemoteUser = filter_input(INPUT_SERVER, 'REMOTE_USER', FILTER_UNSAFE_RAW);
+ $strHostname = filter_input(INPUT_SERVER, 'REMOTE_HOST', FILTER_UNSAFE_RAW);
+ $strSSHClient = filter_input(INPUT_SERVER, 'SSH_CLIENT', FILTER_UNSAFE_RAW);
+ if ($strRemoteUser !== null) {
+ $strUserName .= ' - ' . $strRemoteUser;
+ }
+ $strDomain = $this->myDBClass->getFieldData('SELECT `domain` FROM `tbl_datadomain` ' .
+ 'WHERE `id`=' . $this->intDomainId);
+ if ($strHostname !== null) {
+ $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='" . $strUserName . "'," .
+ "`time`=NOW(), `ipadress`='" . $strHostname . "', `domain`='$strDomain', " .
+ "`entry`='" . addslashes($strLogMessage) . "'");
+ } elseif ($strSSHClient !== null) {
+ $arrSSHClient = explode(' ', $strSSHClient);
+ $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='" . $strUserName . "'," .
+ "`time`=NOW(), `ipadress`='" . $arrSSHClient[0] . "', `domain`='$strDomain', " .
+ "`entry`='" . addslashes($strLogMessage) . "'");
+ } else {
+ $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='" . $strUserName . "'," .
+ "`time`=NOW(), `ipadress`='unknown', `domain`='$strDomain', " .
+ "`entry`='" . addslashes($strLogMessage) . "'");
}
}
- if (($strTableName == 'tbl_user') || ($strTableName == 'tbl_group') ||
- ($strTableName == 'tbl_datadomain') || ($strTableName == 'tbl_configtarget')) {
- $strSQLInsert .= ",`active`='0', `last_modified`=NOW()";
- } else {
- $strSQLInsert .= ",`active`='0', `config_id`=$intDomainId, `last_modified`=NOW()";
+ if ($booReturn === false) {
+ $intReturn = 1;
}
- return $strSQLInsert;
+ return $intReturn;
}
/**
- * Build a temporary configuration name
- * @param string $strTableName Table name
- * @param string $strKeyField Configuration field name
- * @param int $intDomainId Domain ID
- * @param int $intCount Dataset counter
- * @param array $arrData Data array
- * @param int $intID Data array key
- * @return string Temporary configuration name
+ * Update the date inside the status table (used for last modified date)
+ * @param string $strTable Table name
+ * @return int 0 = successful / 1 = error
*/
- private function buildTempConfigName($strTableName, $strKeyField, $intDomainId, $intCount, $arrData, $intID)
+ public function updateStatusTable(string $strTable): int
{
- // Define variables
- $strNewName = '';
- for ($y = 1; $y <= $intCount; $y++) {
- $strNewName = $arrData[$intID][$strKeyField] . " ($y)";
- if (($strTableName == 'tbl_user') || ($strTableName == 'tbl_group') ||
- ($strTableName == 'tbl_datadomain') || ($strTableName == 'tbl_configtarget')) {
- $strSQL = 'SELECT `id` FROM `' . $strTableName . '` WHERE `' . $strKeyField . "`='$strNewName'";
- $booReturn = $this->myDBClass->getFieldData($strSQL);
- } else {
- $strSQL = 'SELECT `id` FROM `' . $strTableName . '` ' .
- 'WHERE `' . $strKeyField . "`='$strNewName' AND `config_id`=$intDomainId";
- $booReturn = $this->myDBClass->getFieldData($strSQL);
+ /* Define variable */
+ $arrData = array();
+ $intDC = 0;
+ $intReturn = 1;
+ /* Does the entry exist? */
+ $strSQL = "SELECT * FROM `tbl_tablestatus` WHERE `tableName`='$strTable' AND `domainId`=" . $this->intDomainId;
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booReturn && ($intDC !== 0)) {
+ $strSQL = 'UPDATE `tbl_tablestatus` SET `updateTime`=NOW() ' .
+ "WHERE `tableName`='$strTable' AND `domainId`=" . $this->intDomainId;
+ $booReturn = $this->dataInsert($strSQL, $intDataID);
+ if ($booReturn) {
+ $intReturn = 0;
}
- // If the name is unused -> break the loop
- if ($booReturn == false) {
- break;
+ } elseif ($booReturn) {
+ $strSQL = 'INSERT INTO `tbl_tablestatus` ' .
+ "SET `updateTime`=NOW(), `tableName`='$strTable', `domainId`=" . $this->intDomainId;
+ $booReturn = $this->dataInsert($strSQL, $intDataID);
+ if ($booReturn) {
+ $intReturn = 0;
}
}
- // Manually overwrite new name for extinfo tables
- if ($strTableName == 'tbl_hostextinfo') {
- $strNewName = '0';
- }
- if ($strTableName == 'tbl_serviceextinfo') {
- $strNewName = '0';
- }
- return $strNewName;
+ return $intReturn;
}
-}
+
+ /**
+ * PRIVATE functions
+ */
+
+ /**
+ * Sends an SQL string to the database server
+ * @param string $strSQL SQL Command
+ * @param int|null $intDataID Data ID of last inserted dataset (by reference)
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ public function dataInsert(string $strSQL, int &$intDataID = null): int
+ {
+ /* Define variables */
+ $intReturn = 0;
+ /* Send the SQL command to the database server */
+ $booReturn = $this->myDBClass->insertData($strSQL);
+ $intDataID = $this->myDBClass->intLastId;
+ /* Was the SQL command processed successfully? */
+ if ($booReturn) {
+ $this->processClassMessage(translate('Data were successfully inserted to the data base!') .
+ '::', $this->strInfoMessage);
+ } else {
+ $this->processClassMessage(translate('Error while inserting the data into the database:') .
+ '::' . $this->myDBClass->strErrorMessage . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Removes one or more dataset(s) from a table. Optinal a single data ID can be passed or the values will be
+ * processed through the POST variable $_POST['chbId_n'] where 'n' represents the data ID.
+ * -> This function does not delete any relation data! <-
+ * @param string $strTableName Table name
+ * @param int $intDataId Single data ID
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ public function dataDeleteEasy(string $strTableName, int $intDataId = 0): int
+ {
+ /* Define variables */
+ $strNoDelete1 = '';
+ $strNoDelete2 = '';
+ $intReturn = 0;
+ $arrData = array();
+ /* Special rule for tables with "nodelete" cells */
+ if (($strTableName === 'tbl_datadomain') || ($strTableName === 'tbl_configtarget') ||
+ ($strTableName === 'tbl_user')) {
+ $strNoDelete1 = "AND `nodelete` <> '1'";
+ $strNoDelete2 = "WHERE `nodelete` <> '1'";
+ }
+ /* Delete a single data set */
+ if ($intDataId !== 0) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $strTableName . "` WHERE `id` = $intDataId $strNoDelete1";
+ $booReturn = $this->myDBClass->insertData($strSQL);
+ if ($booReturn === false) {
+ $this->processClassMessage(translate('Delete failed because a database error:') .
+ '::' . $this->myDBClass->strErrorMessage . '::', $this->strInfoMessage);
+ $intReturn = 1;
+ } elseif ($this->myDBClass->intAffectedRows === 0) {
+ $this->processClassMessage(translate('No data deleted. The dataset probably does not exist or ' .
+ 'is protected from deletion.') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ } else {
+ $this->strInfoMessage .= translate('Dataset successfully deleted. Affected rows:') . ' ' .
+ $this->myDBClass->intAffectedRows . '::';
+ $this->writeLog(translate('Delete dataset id:') . " $intDataId " . translate('- from table:') .
+ " $strTableName " . translate('- with affected rows:') . ' ' . $this->myDBClass->intAffectedRows);
+ $this->updateStatusTable($strTableName);
+ }
+ /* Delete data sets based on form POST parameter */
+ } else {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTableName . '` ';
+ $strSQL .= $strNoDelete2;
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
+ if ($booReturn && ($intDataCount !== 0)) {
+ $intDeleteCount = 0;
+ foreach ($arrData as $elem) {
+ $strChbName = 'chbId_' . $elem['id'];
+ /* Should this data id to be deleted? */
+ if ((filter_input(INPUT_POST, $strChbName) !== null) &&
+ (filter_input(INPUT_POST, $strChbName, FILTER_UNSAFE_RAW) === 'on')) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $strTableName . '` WHERE `id` = ' . $elem['id'];
+ $booReturn = $this->myDBClass->insertData($strSQL);
+ if ($booReturn === false) {
+ $this->processClassMessage(translate('Delete failed because a database error:') .
+ '::' . $this->myDBClass->strErrorMessage . '::', $this->strInfoMessage);
+ $intReturn = 1;
+ } else {
+ $intDeleteCount += $this->myDBClass->intAffectedRows;
+ }
+ }
+ }
+ /* Process messsages */
+ if ($intDeleteCount === 0) {
+ $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or ' .
+ 'it is protected from delete.') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ } elseif ($intReturn === 0) {
+ $this->processClassMessage(translate('Dataset successfully deleted. Affected rows:') . ' ' .
+ $intDeleteCount . '::', $this->strInfoMessage);
+ $this->writeLog(translate('Deleted data from table:') . " $strTableName " .
+ translate('- with affected rows:') . ' ' . $this->myDBClass->intAffectedRows);
+ $this->updateStatusTable($strTableName);
+ }
+ } else {
+ $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or it is ' .
+ 'protected from delete.') . '::', $this->strErrorMessage);
+ $intReturn = 1;
+ }
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Removes one or more dataset(s) from a table. Optinal a single data ID can be passed or the values will be
+ * processed through the POST variable $_POST['chbId_n'] where 'n' represents the data ID.
+ * -> This function does also delete relation data! <-
+ * @param string $strTableName Table name
+ * @param int $intDataId Single data ID
+ * @param int $intForce Force deletion (1 = force, 1 = no force)
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ public function dataDeleteFull(string $strTableName, int $intDataId = 0, int $intForce = 0): int
+ {
+ /* Define variables */
+ $arrRelations = array();
+ $arrData = array();
+ $arrConfigId = array();
+ /* Get write access groups */
+ $strAccess = $this->myVisClass->getAccessGroups('write');
+ /* Get all relations */
+ $this->fullTableRelations($strTableName, $arrRelations);
+ /* Get all datasets */
+ if ($strTableName === 'tbl_group') {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTableName . '`';
+ } else {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTableName . '` ' .
+ 'WHERE `config_id`=' . $this->intDomainId . " AND `access_group` IN ($strAccess)";
+ }
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
+ if ($booReturn && ($intDataCount !== 0)) {
+ $intDeleteCount = 0;
+ $strInfoMessage = '';
+ $strErrorMessage = '';
+
+ foreach ($arrData as $elem) {
+ $strChbName = 'chbId_' . $elem['id'];
+ /* Single ID */
+ if (($intDataId !== 0) && ($intDataId !== (int)$elem['id'])) {
+ continue;
+ }
+ /* Should this data id to be deleted? */
+ if ((($intDataId === (int)$elem['id']) || ((filter_input(INPUT_POST, $strChbName) !== null) &&
+ (filter_input(INPUT_POST, $strChbName, FILTER_UNSAFE_RAW) === 'on'))) &&
+ (($this->infoRelation($strTableName, $elem['id'], 'id', 1) === 0) || ($intForce === 1))) {
+ /* Delete relations */
+ if (!is_array($arrRelations)) {
+ $arrRelations = array();
+ }
+ foreach ($arrRelations as $rel) {
+ $strSQL = '';
+ /* Process flags */
+ $arrFlags = explode(',', $rel['flags']);
+ /* Simple 1:n relation */
+ if ((int)$arrFlags[3] === 1) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $rel['tableName1'] . '` ' .
+ 'WHERE `' . $rel['fieldName'] . '`=' . $elem['id'];
+ }
+ /* Simple 1:1 relation */
+ if ((int)$arrFlags[3] === 0) {
+ /* Delete relation */
+ if ((int)$arrFlags[2] === 0) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $rel['tableName1'] . '` ' .
+ 'WHERE `' . $rel['fieldName'] . '`=' . $elem['id'];
+ /* Set slave to 0 */
+ } elseif ((int)$arrFlags[2] === 2) {
+ $strSQL = 'UPDATE `' . $rel['tableName1'] . '` SET `' . $rel['fieldName'] . '`=0 ' .
+ 'WHERE `' . $rel['fieldName'] . '`=' . $elem['id'];
+ }
+ }
+ /* Special 1:n relation for variables */
+ if ((int)$arrFlags[3] === 2) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $rel['tableName1'] . '` WHERE `idMaster`=' . $elem['id'];
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
+ if ($booReturn && ($intDataCount !== 0)) {
+ foreach ($arrData as $vardata) {
+ $strSQL = 'DELETE FROM `tbl_variabledefinition` ' .
+ 'WHERE `id`=' . $vardata['idSlave'];
+ $this->myDBClass->insertData($strSQL);
+ }
+ }
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $rel['tableName1'] . '` WHERE `idMaster`=' . $elem['id'];
+ }
+ /* Special 1:n relation for time definitions */
+ if ((int)$arrFlags[3] === 3) {
+ $strSQL = 'DELETE FROM `tbl_timedefinition` WHERE `tipId`=' . $elem['id'];
+ $this->myDBClass->insertData($strSQL);
+ }
+ if ($strSQL !== '') {
+ $this->myDBClass->insertData($strSQL);
+ }
+ }
+ /* Delete host configuration file */
+ if (($strTableName === 'tbl_host') && ($this->intDomainId !== 0)) {
+ $strSQL = 'SELECT `host_name` FROM `tbl_host` WHERE `id`=' . $elem['id'];
+ $strHost = $this->myDBClass->getFieldData($strSQL);
+ $intRetConf = $this->myConfigClass->getConfigSets($arrConfigId);
+ if ($intRetConf !== 1) {
+ $intReturn = 0;
+ foreach ($arrConfigId as $intConfigId) {
+ $intReturn += $this->myConfigClass->moveFile(
+ 'host',
+ $strHost . '.cfg',
+ $intConfigId
+ );
+ }
+ if ($intReturn === 0) {
+ $this->processClassMessage(translate('The assigned, no longer used configuration ' .
+ 'files were deleted successfully!') . '::', $strInfoMessage);
+ $this->writeLog(translate('Host file deleted:') . ' ' . $strHost . '.cfg');
+ } else {
+ $strErrorMessage .= translate('Errors while deleting the old configuration file - ' .
+ 'please check!:') . ' ::' . $this->myConfigClass->strErrorMessage . '::';
+ }
+ }
+ }
+ /* Delete service configuration file */
+ if (($strTableName === 'tbl_service') && ($this->intDomainId !== 0)) {
+ $strSQL = 'SELECT `config_name` FROM `tbl_service` WHERE `id`=' . $elem['id'];
+ $strService = $this->myDBClass->getFieldData($strSQL);
+ $strSQL = "SELECT * FROM `tbl_service` WHERE `config_name` = '$strService'";
+ $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
+ if ($intDataCount === 1) {
+ $intRetConf = $this->myConfigClass->getConfigSets($arrConfigId);
+ if ($intRetConf !== 1) {
+ $intReturn = 0;
+ foreach ($arrConfigId as $intConfigId) {
+ $intReturn += $this->myConfigClass->moveFile(
+ 'service',
+ $strService . '.cfg',
+ $intConfigId
+ );
+ }
+ if ($intReturn === 0) {
+ $this->processClassMessage(translate('The assigned, no longer used ' .
+ 'configuration files were deleted successfully!') .
+ '::', $strInfoMessage);
+ $this->writeLog(translate('Host file deleted:') . ' ' . $strService . '.cfg');
+ } else {
+ $strErrorMessage .= translate('Errors while deleting the old configuration ' .
+ 'file - please check!:') . '::' .
+ $this->myConfigClass->strErrorMessage . '::';
+ }
+ }
+ }
+ }
+ /* Delete main entry */
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $strTableName . '` WHERE `id`=' . $elem['id'];
+ $this->myDBClass->insertData($strSQL);
+ $intDeleteCount++;
+ }
+ }
+ /* Process messages */
+ if ($intDeleteCount === 0) {
+ $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist, it is ' .
+ 'protected from deletion, you do not have write permission or it has relations to other ' .
+ 'configurations which cannot be deleted. Use the "info" function for detailed informations ' .
+ 'about relations!') . '::', $this->strErrorMessage);
+ return 1;
+ }
+
+ $this->updateStatusTable($strTableName);
+ $this->processClassMessage(translate('Dataset successfully deleted. Affected rows:') . ' ' .
+ $intDeleteCount . '::', $this->strInfoMessage);
+ $this->writeLog(translate('Deleted data from table:') . " $strTableName " .
+ translate('- with affected rows:') . ' ' . $intDeleteCount);
+ $this->processClassMessage($strInfoMessage, $this->strInfoMessage);
+ $this->processClassMessage($strErrorMessage, $this->strErrorMessage);
+ return 0;
+ }
+ $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist, it is ' .
+ 'protected from deletion or you do not have write permission.') . '::' .
+ $this->myDBClass->strErrorMessage, $this->strErrorMessage);
+ return 1;
+ }
+
+ /**
+ * Returns an array with any data fields from a table with existing relations to another table. This function
+ * returns also passive relations which are not used in configurations.
+ * This function is used for a full deletion of a configuration entry or to find out if a configuration is used
+ * in another way.
+ * @param string $strTable Table name
+ * @param array|null $arrRelations Array with relations
+ * @return int 0 = no field with relation / 1 = at least one field with relation
+ * Status message is stored in message class variables
+ * Data array: tableName Table include the relation data
+ * fieldName Field name include the relation data
+ * flags Pos 1 -> 0=Normal field / 1=Required field (field type)
+ * Pos 2 -> 0=delete / 1=keep data / 2=set to 0 (normal deletion option)
+ * Pos 3 -> 0=delete / 2=set to 0 (force deletion option)
+ * Pos 4 -> 0=1:1 / 1=1:n / (relation type)
+ * 2=1:n (variables) / 3=1:n (timedef)
+ */
+ public function fullTableRelations(string $strTable, array &$arrRelations = null): int
+ {
+ /* Define variable */
+ $arrRelations = array();
+ $arrData = array();
+ $intDC = 0;
+ $intReturn = 0;
+ /* Get relation data */
+ $strSQL = "SELECT * FROM `tbl_relationinformation` WHERE `master`='$strTable' AND `fullRelation`=1";
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booReturn && ($intDC !== 0)) {
+ foreach ($arrData as $elem) {
+ $arrRelations[] = array('tableName1' => $elem['tableName1'], 'fieldName' => $elem['fieldName'],
+ 'target1' => $elem['target1'], 'targetKey' => $elem['targetKey'],
+ 'flags' => $elem['flags']);
+ }
+ $intReturn = 1;
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Searches any relation in the database and returns them as relation information
+ * @param string $strTable Database table name
+ * @param int $intMasterId Data ID from master table
+ * @param string $strMasterfield Info field name from master table
+ * @param int $intReporting Output as text - 0=yes, 1=no
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ public function infoRelation(string $strTable, int $intMasterId, string $strMasterfield, int $intReporting = 0): int
+ {
+ $intDeletion = 0;
+ $arrDSCount = array();
+ $arrRelations = array();
+ $arrData = array();
+ $arrDataCheck = array();
+ $intReturn = $this->fullTableRelations($strTable, $arrRelations);
+ if (($intReturn === 1) && ($intMasterId !== 0)) {
+ /* Get master field data */
+ $strNewMasterfield = str_replace(',', '`,`', $strMasterfield);
+ $strSQL = 'SELECT `' . $strNewMasterfield . '` FROM `' . $strTable . "` WHERE `id` = $intMasterId";
+ $this->myDBClass->hasSingleDataset($strSQL, $arrSource);
+ if (substr_count($strMasterfield, ',') !== 0) {
+ $arrTarget = explode(',', $strMasterfield);
+ $strName = $arrSource[$arrTarget[0]] . '-' . $arrSource[$arrTarget[1]];
+ } else {
+ $strName = $arrSource[$strMasterfield];
+ }
+ $this->strInfoMessage .= '' . translate('Relation information for ') .
+ $strName . translate(' of table ') . $strTable . ':::';
+ $this->strInfoMessage .= '';
+ /* Walk through relations */
+ foreach ($arrRelations as $elem) {
+ /* Process flags */
+ $arrFlags = explode(',', $elem['flags']);
+ if ($elem['fieldName'] === 'check_command') {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $elem['tableName1'] . '` ' .
+ 'WHERE SUBSTRING_INDEX(`' . $elem['fieldName'] . "`,'!',1)= $intMasterId";
+ } else {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $elem['tableName1'] . '` WHERE `' . $elem['fieldName'] . "`= $intMasterId";
+ }
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
+ /* Take only used relations */
+ if ($booReturn && ($intDataCount !== 0)) {
+ /* Relation type */
+ if ((int)$arrFlags[3] === 1) {
+ foreach ($arrData as $data) {
+ if ($elem['fieldName'] === 'idMaster') {
+ $strRef = 'idSlave';
+ /* Process special tables */
+ if ($elem['target1'] === 'tbl_service') {
+ if ($elem['tableName1'] === 'tbl_lnkServicegroupToService') {
+ $strRef = 'idSlaveS';
+ }
+ } elseif ($elem['target1'] === 'tbl_host') {
+ if ($elem['tableName1'] === 'tbl_lnkServicegroupToService') {
+ $strRef = 'idSlaveH';
+ }
+ } elseif ($elem['target1'] === 'tbl_hostgroup') {
+ if ($elem['tableName1'] === 'tbl_lnkServicegroupToService') {
+ $strRef = 'idSlaveHG';
+ }
+ }
+ } else {
+ $strRef = 'idMaster';
+ }
+ /* Get data */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $elem['tableName1'] . '` ' .
+ 'LEFT JOIN `' . $elem['target1'] . '` ON `' . $strRef . '` = `id` ' .
+ 'WHERE `' . $elem['fieldName'] . '` = ' . $data[$elem['fieldName']] . ' ' .
+ 'AND `' . $strRef . '`=' . $data[$strRef];
+ $this->myDBClass->hasSingleDataset($strSQL, $arrDSTarget);
+ if (substr_count($elem['targetKey'], ',') !== 0) {
+ $arrTarget = explode(',', $elem['targetKey']);
+ $strTarget = $arrDSTarget[$arrTarget[0]] . '-' . $arrDSTarget[$arrTarget[1]];
+ } else {
+ $strTarget = $arrDSTarget[$elem['targetKey']];
+ }
+ /* If the field is market as "required", check for any other entries */
+ if ((int)$arrFlags[0] === 1) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $elem['tableName1'] . '` ' .
+ 'WHERE `' . $strRef . '` = ' . $arrDSTarget[$strRef];
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDSCount, $intDCCount);
+ if ($booReturn && ($intDCCount > 1)) {
+ $this->strInfoMessage .= translate('Relation to ') . $elem['target1'] .
+ translate(', entry ') . $strTarget .
+ ' - ' . translate('deletion possible') .
+ '::';
+ } else {
+ $this->strInfoMessage .= translate('Relation to ') . $elem['target1'] .
+ translate(', entry ') . $strTarget .
+ ' - ' .
+ translate('deletion not possible') . '::';
+ $intDeletion = 1;
+ }
+ } else {
+ $this->strInfoMessage .= translate('Relation to ') . $elem['target1'] .
+ translate(', entry ') . $strTarget . ' - ' .
+ translate('deletion possible') . '::';
+ }
+ }
+ } elseif ((int)$arrFlags[3] === 0) {
+ /* Fetch remote entry */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $elem['tableName1'] . '` '
+ . 'WHERE `' . $elem['fieldName'] . "`=$intMasterId";
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataCheck, $intDCCheck);
+ if ($booReturn && ($intDCCheck !== 0)) {
+ foreach ($arrDataCheck as $data) {
+ if (substr_count($elem['targetKey'], ',') !== 0) {
+ $arrTarget = explode(',', $elem['targetKey']);
+ $strTarget = $data[$arrTarget[0]] . '-' . $data[$arrTarget[1]];
+ } else {
+ $strTarget = $data[$elem['targetKey']];
+ }
+ if ((int)$arrFlags[0] === 1) {
+ $this->strInfoMessage .= translate('Relation to ') . $elem['tableName1'] .
+ translate(', entry ') . $strTarget .
+ ' - ' .
+ translate('deletion not possible') . '::';
+ $intDeletion = 1;
+ } else {
+ $this->strInfoMessage .= translate('Relation to ') . $elem['tableName1'] .
+ translate(', entry ') . $strTarget .
+ ' - ' .
+ translate('deletion possible') . '::';
+ }
+ }
+ }
+ }
+ }
+ }
+ $this->strInfoMessage .= '::';
+ }
+ if ($intReporting === 1) {
+ $this->strInfoMessage = '';
+ }
+ return $intDeletion;
+ }
+
+ /**
+ * Update the datasets for 1:n (optional 1:n:m) relations in the database table
+ * @param string $strTable Database table name
+ * @param int $intMasterId Data ID from master table
+ * @param array $arrSlaveId Array with all data IDs from slave table
+ * @param int $intMulti 0 = for 1:n relations
+ * 1 = for 1:n:n relations
+ * @return int 0 = successful / 1 = error
+ */
+ public function dataUpdateRelation(string $strTable, int $intMasterId, array $arrSlaveId, int $intMulti = 0): int
+ {
+ $intReturn = 0;
+ /* Remove any old relations */
+ $intReturn1 = $this->dataDeleteRelation($strTable, $intMasterId);
+ if ($intReturn1 !== 0) {
+ $intReturn = 1;
+ }
+ /* Insert the new relations */
+ if ($intReturn === 0) {
+ $intReturn2 = $this->dataInsertRelation($strTable, $intMasterId, $arrSlaveId, $intMulti);
+ if ($intReturn2 !== 0) {
+ $intReturn = 1;
+ }
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Removes any relation from the database
+ * @param string $strTable Database table name
+ * @param int $intMasterId Data ID from master table
+ * @return int 0 = successful / 1 = error
+ */
+ public function dataDeleteRelation(string $strTable, int $intMasterId): int
+ {
+ /* Define variables */
+ $intDataId = 0;
+ /* Define the SQL statement */
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $strTable . "` WHERE `idMaster`=$intMasterId";
+ return $this->dataInsert($strSQL, $intDataId);
+ }
+
+ /**
+ * Inserts any necessary dataset for an 1:n (optional 1:n:n) relation to the database table
+ * @param string $strTable Database table name
+ * @param int $intMasterId Data ID from master table
+ * @param array $arrSlaveId Array with all data IDs from slave table
+ * @param int $intMulti 0 = for 1:n relations
+ * 1 = for 1:n:n relations
+ * @return int 0 = successful / 1 = error
+ */
+ public function dataInsertRelation(string $strTable, int $intMasterId, array $arrSlaveId, int $intMulti = 0): int
+ {
+ /* Define variables */
+ $intReturn = 0;
+ $intDataId = 0;
+ $strSQL = '';
+ /* Walk through the slave data ID array */
+ foreach ($arrSlaveId as $elem) {
+ /* Pass empty and '*' values */
+ if ($elem === '0') {
+ continue;
+ }
+ if ($elem === '*') {
+ continue;
+ }
+ /* Process exclude values */
+ if (0 === strpos($elem, 'e')) {
+ $elem = str_replace('e', '', $elem);
+ $intExclude = 1;
+ } else {
+ $intExclude = 0;
+ }
+ /* Define the SQL statement */
+ if ($intMulti !== 0) {
+ $arrValues = explode('::', $elem);
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $strTable . "` SET `idMaster`=$intMasterId, `idSlaveH`=" . $arrValues[0]
+ . ', `idSlaveHG`=' . $arrValues[1] . ', `idSlaveS`=' . $arrValues[2] . ", `exclude`=$intExclude";
+ } else if (($strTable === 'tbl_lnkServicedependencyToService_DS') ||
+ ($strTable === 'tbl_lnkServicedependencyToService_S') ||
+ ($strTable === 'tbl_lnkServiceescalationToService')) {
+ /* Get service description */
+ $strSQLSrv = "SELECT `service_description` FROM `tbl_service` WHERE id=$elem";
+ $strService = $this->myDBClass->getFieldData($strSQLSrv);
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $strTable . "` SET `idMaster`=$intMasterId, `idSlave`=$elem, " .
+ "`strSlave`='" . addslashes($strService) . "', `exclude`=$intExclude";
+ } elseif (($strTable === 'tbl_lnkServiceToService') ||
+ ($strTable === 'tbl_lnkServicetemplateToService')) {
+ $arrValues = explode('-', $elem);
+ if (isset($arrValues[0], $arrValues[1])) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $strTable . "` SET `idMaster`=$intMasterId, `idSlave`=$arrValues[0], "
+ . " `idHost`=$arrValues[1]";
+ }
+ } elseif (($strTable !== 'tbl_lnkTimeperiodToTimeperiod') &&
+ ($strTable !== 'tbl_lnkDatadomainToConfigtarget')) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $strTable . '` ' .
+ "SET `idMaster`=$intMasterId, `idSlave`=$elem, `exclude`=$intExclude";
+ } else {
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $strTable . "` SET `idMaster`=$intMasterId, `idSlave`=$elem";
+ }
+ /* Insert data */
+ $intReturn = $this->dataInsert($strSQL, $intDataId);
+ if ($intReturn !== 0) {
+ $intReturn = 1;
+ }
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Deactivates one or many datasets in the table be setting 'active' to '0'. Alternatively, a single record
+ * ID can be specified or evaluated by the values of $_POST['chbId_n'] passed parameters, where n is the
+ * record ID must match.
+ * @param string $strTableName Table name
+ * @param int $intDataId Individual record ID, which is to be activated
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ public function dataDeactivate(string $strTableName, int $intDataId = 0): int
+ {
+ /* Define variables */
+ $intReturn = 1;
+ $arrData = array();
+ /* Get write access groups */
+ $strAccess = $this->myVisClass->getAccessGroups('write');
+ /* Activate datasets */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTableName . '` ' .
+ 'WHERE `config_id`=' . $this->intDomainId . " AND `access_group` IN ($strAccess)";
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
+ if ($booReturn && ($intDataCount !== 0)) {
+ $intActivateCount = 0;
+ foreach ($arrData as $elem) {
+ $strChbName = 'chbId_' . $elem['id'];
+ /* was the current record is marked for activate? */
+ if ((($intDataId === (int)$elem['id']) || ((filter_input(INPUT_POST, $strChbName) !== null) &&
+ (filter_input(INPUT_POST, $strChbName, FILTER_UNSAFE_RAW) === 'on'))) &&
+ $this->infoRelation($strTableName, $elem['id'], 'id', 1) === 0) {
+ /* Update dataset */
+ if (($strTableName === 'tbl_service') || ($strTableName === 'tbl_host')) {
+ $strSQL = 'UPDATE `' . $strTableName . "` SET `active`='0', `last_modified`=now() " .
+ 'WHERE `id`=' . $elem['id'];
+ } else {
+ $strSQL = 'UPDATE `' . $strTableName . "` SET `active`='0' WHERE `id`=" . $elem['id'];
+ }
+ $this->myDBClass->insertData($strSQL);
+ $intActivateCount++;
+ }
+ }
+ /* Process information */
+ if ($intActivateCount === 0) {
+ $this->processClassMessage(translate('No dataset deactivated. Maybe the dataset does not exist, it ' .
+ 'is protected from deactivation, no dataset was selected or you do not have write permission. ' .
+ 'Use the "info" function for detailed informations about relations!') .
+ '::', $this->strErrorMessage);
+ } else {
+ $this->updateStatusTable($strTableName);
+ $this->processClassMessage(translate('Dataset successfully deactivated. Affected rows:') . ' ' .
+ $intActivateCount . '::', $this->strInfoMessage);
+ $this->writeLog(translate('Deactivate dataset from table:') . " $strTableName " .
+ translate('- with affected rows:') . ' ' . $this->myDBClass->intAffectedRows);
+ $intReturn = 0;
+ }
+ } else {
+ $this->processClassMessage(translate('No dataset deactivated. Maybe the dataset does not exist or you ' .
+ 'do not have write permission.') . '::', $this->strErrorMessage);
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Activates one or many datasets in the table be setting 'active' to '1'. Alternatively, a single record ID can
+ * be specified or evaluated by the values of $_POST['chbId_n'] passed parameters, where n is the record ID must
+ * match.
+ * @param string $strTableName Table name
+ * @param int $intDataId Individual record ID, which is to be activated
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ public function dataActivate(string $strTableName, int $intDataId = 0): int
+ {
+ /* Define variables */
+ $intReturn = 1;
+ $arrData = array();
+ /* Get write access groups */
+ $strAccess = $this->myVisClass->getAccessGroups('write');
+ /* Activate datasets */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTableName . '` ' .
+ 'WHERE `config_id`=' . $this->intDomainId . " AND `access_group` IN ($strAccess)";
+ $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
+ if ($booReturn && ($intDataCount !== 0)) {
+ $intActivateCount = 0;
+ foreach ($arrData as $elem) {
+ $strChbName = 'chbId_' . $elem['id'];
+ /* was the current record marked for activate? */
+ if (($intDataId === (int)$elem['id']) || ((filter_input(INPUT_POST, $strChbName) !== null) &&
+ (filter_input(INPUT_POST, $strChbName, FILTER_UNSAFE_RAW) === 'on'))) {
+ /* Update dataset */
+ if (($strTableName === 'tbl_service') || ($strTableName === 'tbl_host')) {
+ $strSQL = 'UPDATE `' . $strTableName . "` SET `active`='1', `last_modified`=now() " .
+ 'WHERE `id`=' . $elem['id'];
+ } else {
+ $strSQL = 'UPDATE `' . $strTableName . "` SET `active`='1' WHERE `id`=" . $elem['id'];
+ }
+ $this->myDBClass->insertData($strSQL);
+ $intActivateCount++;
+ }
+ }
+ /* Process information */
+ if ($intActivateCount === 0) {
+ $this->processClassMessage(translate('No dataset activated. Maybe the dataset does not exist, no ' .
+ 'dataset was selected or you do not have write permission.') . '::', $this->strErrorMessage);
+ } else {
+ $this->updateStatusTable($strTableName);
+ $this->processClassMessage(translate('Dataset successfully activated. Affected rows:') . ' ' .
+ $intActivateCount . '::', $this->strInfoMessage);
+ $this->writeLog(translate('Activate dataset from table:') . " $strTableName " .
+ translate('- with affected rows:') . ' ' . $this->myDBClass->intAffectedRows);
+ $intReturn = 0;
+ }
+ } else {
+ $this->processClassMessage(translate('No dataset activated. Maybe the dataset does not exist or you do ' .
+ 'not have write permission.') . '::', $this->strErrorMessage);
+ }
+ return $intReturn;
+ }
+
+ /**
+ * Updates the hash field im some configuration objects
+ * @param string $strTable Table name
+ * @param int $intId Data ID
+ * @return int 0 = successful / 1 = error
+ * Status message is stored in message class variables
+ */
+ public function updateHash(string $strTable, int $intId): int
+ {
+ /* Define variables */
+ $strRawString = '';
+ $arrData = array();
+ $intDC = 0;
+ $intDataID = 0;
+ /* Service table */
+ if ($strTable === 'tbl_service') {
+ /* Get any hosts and host_groups */
+ $strSQL = 'SELECT `host_name` AS `item_name` FROM `tbl_host` ' .
+ "LEFT JOIN `tbl_lnkServiceToHost` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION SELECT `hostgroup_name` AS `item_name` FROM `tbl_hostgroup` ' .
+ 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `idSlave`=`id` ' .
+ 'WHERE `idMaster`=' . $intId . ' ORDER BY `item_name`';
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booRet && ($intDC !== 0)) {
+ foreach ($arrData as $elem) {
+ $strRawString .= $elem['item_name'] . ',';
+ }
+ }
+ $strSQL = 'SELECT * FROM `tbl_service` WHERE `id`=' . $intId;
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booRet && ($intDC !== 0)) {
+ if ($arrData[0]['service_description'] !== '') {
+ $strRawString .= $arrData[0]['service_description'] . ',';
+ }
+ if ($arrData[0]['display_name'] !== '') {
+ $strRawString .= $arrData[0]['display_name'] . ',';
+ }
+ if ($arrData[0]['check_command'] !== '') {
+ $arrField = explode('!', $arrData[0]['check_command']);
+ $strCommand = strstr($arrData[0]['check_command'], '!');
+ $strSQLRel = 'SELECT `command_name` FROM `tbl_command` WHERE `id`=' . $arrField[0];
+ $strName = $this->myDBClass->getFieldData($strSQLRel);
+ $strRawString .= $strName . $strCommand . ',';
+ }
+ }
+ }
+ if (($strTable === 'tbl_hostdependency') || ($strTable === 'tbl_servicedependency')) {
+ /* Get * values */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTable . '` WHERE `id`=' . $intId;
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booRet && ($intDC !== 0)) {
+ if (isset($arrData[0]['dependent_host_name']) && ((int)$arrData[0]['dependent_host_name'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ if (isset($arrData[0]['dependent_hostgroup_name']) && ((int)$arrData[0]['dependent_hostgroup_name'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ if (isset($arrData[0]['host_name']) && ((int)$arrData[0]['host_name'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ if (isset($arrData[0]['hostgroup_name']) && ((int)$arrData[0]['hostgroup_name'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ if (isset($arrData[0]['dependent_service_description']) &&
+ ((int)$arrData[0]['dependent_service_description'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ if (isset($arrData[0]['service_description']) && ((int)$arrData[0]['service_description'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ }
+ if ($strTable === 'tbl_hostdependency') {
+ /* Get any hosts and host_groups */
+ $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
+ "LEFT JOIN `tbl_lnkHostdependencyToHost_DH` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
+ "LEFT JOIN `tbl_lnkHostdependencyToHostgroup_DH` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
+ "LEFT JOIN `tbl_lnkHostdependencyToHost_H` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
+ 'LEFT JOIN `tbl_lnkHostdependencyToHostgroup_H` ON `idSlave`=`id` WHERE `idMaster`=' . $intId;
+ }
+ if ($strTable === 'tbl_servicedependency') {
+ /* Get any hosts and host_groups */
+ $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
+ "LEFT JOIN `tbl_lnkServicedependencyToHost_DH` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
+ 'LEFT JOIN `tbl_lnkServicedependencyToHostgroup_DH` ON `idSlave`=`id` ' .
+ "WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
+ "LEFT JOIN `tbl_lnkServicedependencyToHost_H` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
+ 'LEFT JOIN `tbl_lnkServicedependencyToHostgroup_H` ON `idSlave`=`id` ' .
+ "WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `strSlave` AS `item_name`, exclude ' .
+ "FROM `tbl_lnkServicedependencyToService_DS` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `strSlave` AS `item_name`, exclude ' .
+ "FROM `tbl_lnkServicedependencyToService_S` WHERE `idMaster`=$intId";
+ }
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booRet && ($intDC !== 0)) {
+ foreach ($arrData as $elem) {
+ if ((int)$elem['exclude'] === 0) {
+ $strRawString .= $elem['item_name'] . ',';
+ } else {
+ $strRawString .= 'not_' . $elem['item_name'] . ',';
+ }
+ }
+ $strRawString = substr($strRawString, 0, -1);
+ }
+ }
+ if (($strTable === 'tbl_hostescalation') || ($strTable === 'tbl_serviceescalation')) {
+ /* Get * values */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTable . '` WHERE `id`=' . $intId;
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booRet && ($intDC !== 0)) {
+ if (isset($arrData[0]['host_name']) && ((int)$arrData[0]['host_name'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ if (isset($arrData[0]['hostgroup_name']) && ((int)$arrData[0]['hostgroup_name'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ if (isset($arrData[0]['contacts']) && ((int)$arrData[0]['contacts'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ if (isset($arrData[0]['contact_groups']) && ((int)$arrData[0]['contact_groups'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ if (isset($arrData[0]['service_description']) && ((int)$arrData[0]['service_description'] === 2)) {
+ $strRawString .= 'any,';
+ }
+ }
+ /* Get any hosts, host_groups, contacts and contact_groups */
+ if ($strTable === 'tbl_hostescalation') {
+ $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
+ "LEFT JOIN `tbl_lnkHostescalationToHost` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
+ "LEFT JOIN `tbl_lnkHostescalationToHostgroup` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `contact_name` AS `item_name`, exclude FROM `tbl_contact` ' .
+ "LEFT JOIN `tbl_lnkHostescalationToContact` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `contactgroup_name` AS `item_name`, exclude FROM `tbl_contactgroup` ' .
+ "LEFT JOIN `tbl_lnkHostescalationToContactgroup` ON `idSlave`=`id` WHERE `idMaster`=$intId";
+ }
+ if ($strTable === 'tbl_serviceescalation') {
+ $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' .
+ "LEFT JOIN `tbl_lnkServiceescalationToHost` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' .
+ "LEFT JOIN `tbl_lnkServiceescalationToHostgroup` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `contact_name` AS `item_name`, exclude FROM `tbl_contact` ' .
+ "LEFT JOIN `tbl_lnkServiceescalationToContact` ON `idSlave`=`id` WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `contactgroup_name` AS `item_name`, exclude FROM `tbl_contactgroup` ' .
+ 'LEFT JOIN `tbl_lnkServiceescalationToContactgroup` ON `idSlave`=`id` ' .
+ "WHERE `idMaster`=$intId " .
+ 'UNION ALL SELECT `strSlave` AS `item_name`, exclude ' .
+ "FROM `tbl_lnkServiceescalationToService` WHERE `idMaster`=$intId";
+ }
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booRet && ($intDC !== 0)) {
+ foreach ($arrData as $elem) {
+ if ((int)$elem['exclude'] === 0) {
+ $strRawString .= $elem['item_name'] . ',';
+ } else {
+ $strRawString .= 'not_' . $elem['item_name'] . ',';
+ }
+ }
+ $strRawString = substr($strRawString, 0, -1);
+ }
+ }
+ if ($strTable === 'tbl_serviceextinfo') {
+ /* Get any hosts and host_groups */
+ $strSQL = 'SELECT `tbl_host`.`host_name` AS `item_name` FROM `tbl_host` ' .
+ 'LEFT JOIN `tbl_serviceextinfo` ON `tbl_host`.`id`=`tbl_serviceextinfo`.`host_name` ' .
+ "WHERE `tbl_serviceextinfo`.`id`=$intId " .
+ 'UNION SELECT `tbl_service`.`service_description` AS `item_name` FROM `tbl_service` ' .
+ 'LEFT JOIN `tbl_serviceextinfo` ON ' .
+ '`tbl_service`.`id`=`tbl_serviceextinfo`.`service_description` ' .
+ "WHERE `tbl_serviceextinfo`.`id`=$intId ORDER BY `item_name`";
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booRet && ($intDC !== 0)) {
+ foreach ($arrData as $elem) {
+ $strRawString .= $elem['item_name'] . ',';
+ }
+ $strRawString = substr($strRawString, 0, -1);
+ }
+ }
+ /* Remove blanks */
+ while (substr_count($strRawString, ' ') !== 0) {
+ $strRawString = str_replace(' ', '', $strRawString);
+ }
+ /* Sort hash string */
+ $arrTemp = explode(',', $strRawString);
+ sort($arrTemp);
+ $strRawString = implode(',', $arrTemp);
+ /* Update has in database */
+ $strSQL = 'UPDATE `' . $strTable . "` SET `import_hash`='" . sha1($strRawString) . "' WHERE `id`='$intId'";
+ return $this->dataInsert($strSQL, $intDataID);
+ }
+}
\ No newline at end of file
diff --git a/functions/NagImportClass.php b/functions/NagImportClass.php
index 5ae3a55..2617ba4 100644
--- a/functions/NagImportClass.php
+++ b/functions/NagImportClass.php
@@ -1,268 +1,265 @@
arrSettings = $arrSession['SETS'];
}
if (isset($arrSession['domain'])) {
- $this->intDomainId = $arrSession['domain'];
+ $this->intDomainId = (int)$arrSession['domain'];
}
}
/**
* Import a config file and writes the values to the database
- * @param string $strFileNameRaw Import file name
- * @param int $intConfigId Configuration set id
- * @param int $intOverwrite 0 = Do not replace existing data
- * 1 = Replace existing data in tables
- * @return int 0 = successful / 1 = error
- * Status messages are stored in class variables
+ * @param string $strFileNameRaw Import file name
+ * @param int $intConfigId Configuration set id
+ * @param int $intOverwrite 0 = Do not replace existing data
+ * 1 = Replace existing data in tables
+ * @return int 0 = successful / 1 = error
+ * Status messages are stored in class variables
*/
- public function fileImport($strFileNameRaw, $intConfigId, $intOverwrite = 0)
+ public function fileImport(string $strFileNameRaw, int $intConfigId, int $intOverwrite = 0): int
{
- // Define variables
- $intBlock = 0;
- $intRemoveTmp = 0;
- $strImportFile = '';
+ /* Define variables */
+ $intBlock = 0;
+ $intRemoveTmp = 0;
+ $strImportFile = '';
$strConfLineTemp = '';
- $strBlockKey = '';
- $arrData = array();
- $strFileName = trim($strFileNameRaw);
- // Get file
+ $strBlockKey = '';
+ $arrData = array();
+ $strFileName = trim($strFileNameRaw);
+ /* Get file */
$intReturn = $this->getImportFile($intConfigId, $strFileName, $strImportFile, $intRemoveTmp);
- // Open and read config file
- if ($intReturn == 0) {
- $resFile = fopen($strImportFile, 'rb');
+ /* Open and read config file */
+ if ($intReturn === 0) {
+ $resFile = fopen($strImportFile, 'rb');
$intMultiple = 0;
while ($resFile && !feof($resFile)) {
- // Read line and remove blank chars
+ /* Read line and remove blank chars */
$strConfLine = trim(fgets($resFile));
- // Process multi-line configuration instructions
- if (substr($strConfLine, -1) == '\\') {
- if ($intMultiple == 0) {
+ /* Process multi-line configuration instructions */
+ if (substr($strConfLine, -1) === '\\') {
+ if ($intMultiple === 0) {
$strConfLineTemp = str_replace("\\", ',', $strConfLine);
- $intMultiple = 1;
+ $intMultiple = 1;
} else {
$strConfLineTemp .= str_replace("\\", ',', $strConfLine);
}
continue;
}
- if ($intMultiple == 1) {
- $strConfLine = $strConfLineTemp.$strConfLine;
+ if ($intMultiple === 1) {
+ $strConfLine = $strConfLineTemp . $strConfLine;
$intMultiple = 0;
}
- // Find NAGIOSQL variable
- if (substr_count($strConfLine, '#NAGIOSQL_') != 0) {
+ /* Find NAGIOSQL variable */
+ if (substr_count($strConfLine, '#NAGIOSQL_') !== 0) {
$strConfLine = str_replace('#NAGIOSQL_CONFIG_NAME', '_NAGIOSQL_CONFIG_NAME', $strConfLine);
}
- // Pass comments and empty lines
+ /* Pass comments and empty lines */
if (0 === strpos($strConfLine, '#')) {
continue;
}
- if ($strConfLine == '') {
+ if ($strConfLine === '') {
continue;
}
- if (($intBlock == 1) && ($strConfLine == '{')) {
+ if (($intBlock === 1) && ($strConfLine === '{')) {
continue;
}
- // Process line (remove blanks and cut comments)
- $strLineTmp = str_replace("\;", ':semi:', $strConfLine);
- $arrLine = preg_split("/[\s]+/", $strLineTmp);
- $arrTemp = explode(';', implode(' ', $arrLine));
- $strNewLine = str_replace(':semi:', "\;", trim($arrTemp[0]));
- // Find block begin
- if ($arrLine[0] == 'define') {
- $intBlock = 1;
+ /* Process line (remove blanks and cut comments) */
+ $strLineTmp = str_replace("\;", ':semi:', $strConfLine);
+ $arrLine = preg_split("/\s+/", $strLineTmp);
+ $arrTemp = explode(';', implode(' ', $arrLine));
+ $strNewLine = str_replace(':semi:', "\;", trim($arrTemp[0]));
+ /* Find block begin */
+ if ($arrLine[0] === 'define') {
+ $intBlock = 1;
$strBlockKey = str_replace('{', '', $arrLine[1]);
- $arrData = array();
+ $arrData = array();
continue;
}
- // Store the block data to an array
- if (($intBlock == 1) && ($arrLine[0] != '}')) {
+ /* Store the block data to an array */
+ if (($intBlock === 1) && ($arrLine[0] !== '}')) {
$strExclude = 'template_name,alias,name,use';
- if (($strBlockKey == 'timeperiod') && (!\in_array($arrLine[0], explode(',', $strExclude), true))) {
+ if (($strBlockKey === 'timeperiod') && (!in_array($arrLine[0], explode(',', $strExclude), true))) {
$arrNewLine = explode(' ', $strNewLine);
- $strTPKey = str_replace(' ' .$arrNewLine[\count($arrNewLine)-1], '', $strNewLine);
- $strTPValue = $arrNewLine[\count($arrNewLine)-1];
+ $strTPKey = str_replace(' ' . $arrNewLine[count($arrNewLine) - 1], '', $strNewLine);
+ $strTPValue = $arrNewLine[count($arrNewLine) - 1];
$arrData[$strTPKey] = array('key' => $strTPKey,
'value' => $strTPValue);
} else {
- $key = $arrLine[0];
- $value = str_replace($arrLine[0]. ' ', '', $strNewLine);
- // Special retry_check_interval, normal_check_interval
- if ($key == 'retry_check_interval') {
+ $key = $arrLine[0];
+ $value = str_replace($arrLine[0] . ' ', '', $strNewLine);
+ /* Special retry_check_interval, normal_check_interval */
+ if ($key === 'retry_check_interval') {
$key = 'retry_interval';
}
- if ($key == 'normal_check_interval') {
+ if ($key === 'normal_check_interval') {
$key = 'check_interval';
}
$arrData[$arrLine[0]] = array('key' => $key, 'value' => $value);
}
}
- // Process data at end of block
- if ((substr_count($strConfLine, '}') == 1) && ($arrData !== null) && \is_array($arrData)) {
- $intBlock = 0;
+ /* Process data at end of block */
+ if ((substr_count($strConfLine, '}') === 1) && is_array($arrData)) {
+ $intBlock = 0;
$intRetVal = $this->importTable($strBlockKey, $arrData, $intOverwrite);
- if ($intRetVal != 0) {
+ if ($intRetVal !== 0) {
$intReturn = 1;
}
} elseif ($arrData === null) {
- $this->strErrorMessage .= translate('No valid configuration found:'). ' ' .$strFileName. '::';
+ $this->strErrorMessage .= translate('No valid configuration found:') . ' ' . $strFileName . '::';
$intReturn = 1;
}
}
- if ($intRemoveTmp == 1) {
+ if ($intRemoveTmp === 1) {
unlink($strImportFile);
}
} else {
- $this->strErrorMessage .= translate('Import file does not exist or is not readable:'). ' ' .$strFileName
+ $this->strErrorMessage .= translate('Import file does not exist or is not readable:') . ' ' . $strFileName
. '::';
$intReturn = 1;
}
return $intReturn;
}
- // PRIVATE functions
-
+ /* PRIVATE functions */
/**
- * @param int $intConfigId Configuration set id
- * @param string $strFileName Configuration file name
- * @param string|bool $strImportFile Temporary file for data import (by reference)
- * @param int $intRemoveTmp Remove temporary file (1 = yes / 0 = no) (by reference)
- * @return int 0 = successful / 1 = error
- * Status messages are stored in class variables
+ * @param int $intConfigId Configuration set id
+ * @param string $strFileName Configuration file name
+ * @param string $strImportFile Temporary file for data import (by reference)
+ * @param int $intRemoveTmp Remove temporary file (1 = yes / 0 = no) (by reference)
+ * @return int 0 = successful / 1 = error
+ * Status messages are stored in class variables
*/
- private function getImportFile($intConfigId, $strFileName, &$strImportFile, &$intRemoveTmp)
+ private function getImportFile(int $intConfigId, string $strFileName, string &$strImportFile, int &$intRemoveTmp): int
{
- $intMethod = 1;
- $intReturn = 0;
- $intRemoveTmp = 0;
- $strImportFile = '';
+ $intMethod = 1;
+ $intReturn = 0;
+ $intRemoveTmp = 0;
+ $strImportFile = '';
$strImportFileTmp = '';
- // File transfer method
- if (substr_count($strFileName, 'nagiosql_local_imp') == 1) {
+ $strConfigValue = '';
+ /* File transfer method */
+ if (substr_count($strFileName, 'nagiosql_local_imp') === 1) {
$intMethod = 1;
$intRetVal = 0;
} else {
- $intRetVal = $this->myConfigClass->getConfigData($intConfigId, 'method', $intMethod);
+ $intRetVal = $this->myConfigClass->getConfigData($intConfigId, 'method', $strConfigValue);
+ $intMethod = (int)$strConfigValue;
}
- if ($intRetVal != 0) {
- $this->strErrorMessage .= translate('Unable to get configuration data:'). ' method::';
+ if ($intRetVal !== 0) {
+ $this->strErrorMessage .= translate('Unable to get configuration data:') . ' method::';
$intReturn = 1;
}
- if ($intReturn == 0) {
- // Read import file
- if ($intMethod == 1) { // Local file system
+ if ($intReturn === 0) {
+ /* Read import file */
+ if ($intMethod === 1) { /* Local file system */
if (!is_readable($strFileName)) {
- $this->strErrorMessage .= translate('Cannot open the data file (check the permissions)!'). ' ' .
- $strFileName. '::';
+ $this->strErrorMessage .= translate('Cannot open the data file (check the permissions)!') . ' ' .
+ $strFileName . '::';
$intReturn = 1;
} else {
$strImportFileTmp = $strFileName;
}
- } elseif ($intMethod == 2) { // FTP access
- // Open ftp connection
+ } elseif ($intMethod === 2) { /* FTP access */
+ /* Open ftp connection */
$intRetVal = $this->myConfigClass->getFTPConnection($intConfigId);
- if ($intRetVal != 0) {
+ if ($intRetVal !== 0) {
$this->strErrorMessage .= $this->myConfigClass->strErrorMessage;
$intReturn = 1;
} else {
- // Transfer file from remote server to a local temp file
- if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) {
+ /* Transfer file from remote server to a local temp file */
+ if (isset($this->arrSettings['path']['tempdir'])) {
$strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql_imp');
} else {
$strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql_imp');
}
- if (!ftp_get($this->myConfigClass->resConnectId, $strConfigFile, $strFileName, FTP_ASCII)) {
- $this->strErrorMessage .= translate('Cannot receive the configuration file (FTP connection)!').
+ if (!ftp_get($this->myConfigClass->conFTPConId, $strConfigFile, $strFileName, FTP_ASCII)) {
+ $this->strErrorMessage .= translate('Cannot receive the configuration file (FTP connection)!') .
'::';
- ftp_close($this->myConfigClass->resConnectId);
+ ftp_close($this->myConfigClass->conFTPConId);
$intReturn = 1;
} else {
- $intRemoveTmp = 1;
+ $intRemoveTmp = 1;
$strImportFileTmp = $strConfigFile;
}
}
- } elseif ($intMethod == 3) { // SSH Access
- // Open ssh connection
+ } elseif ($intMethod === 3) { /* SSH Access */
+ /* Open ssh connection */
$intRetVal = $this->myConfigClass->getSSHConnection($intConfigId);
- if ($intRetVal != 0) {
+ if ($intRetVal !== 0) {
$this->strErrorMessage .= $this->myConfigClass->strErrorMessage;
$intReturn = 1;
} else {
- // Transfer file from remote server to a local temp file
- if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) {
+ /* Transfer file from remote server to a local temp file */
+ if (isset($this->arrSettings['path']['tempdir'])) {
$strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql_imp');
} else {
$strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql_imp');
}
- if (!ssh2_scp_recv($this->myConfigClass->resConnectId, $strFileName, $strConfigFile)) {
- $this->strErrorMessage .= translate('Cannot receive the configuration file (SSH connection)!').
+ if (!ssh2_scp_recv($this->myConfigClass->resSSHConId, $strFileName, $strConfigFile)) {
+ $this->strErrorMessage .= translate('Cannot receive the configuration file (SSH connection)!') .
'::';
$intReturn = 1;
} else {
- $intRemoveTmp = 1;
+ $intRemoveTmp = 1;
$strImportFileTmp = $strConfigFile;
}
}
}
- // Open and read config file
+ /* Open and read config file */
if (file_exists($strImportFileTmp) && is_readable($strImportFileTmp)) {
- $strImportFile = $strImportFileTmp;
+ $strImportFile = (string)$strImportFileTmp;
} else {
- $intReturn = 1;
+ $intReturn = 1;
$intRemoveTmp = 0;
}
}
@@ -271,92 +268,101 @@ class NagImportClass
/**
* Writes the block data to the database
- * @param string $strBlockKey Config key (from define)
- * @param array $arrImportData Imported block data
- * @param int $intOverwrite 0 = Do not replace existing data
- * 1 = Replace existing data in tables
- * @return int 0 = successful / 1 = error
- * Status messages are stored in class variables
+ * @param string $strBlockKey Config key (from define)
+ * @param array $arrImportData Imported block data
+ * @param int $intOverwrite 0 = Do not replace existing data
+ * 1 = Replace existing data in tables
+ * @return int 0 = successful / 1 = error
+ * Status messages are stored in class variables
*/
- private function importTable($strBlockKey, $arrImportData, $intOverwrite)
+ private function importTable(string $strBlockKey, array $arrImportData, int $intOverwrite): int
{
- // Define variables
- $intIsTemplate = 0;
- $intExists = 0;
+ /* Define variables */
+ $intIsTemplate = 0;
+ $intExists = 0;
$intInsertRelations = 0;
$intInsertVariables = 0;
- $strHash = '';
- $strConfigName = '';
+ $strHash = '';
+ $strConfigName = '';
$arrImportRelations = array();
- $arrFreeVariables = array();
- $arrRelations = array();
- // Block data from template or real configuration?
+ $arrFreeVariables = array();
+ $arrRelations = array();
+ $strTable = '';
+ $strKeyField = '';
+ /* Block data from template or real configuration? */
if (array_key_exists('name', $arrImportData) && (isset($arrImportData['register']) &&
- ($arrImportData['register']['value'] == 0))) {
+ ((int)$arrImportData['register']['value'] === 0))) {
$intIsTemplate = 1;
}
- // Get table name and key for import
+ /* Get table name and key for import */
$intReturn = $this->getTableData($strBlockKey, $intIsTemplate, $strTable, $strKeyField);
- if ($intReturn == 0) {
- // Create an import hash if no key field is available
- if ($strKeyField == '') {
+ if ($intReturn === 0) {
+ /* Create an import hash if no key field is available */
+ if ($strKeyField === '') {
$this->createHash($strTable, $arrImportData, $strHash, $strConfigName);
- $arrImportData['config_name']['key'] = 'config_name';
- $arrImportData['config_name']['value'] = $strConfigName;
+ $arrImportData['config_name']['key'] = 'config_name';
+ $arrImportData['config_name']['value'] = $strConfigName;
$strKeyField = 'config_name';
} else {
$strHash = '';
}
- // Get relation data
+ /* Get relation data */
$intRelation = $this->myDataClass->tableRelations($strTable, $arrRelations);
- // Does this entry already exist?
- if (($intIsTemplate == 0) && ($strKeyField != '') && isset($arrImportData[$strKeyField])) {
- if ($strHash == '') {
- // Special key field values
- if ($strBlockKey == 'hostextinfo') {
- $strSQL = 'SELECT `id`FROM `tbl_host` ' .
- "WHERE `host_name`='".$arrImportData[$strKeyField]['value']."'";
+ /* Does this entry already exist? */
+ if (($intIsTemplate === 0) && ($strKeyField !== '') && isset($arrImportData[$strKeyField])) {
+ if ($strHash === '') {
+ /* Special key field values */
+ if ($strBlockKey === 'hostextinfo') {
+ $strSQL = 'SELECT `id`FROM `tbl_host` ' .
+ "WHERE `host_name`='" . $arrImportData[$strKeyField]['value'] . "'";
$intHost = (int)$this->myDBClass->getFieldData($strSQL);
- $strSQL = 'SELECT `id` FROM `' .$strTable. '` ' .
- 'WHERE `config_id`=' .$this->intDomainId. ' AND `' .$strKeyField."`='".$intHost."'";
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTable . '` ' .
+ 'WHERE `config_id`=' . $this->intDomainId . ' AND `' . $strKeyField . "`='" . $intHost . "'";
} else {
- $strSQL = 'SELECT `id` FROM `' .$strTable. '` ' .
- 'WHERE `config_id`=' .$this->intDomainId. ' AND ' .
- '`' .$strKeyField."`='".$arrImportData[$strKeyField]['value']."'";
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTable . '` ' .
+ 'WHERE `config_id`=' . $this->intDomainId . ' AND ' .
+ '`' . $strKeyField . "`='" . $arrImportData[$strKeyField]['value'] . "'";
}
} else {
- $strSQL = 'SELECT `id` FROM `' .$strTable. '` ' .
- 'WHERE `config_id`=' .$this->intDomainId." AND `import_hash`='".$strHash."'";
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTable . '` ' .
+ 'WHERE `config_id`=' . $this->intDomainId . " AND `import_hash`='" . $strHash . "'";
}
$intExists = $this->myDBClass->getFieldData($strSQL);
- if ($intExists == false) {
+ if ($intExists === '') {
$intExists = 0;
}
- } elseif (($intIsTemplate == 1) && ($strKeyField != '') && isset($arrImportData['name'])) {
- $strSQL = 'SELECT `id` FROM `' .$strTable. '` ' .
- 'WHERE `config_id`=' .$this->intDomainId. ' AND ' .
- "`template_name`='".$arrImportData['name']['value']."'";
+ } elseif (($intIsTemplate === 1) && ($strKeyField !== '') && isset($arrImportData['name'])) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $strTable . '` ' .
+ 'WHERE `config_id`=' . $this->intDomainId . ' AND ' .
+ "`template_name`='" . $arrImportData['name']['value'] . "'";
$intExists = $this->myDBClass->getFieldData($strSQL);
- if ($intExists == false) {
+ if ($intExists === '') {
$intExists = 0;
}
}
- // Entry exsists but should not be overwritten
- if (($intExists != 0) && ($intOverwrite == 0)) {
- if ($strKeyField == 'config_name') {
- $strSQLConfig = 'SELECT `config_name` FROM `' .$strTable. '` WHERE `id`=' .$intExists;
+ /* Entry exsists but should not be overwritten */
+ if (($intExists !== 0) && ($intOverwrite === 0)) {
+ if ($strKeyField === 'config_name') {
+ /** @noinspection SqlResolve */
+ $strSQLConfig = 'SELECT `config_name` FROM `' . $strTable . '` WHERE `id`=' . $intExists;
$arrImportData[$strKeyField]['value'] = $this->myDBClass->getFieldData($strSQLConfig);
}
- $this->strInfoMessage .= translate('Entry'). ' ' .$strKeyField. ' -> ' .
- $arrImportData[$strKeyField]['value']. ' ' .translate('inside'). ' ' .
- $strTable. ' ' .translate('exists and were not overwritten'). '::';
- } elseif (isset($arrImportData[$strKeyField]) && ($arrImportData[$strKeyField] == '*')) {
- // Do not write "*" values
- $this->strInfoMessage .= translate('Entry'). ' ' .$strKeyField. ' -> ' .
- $arrImportData[$strKeyField]['value']. ' ' .translate('inside'). ' ' .
- $strTable. ' ' .translate('were not written'). '::';
+ $this->strInfoMessage .= translate('Entry') . ' ' . $strKeyField . ' -> ' .
+ $arrImportData[$strKeyField]['value'] . ' ' . translate('inside') . ' ' .
+ $strTable . ' ' . translate('exists and were not overwritten') . '::';
+ } elseif (isset($arrImportData[$strKeyField]) && ($arrImportData[$strKeyField] === '*')) {
+ /* Do not write "*" values */
+ $this->strInfoMessage .= translate('Entry') . ' ' . $strKeyField . ' -> ' .
+ $arrImportData[$strKeyField]['value'] . ' ' . translate('inside') . ' ' .
+ $strTable . ' ' . translate('were not written') . '::';
} else {
- // Define SQL statement - part 1
+ $strSQL1 = '';
+ $strSQL2 = '';
+ /* Define SQL statement - part 1 */
$this->getSQLPart1(
$arrImportData,
$strHash,
@@ -368,15 +374,15 @@ class NagImportClass
$strSQL1,
$strSQL2
);
- // Read command configurations
- list($strVCValues, $intWriteConfig, $strVIValues, $strRLValues, $strVWValues) =
+ /* Read command configurations */
+ [$strVCValues, $intWriteConfig, $strVIValues, $strRLValues, $strVWValues] =
$this->getImportValues($arrImportData, $strKeyField, $strSQL1, $strTable);
- // Build value statemets
+ /* Build value statemets */
foreach ($arrImportData as $elem) {
- // Write text values
- $intCheckVC = $this->writeTextValues(
+ /* Write text values */
+ $intCheckVC = $this->writeTextValues(
$elem,
$strVCValues,
$strSQL1,
@@ -384,76 +390,76 @@ class NagImportClass
$intExists,
$strTable
);
- // Write status values
- $intCheckVI = $this->writeStatusValues($elem, $strVIValues, $strSQL1);
- // Write integer values
- $intCheckVW = $this->writeIntegerValues($elem, $strVWValues, $strSQL1);
- // Write relations
+ /* Write status values */
+ $intCheckVI = $this->writeStatusValues($elem, $strVIValues, $strSQL1);
+ /* Write integer values */
+ $intCheckVW = $this->writeIntegerValues($elem, $strVWValues, $strSQL1);
+ /* Write relations */
$intCheckRel = $this->writeRelations($elem, $strRLValues, $arrImportRelations, $intInsertRelations);
- // Write free variables
- $intCheck = $intCheckVC+$intCheckVI+$intCheckVW+$intCheckRel;
- if ($intCheck == 0) {
- $arrTemp = array();
- $arrTemp['key'] = $elem['key'];
- $arrTemp['value'] = $elem['value'];
+ /* Write free variables */
+ $intCheck = $intCheckVC + $intCheckVI + $intCheckVW + $intCheckRel;
+ if ($intCheck === 0) {
+ $arrTemp = array();
+ $arrTemp['key'] = $elem['key'];
+ $arrTemp['value'] = $elem['value'];
$arrFreeVariables[] = $arrTemp;
$intInsertVariables = 1;
}
}
$strTemp1 = '';
$strTemp2 = '';
- // Update database
- if ($intWriteConfig == 1) {
- $booResult = $this->myDBClass->insertData($strSQL1.$strSQL2);
+ /* Update database */
+ if ($intWriteConfig === 1) {
+ $booResult = $this->myDBClass->insertData($strSQL1 . $strSQL2);
} else {
$booResult = false;
}
- if ($strKeyField == '') {
+ if ($strKeyField === '') {
$strKey = $strConfigName;
} else {
$strKey = $strKeyField;
}
- if ($booResult != true) {
+ if ($booResult !== true) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
- if ($strKeyField != '') {
- $this->strErrorMessage .= translate('Entry'). ' ' .$strKey. ' -> ' .
- $arrImportData[$strKeyField]['value']. ' ' .translate('inside').
- ' ' .$strTable. ' ' .translate('could not be inserted:'). ' ' .
- $this->myDBClass->strErrorMessage. '::';
+ if ($strKeyField !== '') {
+ $this->strErrorMessage .= translate('Entry') . ' ' . $strKey . ' -> ' .
+ $arrImportData[$strKeyField]['value'] . ' ' . translate('inside') .
+ ' ' . $strTable . ' ' . translate('could not be inserted:') . ' ' .
+ $this->myDBClass->strErrorMessage . '::';
}
- if ($strKeyField == '') {
- $this->strErrorMessage .= translate('Entry'). ' ' .$strTemp1. ' -> ' .
- $strTemp2.translate('inside'). ' ' .$strTable. ' ' .$strTable.
- ' ' .translate('could not be inserted:'). ' ' .$this->myDBClass->strErrorMessage. '::';
+ if ($strKeyField === '') {
+ $this->strErrorMessage .= translate('Entry') . ' ' . $strTemp1 . ' -> ' .
+ $strTemp2 . translate('inside') . ' ' . $strTable . ' ' . $strTable .
+ ' ' . translate('could not be inserted:') . ' ' . $this->myDBClass->strErrorMessage . '::';
}
return 1;
}
- if ($strKeyField != '') {
- $this->strInfoMessage .= translate('Entry'). ' ' .$strKey. ' -> ' .
- $arrImportData[$strKeyField]['value']. ' ' .translate('inside').
- ' ' .$strTable. ' ' .translate('successfully inserted'). '::';
+ if ($strKeyField !== '') {
+ $this->strInfoMessage .= translate('Entry') . ' ' . $strKey . ' -> ' .
+ $arrImportData[$strKeyField]['value'] . ' ' . translate('inside') .
+ ' ' . $strTable . ' ' . translate('successfully inserted') . '::';
}
- if ($strKeyField == '') {
- $this->strInfoMessage .= translate('Entry'). ' ' .$strTemp1. ' -> ' .
- $strTemp2. ' ' .translate('inside'). ' ' .$strTable.
- ' ' .translate('successfully inserted'). '::';
+ if ($strKeyField === '') {
+ $this->strInfoMessage .= translate('Entry') . ' ' . $strTemp1 . ' -> ' .
+ $strTemp2 . ' ' . translate('inside') . ' ' . $strTable .
+ ' ' . translate('successfully inserted') . '::';
}
- // Define data ID
- if ($intExists != 0) {
+ /* Define data ID */
+ if ($intExists !== 0) {
$intDataId = $intExists;
} else {
$intDataId = $this->myDBClass->intLastId;
}
- // Are there any relations to be filled in?
- if ($intInsertRelations == 1) {
+ /* Are there any relations to be filled in? */
+ if ($intInsertRelations === 1) {
foreach ($arrImportRelations as $elem) {
foreach ($arrRelations as $reldata) {
- if ($reldata['fieldName'] == $elem['key']) {
+ if ($reldata['fieldName'] === $elem['key']) {
$strValue = $elem['value'];
- $strKey = $elem['key'];
- if ($elem['key'] == 'check_command') {
+ $strKey = $elem['key'];
+ if ($elem['key'] === 'check_command') {
$this->writeRelation5($strValue, $intDataId, $strTable, $reldata);
- } elseif ($reldata['type'] == 1) {
+ } elseif ((int)$reldata['type'] === 1) {
$this->writeRelation1(
$strKey,
$strValue,
@@ -462,58 +468,61 @@ class NagImportClass
$reldata,
$arrImportData
);
- } elseif ($reldata['type'] == 2) {
+ } elseif ((int)$reldata['type'] === 2) {
$this->writeRelation2($strKey, $strValue, $intDataId, $strTable, $reldata);
- } elseif ($reldata['type'] == 3) {
+ } elseif ((int)$reldata['type'] === 3) {
$this->writeRelation3($strValue, $intDataId, $strTable, $reldata);
- } elseif ($reldata['type'] == 4) {
- $this->writeRelation4($strKey, $strValue, $intDataId, $strTable, $reldata);
- } elseif ($reldata['type'] == 5) {
+ } elseif ((int)$reldata['type'] === 4) {
+ $this->writeRelation4($strKey, $strValue, $intDataId, 0, $strTable, $reldata);
+ } elseif ((int)$reldata['type'] === 5) {
$this->writeRelation6($strValue, $intDataId, $strTable, $reldata);
- } elseif ($reldata['type'] == 6) {
+ } elseif ((int)$reldata['type'] === 6) {
$this->writeRelation7($strValue, $intDataId, $strTable, $reldata);
- } elseif ($reldata['type'] == 7) {
+ } elseif ((int)$reldata['type'] === 7) {
$this->writeRelation8($strValue, $intDataId, $strTable, $reldata);
}
}
}
}
}
- // Are there any free variables ore time definitions to be filled in?
- if ($intInsertVariables == 1) {
- if ($strTable == 'tbl_timeperiod') {
- // Remove old values
- $strSQL = "DELETE FROM `tbl_timedefinition` WHERE `tipId` = $intDataId";
+ /* Are there any free variables ore time definitions to be filled in? */
+ if ($intInsertVariables === 1) {
+ if ($strTable === 'tbl_timeperiod') {
+ /* Remove old values */
+ $strSQL = "DELETE FROM `tbl_timedefinition` WHERE `tipId` = $intDataId";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
foreach ($arrFreeVariables as $elem) {
- $strSQL = "INSERT INTO `tbl_timedefinition` SET `tipId` = $intDataId, ".
- "`definition` = '".addslashes($elem['key'])."', ".
- "`range` = '".addslashes($elem['value'])."'";
+ $strSQL = "INSERT INTO `tbl_timedefinition` SET `tipId` = $intDataId, " .
+ "`definition` = '" . addslashes($elem['key']) . "', " .
+ "`range` = '" . addslashes($elem['value']) . "'";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
} else {
+ $intRemoveOldVariables = 1;
foreach ($arrFreeVariables as $elem) {
foreach ($arrRelations as $reldata) {
- if ($reldata['type'] == 4) {
+ if ((int)$reldata['type'] === 4) {
$this->writeRelation4(
$elem['key'],
$elem['value'],
$intDataId,
+ $intRemoveOldVariables,
$strTable,
$reldata
);
+ $intRemoveOldVariables = 0;
}
}
}
}
}
- // Update Table times
+ /* Update Table times */
$this->myDataClass->updateStatusTable($strTable);
}
}
@@ -522,46 +531,45 @@ class NagImportClass
/**
* Get table name and key for import
- * @param string $strBlockKey Block data key
- * @param int $intIsTemplate Template data 1 = yes / 0 - no
- * @param string $strTable Template name
- * @param string $strKeyField Table key name
- * @return int 0 = successful / 1 = error
+ * @param string $strBlockKey Block data key
+ * @param int $intIsTemplate Template data 1 = yes / 0 - no
+ * @param string $strTable Template name
+ * @param string $strKeyField Table key name
+ * @return int 0 = successful / 1 = error
*/
- private function getTableData($strBlockKey, $intIsTemplate, &$strTable, &$strKeyField)
+ private function getTableData(string $strBlockKey, int $intIsTemplate, string &$strTable, string &$strKeyField): int
{
- // Define variables
+ /* Define variables */
$intReturn = 0;
- $arrTableData['command'] = array('tbl_command', 'command_name');
- $arrTableData['contactgroup'] = array('tbl_contactgroup', 'contactgroup_name');
- $arrTableData['contact'] = array('tbl_contact', 'contact_name');
- $arrTableData['timeperiod'] = array('tbl_timeperiod', 'timeperiod_name');
- $arrTableData['host'] = array('tbl_host', 'host_name');
- $arrTableData['service'] = array('tbl_service', '');
- $arrTableData['hostgroup'] = array('tbl_hostgroup', 'hostgroup_name');
- $arrTableData['servicegroup'] = array('tbl_servicegroup', 'servicegroup_name');
- $arrTableData['hostescalation'] = array('tbl_hostescalation', '');
- $arrTableData['serviceescalation'] = array('tbl_serviceescalation', '');
- $arrTableData['hostdependency'] = array('tbl_hostdependency', '');
- $arrTableData['servicedependency'] = array('tbl_servicedependency', '');
- $arrTableData['hostextinfo'] = array('tbl_hostextinfo', 'host_name');
- $arrTableData['serviceextinfo'] = array('tbl_serviceextinfo', '');
- $arrTableData['contactgroup'] = array('tbl_contactgroup', 'contactgroup_name');
- $arrTableDataTpl['contact'] = array('tbl_contacttemplate', 'name');
- $arrTableDataTpl['host'] = array('tbl_hosttemplate', 'name');
- $arrTableDataTpl['service'] = array('tbl_servicetemplate', 'name');
+ $arrTableData['command'] = array('tbl_command', 'command_name');
+ $arrTableData['contactgroup'] = array('tbl_contactgroup', 'contactgroup_name');
+ $arrTableData['contact'] = array('tbl_contact', 'contact_name');
+ $arrTableData['timeperiod'] = array('tbl_timeperiod', 'timeperiod_name');
+ $arrTableData['host'] = array('tbl_host', 'host_name');
+ $arrTableData['service'] = array('tbl_service', '');
+ $arrTableData['hostgroup'] = array('tbl_hostgroup', 'hostgroup_name');
+ $arrTableData['servicegroup'] = array('tbl_servicegroup', 'servicegroup_name');
+ $arrTableData['hostescalation'] = array('tbl_hostescalation', '');
+ $arrTableData['serviceescalation'] = array('tbl_serviceescalation', '');
+ $arrTableData['hostdependency'] = array('tbl_hostdependency', '');
+ $arrTableData['servicedependency'] = array('tbl_servicedependency', '');
+ $arrTableData['hostextinfo'] = array('tbl_hostextinfo', 'host_name');
+ $arrTableData['serviceextinfo'] = array('tbl_serviceextinfo', '');
+ $arrTableDataTpl['contact'] = array('tbl_contacttemplate', 'name');
+ $arrTableDataTpl['host'] = array('tbl_hosttemplate', 'name');
+ $arrTableDataTpl['service'] = array('tbl_servicetemplate', 'name');
- // Define table name and key
- if (($intIsTemplate == 0) && isset($arrTableData[$strBlockKey])) {
- $strTable = $arrTableData[$strBlockKey][0];
+ /* Define table name and key */
+ if (($intIsTemplate === 0) && isset($arrTableData[$strBlockKey])) {
+ $strTable = $arrTableData[$strBlockKey][0];
/** @noinspection MultiAssignmentUsageInspection */
$strKeyField = $arrTableData[$strBlockKey][1];
- } elseif (($intIsTemplate == 1) && isset($arrTableDataTpl[$strBlockKey])) {
- $strTable = $arrTableDataTpl[$strBlockKey][0];
+ } elseif (($intIsTemplate === 1) && isset($arrTableDataTpl[$strBlockKey])) {
+ $strTable = $arrTableDataTpl[$strBlockKey][0];
/** @noinspection MultiAssignmentUsageInspection */
- $strKeyField = $arrTableDataTpl[$strBlockKey][1];
+ $strKeyField = $arrTableDataTpl[$strBlockKey][1];
} else {
- $this->strErrorMessage .= translate('Table for import definition').$strBlockKey.
+ $this->strErrorMessage .= translate('Table for import definition') . $strBlockKey .
translate('is not available!') . '::';
$intReturn = 1;
}
@@ -570,206 +578,210 @@ class NagImportClass
/**
* Create a unique data hash from table data
- * @param $strTable
- * @param $arrBlockData
- * @param $strHash
- * @param $strConfigName
+ * @param string $strTable
+ * @param array $arrBlockData
+ * @param string $strHash
+ * @param string $strConfigName
*/
- public function createHash($strTable, $arrBlockData, &$strHash, &$strConfigName)
+ public function createHash(string $strTable, array $arrBlockData, string &$strHash, string &$strConfigName): void
{
- $strRawString = '';
+ $strRawString = '';
$strConfigName = 'imp_temporary';
- if ($strTable == 'tbl_service') {
- // HASH from any host, any hostgroup and service description - step 1
+ if ($strTable === 'tbl_service') {
+ /* HASH from any host, any hostgroup and service description - step 1 */
if (isset($arrBlockData['host_name'])) {
- $strRawString .= $arrBlockData['host_name']['value']. ',';
+ $strRawString .= $arrBlockData['host_name']['value'] . ',';
}
if (isset($arrBlockData['hostgroup_name'])) {
- $strRawString .= $arrBlockData['hostgroup_name']['value']. ',';
+ $strRawString .= $arrBlockData['hostgroup_name']['value'] . ',';
}
- // Replace *, + and ! in HASH raw string
+ /* Replace *, + and ! in HASH raw string */
$strRawString = str_replace(array('*,', '!', '+'), array('any,', 'not_', ''), $strRawString);
- // Create configuration name from NagiosQL variable if exists
+ /* Create configuration name from NagiosQL variable if exists */
if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) {
- $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value'];
+ $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value'];
} else {
- // Create configuration name from first two hosts / hostgroups
- $arrConfig = explode(',', $strRawString);
- if (isset($arrConfig[0]) && ($arrConfig[0] != '')) {
- $strConfigName = 'imp_' .$arrConfig[0];
+ /* Create configuration name from first two hosts / hostgroups */
+ $arrConfig = explode(',', $strRawString);
+ if (isset($arrConfig[0]) && ($arrConfig[0] !== '')) {
+ $strConfigName = 'imp_' . $arrConfig[0];
}
- if (isset($arrConfig[1]) && ($arrConfig[1] != '')) {
- $strConfigName .= '_' .$arrConfig[1];
+ if (isset($arrConfig[1]) && ($arrConfig[1] !== '')) {
+ $strConfigName .= '_' . $arrConfig[1];
}
}
- // HASH from any host, any hostgroup and service description - step 2
+ /* HASH from any host, any hostgroup and service description - step 2 */
if (isset($arrBlockData['service_description'])) {
- $strRawString .= $arrBlockData['service_description']['value']. ',';
+ $strRawString .= $arrBlockData['service_description']['value'] . ',';
}
if (isset($arrBlockData['display_name'])) {
- $strRawString .= $arrBlockData['display_name']['value']. ',';
+ $strRawString .= $arrBlockData['display_name']['value'] . ',';
}
if (isset($arrBlockData['check_command'])) {
- $strRawString .= $arrBlockData['check_command']['value']. ',';
+ $strRawString .= $arrBlockData['check_command']['value'] . ',';
}
}
- if (($strTable == 'tbl_hostdependency') || ($strTable == 'tbl_servicedependency')) {
+ if (($strTable === 'tbl_hostdependency') || ($strTable === 'tbl_servicedependency')) {
$strRawString1 = '';
$strRawString2 = '';
$strRawString3 = '';
- // HASH from any dependent host and any dependent hostgroup
+ /* HASH from any dependent host and any dependent hostgroup */
if (isset($arrBlockData['dependent_host_name'])) {
- $strRawString1 .= $arrBlockData['dependent_host_name']['value']. ',';
+ $strRawString1 .= $arrBlockData['dependent_host_name']['value'] . ',';
}
if (isset($arrBlockData['dependent_hostgroup_name'])) {
- $strRawString1 .= $arrBlockData['dependent_hostgroup_name']['value']. ',';
+ $strRawString1 .= $arrBlockData['dependent_hostgroup_name']['value'] . ',';
}
if (isset($arrBlockData['host_name'])) {
- $strRawString2 .= $arrBlockData['host_name']['value']. ',';
+ $strRawString2 .= $arrBlockData['host_name']['value'] . ',';
}
if (isset($arrBlockData['hostgroup_name'])) {
- $strRawString2 .= $arrBlockData['hostgroup_name']['value']. ',';
+ $strRawString2 .= $arrBlockData['hostgroup_name']['value'] . ',';
}
if (isset($arrBlockData['dependent_service_description'])) {
- $strRawString3 .= $arrBlockData['dependent_service_description']['value']. ',';
+ $strRawString3 .= $arrBlockData['dependent_service_description']['value'] . ',';
}
if (isset($arrBlockData['service_description'])) {
- $strRawString3 .= $arrBlockData['service_description']['value']. ',';
+ $strRawString3 .= $arrBlockData['service_description']['value'] . ',';
}
if (isset($arrBlockData['dependent_servicegroup_name'])) {
- $strRawString3 .= $arrBlockData['dependent_servicegroup_name']['value']. ',';
+ $strRawString3 .= $arrBlockData['dependent_servicegroup_name']['value'] . ',';
}
if (isset($arrBlockData['servicegroup_name'])) {
- $strRawString3 .= $arrBlockData['servicegroup_name']['value']. ',';
+ $strRawString3 .= $arrBlockData['servicegroup_name']['value'] . ',';
}
- // Replace *, + and ! in HASH raw string
+ /* Replace *, + and ! in HASH raw string */
$strRawString1 = str_replace('*,', 'any,', $strRawString1);
$strRawString2 = str_replace('*,', 'any,', $strRawString2);
$strRawString3 = str_replace('*,', 'any,', $strRawString3);
$strRawString1 = str_replace('!', 'not_', $strRawString1);
$strRawString2 = str_replace('!', 'not_', $strRawString2);
$strRawString3 = str_replace('!', 'not_', $strRawString3);
- // Create configuration name from NagiosQL variable if exists
+ /* Create configuration name from NagiosQL variable if exists */
if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) {
- $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value'];
+ $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value'];
} else {
- $arrConfig1 = explode(',', $strRawString1);
- $arrConfig2 = explode(',', $strRawString2);
- $arrConfig3 = explode(',', $strRawString3);
+ $arrConfig1 = explode(',', $strRawString1);
+ $arrConfig2 = explode(',', $strRawString2);
+ $arrConfig3 = explode(',', $strRawString3);
if (isset($arrConfig1[0])) {
- $strConfigName = 'imp_' .$arrConfig1[0];
+ $strConfigName = 'imp_' . $arrConfig1[0];
}
if (isset($arrConfig2[0])) {
- $strConfigName .= '_' .$arrConfig2[0];
+ $strConfigName .= '_' . $arrConfig2[0];
}
if (isset($arrConfig3[0])) {
- $strConfigName .= '_' .$arrConfig3[0];
+ $strConfigName .= '_' . $arrConfig3[0];
}
- $strSQL = 'SELECT * FROM `' .$strTable."` WHERE `config_name`='$strConfigName'";
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booRet && ($intDC != 0)) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTable . "` WHERE `config_name`='$strConfigName'";
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booRet && ($intDC !== 0)) {
$intCounter = 1;
do {
- $strConfigNameTemp = $strConfigName. '_' .$intCounter;
- $strSQL = 'SELECT * FROM `' .$strTable."` WHERE `config_name`='$strConfigNameTemp'";
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ $strConfigNameTemp = $strConfigName . '_' . $intCounter;
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTable . "` WHERE `config_name`='$strConfigNameTemp'";
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
$intCounter++;
- } while ($booRet && ($intDC != 0));
+ } while ($booRet && ($intDC !== 0));
$strConfigName = $strConfigNameTemp;
}
}
- // HASH string
- $strRawString = $strRawString1.$strRawString2.$strRawString3;
+ /* HASH string */
+ $strRawString = $strRawString1 . $strRawString2 . $strRawString3;
$strRawString = substr($strRawString, 0, -1);
}
- if (($strTable == 'tbl_hostescalation') || ($strTable == 'tbl_serviceescalation')) {
+ if (($strTable === 'tbl_hostescalation') || ($strTable === 'tbl_serviceescalation')) {
$strRawString1 = '';
$strRawString2 = '';
$strRawString3 = '';
- // HASH from any host and any hostgroup
+ /* HASH from any host and any hostgroup */
if (isset($arrBlockData['host_name'])) {
- $strRawString1 .= $arrBlockData['host_name']['value']. ',';
+ $strRawString1 .= $arrBlockData['host_name']['value'] . ',';
}
if (isset($arrBlockData['hostgroup_name'])) {
- $strRawString1 .= $arrBlockData['hostgroup_name']['value']. ',';
+ $strRawString1 .= $arrBlockData['hostgroup_name']['value'] . ',';
}
if (isset($arrBlockData['contacts'])) {
- $strRawString2 .= $arrBlockData['contacts']['value']. ',';
+ $strRawString2 .= $arrBlockData['contacts']['value'] . ',';
}
if (isset($arrBlockData['contact_groups'])) {
- $strRawString2 .= $arrBlockData['contact_groups']['value']. ',';
+ $strRawString2 .= $arrBlockData['contact_groups']['value'] . ',';
}
if (isset($arrBlockData['service_description'])) {
- $strRawString3 .= $arrBlockData['service_description']['value']. ',';
+ $strRawString3 .= $arrBlockData['service_description']['value'] . ',';
}
- // Replace *, + and ! in HASH raw string
+ /* Replace *, + and ! in HASH raw string */
$strRawString1 = str_replace('*,', 'any,', $strRawString1);
$strRawString2 = str_replace('*,', 'any,', $strRawString2);
$strRawString3 = str_replace('*,', 'any,', $strRawString3);
$strRawString1 = str_replace('!', 'not_', $strRawString1);
$strRawString2 = str_replace('!', 'not_', $strRawString2);
$strRawString3 = str_replace('!', 'not_', $strRawString3);
- // Create configuration name from NagiosQL variable if exists
+ /* Create configuration name from NagiosQL variable if exists */
if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) {
- $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value'];
+ $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value'];
} else {
- $arrConfig1 = explode(',', $strRawString1);
- $arrConfig2 = explode(',', $strRawString2);
- $arrConfig3 = explode(',', $strRawString3);
+ $arrConfig1 = explode(',', $strRawString1);
+ $arrConfig2 = explode(',', $strRawString2);
+ $arrConfig3 = explode(',', $strRawString3);
if (isset($arrConfig1[0])) {
- $strConfigName = 'imp_' .$arrConfig1[0];
+ $strConfigName = 'imp_' . $arrConfig1[0];
}
if (isset($arrConfig2[0])) {
- $strConfigName .= '_' .$arrConfig2[0];
+ $strConfigName .= '_' . $arrConfig2[0];
}
if (isset($arrConfig3[0])) {
- $strConfigName .= '_' .$arrConfig3[0];
+ $strConfigName .= '_' . $arrConfig3[0];
}
- $strSQL = 'SELECT * FROM `' .$strTable."` WHERE `config_name`='$strConfigName'";
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
- if ($booRet && ($intDC != 0)) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTable . "` WHERE `config_name`='$strConfigName'";
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ if ($booRet && ($intDC !== 0)) {
$intCounter = 1;
do {
- $strConfigNameTemp = $strConfigName. '_' .$intCounter;
- $strSQL = 'SELECT * FROM `' .$strTable."` WHERE `config_name`='$strConfigNameTemp'";
- $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
+ $strConfigNameTemp = $strConfigName . '_' . $intCounter;
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strTable . "` WHERE `config_name`='$strConfigNameTemp'";
+ $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC);
$intCounter++;
- } while ($booRet && ($intDC != 0));
+ } while ($booRet && ($intDC !== 0));
$strConfigName = $strConfigNameTemp;
}
}
- // HASH string
- $strRawString = $strRawString1.$strRawString2.$strRawString3;
+ /* HASH string */
+ $strRawString = $strRawString1 . $strRawString2 . $strRawString3;
$strRawString = substr($strRawString, 0, -1);
}
- if ($strTable == 'tbl_serviceextinfo') {
- // HASH from any host, any hostgroup and service description - step 1
+ if ($strTable === 'tbl_serviceextinfo') {
+ /* HASH from any host, any hostgroup and service description - step 1 */
if (isset($arrBlockData['host_name'])) {
- $strRawString .= $arrBlockData['host_name']['value']. ',';
+ $strRawString .= $arrBlockData['host_name']['value'] . ',';
}
if (isset($arrBlockData['service_description'])) {
- $strRawString .= $arrBlockData['service_description']['value']. ',';
+ $strRawString .= $arrBlockData['service_description']['value'] . ',';
}
- // HASH string
+ /* HASH string */
$strRawString = substr($strRawString, 0, -1);
- // Create configuration name from NagiosQL variable if exists
+ /* Create configuration name from NagiosQL variable if exists */
if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) {
- $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value'];
+ $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value'];
} else {
- // Create configuration name from first two items
- $arrConfig = explode(',', $strRawString);
- if (isset($arrConfig[0]) && ($arrConfig[0] != '')) {
- $strConfigName = 'imp_' .$arrConfig[0];
+ /* Create configuration name from first two items */
+ $arrConfig = explode(',', $strRawString);
+ if (isset($arrConfig[0]) && ($arrConfig[0] !== '')) {
+ $strConfigName = 'imp_' . $arrConfig[0];
}
- if (isset($arrConfig[1]) && ($arrConfig[1] != '')) {
- $strConfigName .= '_' .$arrConfig[1];
+ if (isset($arrConfig[1]) && ($arrConfig[1] !== '')) {
+ $strConfigName .= '_' . $arrConfig[1];
}
}
}
- while (substr_count($strRawString, ' ') != 0) {
+ while (substr_count($strRawString, ' ') !== 0) {
$strRawString = str_replace(' ', '', $strRawString);
}
- // Sort hash string
+ /* Sort hash string */
$arrTemp = explode(',', $strRawString);
sort($arrTemp);
$strRawString = implode(',', $arrTemp);
@@ -778,100 +790,106 @@ class NagImportClass
}
/**
- * @param array $arrImportData Imported block data
- * @param string $strHash Unique data hash
- * @param int $intExists Does the dataset already exist?
- * @param string $strTable Table name
- * @param string $strKeyField Table key file
- * @param int $intRelation Relation type
- * @param array $arrRelations Relation array
- * @param string $strSQL1 SQL statement part 1
- * @param string $strSQL2 SQL statement part 2
+ * @param array $arrImportData Imported block data
+ * @param string $strHash Unique data hash
+ * @param int $intExists Does the dataset already exist?
+ * @param string $strTable Table name
+ * @param string $strKeyField Table key file
+ * @param int $intRelation Relation type
+ * @param array $arrRelations Relation array
+ * @param string $strSQL1 SQL statement part 1
+ * @param string $strSQL2 SQL statement part 2
*/
private function getSQLPart1(
- $arrImportData,
- $strHash,
- $intExists,
- $strTable,
- $strKeyField,
- $intRelation,
- $arrRelations,
- &$strSQL1,
- &$strSQL2
- ) {
- // Define variables
+ array &$arrImportData,
+ string $strHash,
+ int $intExists,
+ string $strTable,
+ string $strKeyField,
+ int $intRelation,
+ array $arrRelations,
+ string &$strSQL1,
+ string &$strSQL2
+ ): void
+ {
+ /* Define variables */
$intActive = 1;
- $arrData = array();
+ $arrData = array();
$intDataCount = 0;
- if ($strHash != '') {
+ if ($strHash !== '') {
$strHash = " `import_hash`='" . $strHash . "', ";
}
- if ($intExists != 0) {
- // Update database
- $strSQL1 = 'UPDATE `' .$strTable. '` SET ';
- $strSQL2 = ' `config_id`=' .$this->intDomainId.", $strHash `active`='$intActive', ".
+ if ($intExists !== 0) {
+ /* Update database */
+ $strSQL1 = 'UPDATE `' . $strTable . '` SET ';
+ $strSQL2 = ' `config_id`=' . $this->intDomainId . ", $strHash `active`='$intActive', " .
"`last_modified`=NOW() WHERE `id`=$intExists";
- // Keep config name while update
- if (($strKeyField == 'config_name') && !isset($arrImportData['_NAGIOSQL_CONFIG_NAME'])) {
- $strSQLConfig = 'SELECT `config_name` FROM `' .$strTable. '` WHERE `id`=' . $intExists;
+ /* Keep config name while update */
+ if (($strKeyField === 'config_name') && !isset($arrImportData['_NAGIOSQL_CONFIG_NAME'])) {
+ /** @noinspection SqlResolve */
+ $strSQLConfig = 'SELECT `config_name` FROM `' . $strTable . '` WHERE `id`=' . $intExists;
$arrImportData['config_name']['value'] = $this->myDBClass->getFieldData($strSQLConfig);
}
- // Remove free variables
- if ($intRelation != 0) {
+ /* Remove free variables */
+ if ($intRelation !== 0) {
foreach ($arrRelations as $relVar) {
- if ($relVar['type'] == 4) {
- $strSQL = 'SELECT * FROM `' .$relVar['linkTable']."` WHERE `idMaster`=$intExists";
+ if ((int)$relVar['type'] === 4) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $relVar['linkTable'] . "` WHERE `idMaster`=$intExists";
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn && ($intDataCount != 0)) {
+ if ($booReturn && ($intDataCount !== 0)) {
foreach ($arrData as $elem) {
- $strSQL = 'DELETE FROM `tbl_variabledefinition` WHERE `id`=' .$elem['idSlave'];
+ $strSQL = 'DELETE FROM `tbl_variabledefinition` WHERE `id`=' . $elem['idSlave'];
$this->myDataClass->dataInsert($strSQL, $intInsertId);
}
}
- $strSQL = 'DELETE FROM `' .$relVar['linkTable']."` WHERE `idMaster`=$intExists";
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $relVar['linkTable'] . "` WHERE `idMaster`=$intExists";
$this->myDataClass->dataInsert($strSQL, $intInsertId);
}
}
}
} else {
- // DB Eintrag einfügen
- $test='';
- $strSQL1 = 'INSERT INTO `' .$strTable."` SET $test";
- $strSQL2 = ' `config_id`=' .$this->intDomainId.", $strHash `active`='$intActive', `last_modified`=NOW()";
+ /* DB Eintrag einfügen */
+ $test = '';
+ /** @noinspection SqlResolve */
+ $strSQL1 = 'INSERT INTO `' . $strTable . "` SET $test";
+ $strSQL2 = ' `config_id`=' . $this->intDomainId . ", $strHash `active`='$intActive', `last_modified`=NOW()";
}
}
/**
- * @param array $arrImportData Imported block data
- * @param string $strKeyField Table key file
- * @param string $strSQL1 SQL statement part 1
- * @param string $strTable Table name
- * @return array List of import values
+ * @param array $arrImportData Imported block data
+ * @param string $strKeyField Table key file
+ * @param string $strSQL1 SQL statement part 1
+ * @param string $strTable Table name
+ * @return array List of import values
*/
- private function getImportValues($arrImportData, $strKeyField, &$strSQL1, $strTable)
+ private function getImportValues(array $arrImportData, string $strKeyField, string &$strSQL1, string $strTable): array
{
- // Description for the values
- // --------------------------
- // $strVCValues = Simple text values, will be stored as varchar / null = 'null' as text value / empty = ''
- // $strRLValues = Relations - values with relations to other tables
- // $strVWValues = Integer values - will be stored as INT values / null = -1, / empty values as NULL
- // $strVIValues = Decision values 0 = no, 1 = yes, 2 = skip, 3 = null
+ /* Description for the values
+ * --------------------------
+ * $strVCValues = Simple text values, will be stored as varchar / null = 'null' as text value / empty = ''
+ * $strRLValues = Relations - values with relations to other tables
+ * $strVWValues = Integer values - will be stored as INT values / null = -1, / empty values as NULL
+ * $strVIValues = Decision values 0 = no, 1 = yes, 2 = skip, 3 = null
+ */
- // Define variables
- $strVCValues = '';
- $strVIValues = '';
- $strRLValues = '';
- $strVWValues = '';
+ /* Define variables */
+ $strVCValues = '';
+ $strVIValues = '';
+ $strRLValues = '';
+ $strVWValues = '';
$intWriteConfig = 0;
- // Read command configurations
- if ($strKeyField == 'command_name') {
+ /* Read command configurations */
+ if ($strKeyField === 'command_name') {
$strVCValues = 'command_name,command_line';
- // Find out command type
+ /* Find out command type */
if (isset($arrImportData['command_line'])) {
- if ((substr_count($arrImportData['command_line']['value'], 'ARG1') != 0) ||
- (substr_count($arrImportData['command_line']['value'], 'USER1') != 0)) {
+ if ((substr_count($arrImportData['command_line']['value'], 'ARG1') !== 0) ||
+ (substr_count($arrImportData['command_line']['value'], 'USER1') !== 0)) {
$strSQL1 .= '`command_type` = 1,';
} else {
$strSQL1 .= '`command_type` = 2,';
@@ -879,58 +897,58 @@ class NagImportClass
}
$intWriteConfig = 1;
- // Read contact configurations
- } elseif ($strKeyField == 'contact_name') {
- $strVCValues = 'contact_name,alias,host_notification_options,service_notification_options,email,';
+ /* Read contact configurations */
+ } elseif ($strKeyField === 'contact_name') {
+ $strVCValues = 'contact_name,alias,host_notification_options,service_notification_options,email,';
$strVCValues .= 'pager,address1,address2,address3,address4,address5,address6,name';
- $strVWValues = 'minimum_importance';
+ $strVWValues = 'minimum_importance';
- $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
+ $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
$strVIValues .= 'retain_status_information,retain_nonstatus_information';
- $strRLValues = 'contactgroups,host_notification_period,service_notification_period,';
+ $strRLValues = 'contactgroups,host_notification_period,service_notification_period,';
$strRLValues .= 'host_notification_commands,service_notification_commands,use';
$intWriteConfig = 1;
- // Read contactgroup configurations
- } elseif ($strKeyField == 'contactgroup_name') {
+ /* Read contactgroup configurations */
+ } elseif ($strKeyField === 'contactgroup_name') {
$strVCValues = 'contactgroup_name,alias';
$strRLValues = 'members,contactgroup_members';
$intWriteConfig = 1;
- // Read timeperiod configurations
- } elseif ($strKeyField == 'timeperiod_name') {
+ /* Read timeperiod configurations */
+ } elseif ($strKeyField === 'timeperiod_name') {
$strVCValues = 'timeperiod_name,alias,name';
$strRLValues = 'use,exclude';
$intWriteConfig = 1;
- // Read contacttemplate configurations
- } elseif (($strKeyField == 'name') && ($strTable == 'tbl_contacttemplate')) {
- $strVCValues = 'contact_name,alias,host_notification_options,service_notification_options,email,';
+ /* Read contacttemplate configurations */
+ } elseif (($strKeyField === 'name') && ($strTable === 'tbl_contacttemplate')) {
+ $strVCValues = 'contact_name,alias,host_notification_options,service_notification_options,email,';
$strVCValues .= 'pager,address1,address2,address3,address4,address5,address6,name';
- $strVWValues = 'minimum_importance';
+ $strVWValues = 'minimum_importance';
- $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
+ $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,';
$strVIValues .= 'retain_status_information,retain_nonstatus_information';
- $strRLValues = 'contactgroups,host_notification_period,service_notification_period,';
+ $strRLValues = 'contactgroups,host_notification_period,service_notification_period,';
$strRLValues .= 'host_notification_commands,service_notification_commands,use';
$intWriteConfig = 1;
- // Read host configurations
- } elseif ($strTable == 'tbl_host') {
- $strVCValues = 'host_name,alias,display_name,address,initial_state,flap_detection_options,';
+ /* Read host configurations */
+ } elseif ($strTable === 'tbl_host') {
+ $strVCValues = 'host_name,alias,display_name,address,initial_state,flap_detection_options,';
$strVCValues .= 'notification_options,stalking_options,notes,notes_url,action_url,icon_image,';
$strVCValues .= 'icon_image_alt,vrml_image,statusmap_image,2d_coords,3d_coords,name';
- $strVWValues = 'max_check_attempts,retry_interval,check_interval,freshness_threshold,low_flap_threshold,';
+ $strVWValues = 'max_check_attempts,retry_interval,check_interval,freshness_threshold,low_flap_threshold,';
$strVWValues .= 'high_flap_threshold,notification_interval,first_notification_delay,importance';
- $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,';
+ $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,';
$strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,';
$strVIValues .= 'retain_nonstatus_information,notifications_enabled';
@@ -938,75 +956,75 @@ class NagImportClass
$strRLValues .= 'notification_period';
$intWriteConfig = 1;
- // Read hosttemplate configurations
- } elseif (($strKeyField == 'name') && ($strTable == 'tbl_hosttemplate')) {
- $strVCValues = 'template_name,alias,initial_state,flap_detection_options,notification_options,';
+ /* Read hosttemplate configurations */
+ } elseif (($strKeyField === 'name') && ($strTable === 'tbl_hosttemplate')) {
+ $strVCValues = 'template_name,alias,initial_state,flap_detection_options,notification_options,';
$strVCValues .= 'stalking_options,notes,notes_url,action_url,icon_image,icon_image_alt,vrml_image,';
$strVCValues .= 'statusmap_image,2d_coords,3d_coords,name';
- $strVWValues = 'max_check_attempts,retry_interval,check_interval,freshness_threshold,low_flap_threshold,';
+ $strVWValues = 'max_check_attempts,retry_interval,check_interval,freshness_threshold,low_flap_threshold,';
$strVWValues .= 'high_flap_threshold,notification_interval,first_notification_delay,importance';
- $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,';
+ $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,';
$strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,';
$strVIValues .= 'retain_nonstatus_information,notifications_enabled';
- $strRLValues = 'parents,hostgroups,check_command,use,check_period,event_handler,contacts,contact_groups,';
+ $strRLValues = 'parents,hostgroups,check_command,use,check_period,event_handler,contacts,contact_groups,';
$strRLValues .= 'notification_period';
$intWriteConfig = 1;
- // Read hostgroup configurations
- } elseif ($strKeyField == 'hostgroup_name') {
+ /* Read hostgroup configurations */
+ } elseif ($strKeyField === 'hostgroup_name') {
$strVCValues = 'hostgroup_name,alias,notes,notes_url,action_url';
$strRLValues = 'members,hostgroup_members';
$intWriteConfig = 1;
- // Read service configurations
- } elseif ($strTable == 'tbl_service') {
- $strVCValues = 'service_description,display_name,initial_state,flap_detection_options,stalking_options,';
+ /* Read service configurations */
+ } elseif ($strTable === 'tbl_service') {
+ $strVCValues = 'service_description,display_name,initial_state,flap_detection_options,stalking_options,';
$strVCValues .= 'notes,notes_url,action_url,icon_image,icon_image_alt,name,config_name,';
$strVCValues .= 'notification_options';
- $strVWValues = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,';
+ $strVWValues = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,';
$strVWValues .= 'high_flap_threshold,notification_interval,first_notification_delay,importance';
- $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,';
+ $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,';
$strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,';
$strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,';
$strVIValues .= 'notifications_enabled';
- $strRLValues = 'host_name,hostgroup_name,servicegroups,use,check_command,check_period,event_handler,';
+ $strRLValues = 'host_name,hostgroup_name,servicegroups,use,check_command,check_period,event_handler,';
$strRLValues .= 'notification_period,contacts,contact_groups,parents';
$intWriteConfig = 1;
- // Read servicetemplate configurations
- } elseif (($strKeyField == 'name') && ($strTable == 'tbl_servicetemplate')) {
- $strVCValues = 'template_name,service_description,display_name,initial_state,flap_detection_options,';
+ /* Read servicetemplate configurations */
+ } elseif (($strKeyField === 'name') && ($strTable === 'tbl_servicetemplate')) {
+ $strVCValues = 'template_name,service_description,display_name,initial_state,flap_detection_options,';
$strVCValues .= 'stalking_options,notes,notes_url,action_url,icon_image,icon_image_alt,name,';
$strVCValues .= 'notification_options';
- $strVWValues = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,';
+ $strVWValues = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,';
$strVWValues .= 'high_flap_threshold,notification_interval,first_notification_delay,importance';
- $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,';
+ $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,';
$strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,';
$strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,';
$strVIValues .= 'notifications_enabled';
- $strRLValues = 'host_name,hostgroup_name,servicegroups,use,check_command,check_period,event_handler,';
+ $strRLValues = 'host_name,hostgroup_name,servicegroups,use,check_command,check_period,event_handler,';
$strRLValues .= 'notification_period,contacts,contact_groups,parents';
$intWriteConfig = 1;
- // Read servicegroup configurations
- } elseif ($strKeyField == 'servicegroup_name') {
+ /* Read servicegroup configurations */
+ } elseif ($strKeyField === 'servicegroup_name') {
$strVCValues = 'servicegroup_name,alias,notes,notes_url,action_url';
$strRLValues = 'members,servicegroup_members';
$intWriteConfig = 1;
- // Read hostdependency configurations
- } elseif ($strTable == 'tbl_hostdependency') {
+ /* Read hostdependency configurations */
+ } elseif ($strTable === 'tbl_hostdependency') {
$strVCValues = 'config_name,execution_failure_criteria,notification_failure_criteria';
$strVIValues = 'inherits_parent';
@@ -1014,8 +1032,8 @@ class NagImportClass
$strRLValues = 'dependent_host_name,dependent_hostgroup_name,host_name,hostgroup_name,dependency_period';
$intWriteConfig = 1;
- // Read hostescalation configurations
- } elseif ($strTable == 'tbl_hostescalation') {
+ /* Read hostescalation configurations */
+ } elseif ($strTable === 'tbl_hostescalation') {
$strVCValues = 'config_name,escalation_options';
$strVWValues = 'first_notification,last_notification,notification_interval';
@@ -1023,45 +1041,45 @@ class NagImportClass
$strRLValues = 'host_name,hostgroup_name,contacts,contact_groups,escalation_period';
$intWriteConfig = 1;
- // Read hostextinfo configurations
- } elseif ($strTable == 'tbl_hostextinfo') {
- $strVCValues = 'notes,notes_url,action_url,icon_image,icon_image_alt,vrml_image,statusmap_image,';
+ /* Read hostextinfo configurations */
+ } elseif ($strTable === 'tbl_hostextinfo') {
+ $strVCValues = 'notes,notes_url,action_url,icon_image,icon_image_alt,vrml_image,statusmap_image,';
$strVCValues .= '2d_coords,3d_coords';
$strRLValues = 'host_name';
$intWriteConfig = 1;
- // Read servicedependency configurations
- } elseif ($strTable == 'tbl_servicedependency') {
- $strVCValues = 'config_name,execution_failure_criteria,notification_failure_criteria';
+ /* Read servicedependency configurations */
+ } elseif ($strTable === 'tbl_servicedependency') {
+ $strVCValues = 'config_name,execution_failure_criteria,notification_failure_criteria';
- $strVIValues = 'inherits_parent';
+ $strVIValues = 'inherits_parent';
- $strRLValues = 'dependent_host_name,dependent_hostgroup_name,dependent_service_description,host_name,';
+ $strRLValues = 'dependent_host_name,dependent_hostgroup_name,dependent_service_description,host_name,';
$strRLValues .= 'hostgroup_name,dependency_period,service_description,dependent_servicegroup_name,';
$strRLValues .= 'servicegroup_name';
$intWriteConfig = 1;
- // Read serviceescalation configurations
- } elseif ($strTable == 'tbl_serviceescalation') {
- $strVCValues = 'config_name,escalation_options';
+ /* Read serviceescalation configurations */
+ } elseif ($strTable === 'tbl_serviceescalation') {
+ $strVCValues = 'config_name,escalation_options';
- $strVIValues = 'first_notification,last_notification,notification_interval';
+ $strVIValues = 'first_notification,last_notification,notification_interval';
- $strRLValues = 'host_name,hostgroup_name,contacts,contact_groups,service_description,escalation_period,';
+ $strRLValues = 'host_name,hostgroup_name,contacts,contact_groups,service_description,escalation_period,';
$strRLValues .= 'servicegroup_name';
$intWriteConfig = 1;
- // Serviceextinfo configurations
- } elseif ($strTable == 'tbl_serviceextinfo') {
+ /* Serviceextinfo configurations */
+ } elseif ($strTable === 'tbl_serviceextinfo') {
$strVCValues = 'notes,notes_url,action_url,icon_image,icon_image_alt';
$strRLValues = 'host_name,service_description';
$intWriteConfig = 1;
}
- // Common values (all configurations)
- if ($strVWValues == '') {
+ /* Common values (all configurations) */
+ if ($strVWValues === '') {
$strVWValues = 'register';
} else {
$strVWValues .= ',register';
@@ -1070,27 +1088,28 @@ class NagImportClass
}
/**
- * @param $elem
- * @param $strVCValues
- * @param $strSQL1
- * @param $intIsTemplate
- * @param $intExists
- * @param $strTable
+ * @param array $elem
+ * @param string $strVCValues
+ * @param string $strSQL1
+ * @param int $intIsTemplate
+ * @param int $intExists
+ * @param string $strTable
* @return int
*/
- private function writeTextValues($elem, $strVCValues, &$strSQL1, $intIsTemplate, $intExists, $strTable)
+ private function writeTextValues(array $elem, string $strVCValues, string &$strSQL1, int $intIsTemplate, int $intExists, string $strTable): int
{
$intCheck = 0;
- if (\in_array($elem['key'], explode(',', $strVCValues), true)) {
- if (strtolower(trim($elem['value'])) == 'null') {
+ if (in_array($elem['key'], explode(',', $strVCValues), true)) {
+ if (strtolower(trim($elem['value'])) === 'null') {
$strSQL1 .= '`' . $elem['key'] . "` = 'null',";
} else {
$elem['value'] = addslashes($elem['value']);
- if ($intIsTemplate == 1) {
- if ($elem['key'] == 'name') {
+ if ($intIsTemplate === 1) {
+ if ($elem['key'] === 'name') {
$strSQL1 .= "template_name = '" . $elem['value'] . "',";
- } elseif (($elem['key'] == 'config_name') && ($intExists != 0)) {
- // Do not overwrite config_names during an update!
+ } elseif (($elem['key'] === 'config_name') && ($intExists !== 0)) {
+ /* Do not overwrite config_names during an update! */
+ /** @noinspection SqlResolve */
$strSQLConfig = 'SELECT `config_name` FROM `' . $strTable . '` WHERE `id`=' . $intExists;
$elem['value'] = $this->myDBClass->getFieldData($strSQLConfig);
$strSQL1 .= '`' . $elem['key'] . "` = '" . $elem['value'] . "',";
@@ -1107,16 +1126,16 @@ class NagImportClass
}
/**
- * @param $elem
- * @param $strVIValues
- * @param $strSQL1
+ * @param array $elem
+ * @param string $strVIValues
+ * @param string $strSQL1
* @return int
*/
- private function writeStatusValues($elem, $strVIValues, &$strSQL1)
+ private function writeStatusValues(array $elem, string $strVIValues, string &$strSQL1): int
{
$intCheck = 0;
- if (\in_array($elem['key'], explode(',', $strVIValues), true)) {
- if (strtolower(trim($elem['value'])) == 'null') {
+ if (in_array($elem['key'], explode(',', $strVIValues), true)) {
+ if (strtolower(trim($elem['value'])) === 'null') {
$strSQL1 .= '`' . $elem['key'] . '` = 3,';
} else {
$strSQL1 .= '`' . $elem['key'] . "` = '" . $elem['value'] . "',";
@@ -1127,16 +1146,16 @@ class NagImportClass
}
/**
- * @param $elem
- * @param $strVWValues
- * @param $strSQL1
+ * @param array $elem
+ * @param string $strVWValues
+ * @param string $strSQL1
* @return int
*/
- private function writeIntegerValues($elem, $strVWValues, &$strSQL1)
+ private function writeIntegerValues(array $elem, string $strVWValues, string &$strSQL1): int
{
$intCheck = 0;
- if (\in_array($elem['key'], explode(',', $strVWValues), true)) {
- if (strtolower(trim($elem['value'])) == 'null') {
+ if (in_array($elem['key'], explode(',', $strVWValues), true)) {
+ if (strtolower(trim($elem['value'])) === 'null') {
$strSQL1 .= '`' . $elem['key'] . '` = -1,';
} else {
$strSQL1 .= '`' . $elem['key'] . "` = '" . $elem['value'] . "',";
@@ -1150,14 +1169,14 @@ class NagImportClass
* @param array $elem
* @param string $strRLValues
* @param array $arrImportRelations
- * @param $intInsertRelations
+ * @param int $intInsertRelations
* @return int
*/
- private function writeRelations(&$elem, $strRLValues, &$arrImportRelations, &$intInsertRelations)
+ private function writeRelations(array &$elem, string $strRLValues, array &$arrImportRelations, int &$intInsertRelations): int
{
$intCheck = 0;
- if (($intCheck == 0) && \in_array($elem['key'], explode(',', $strRLValues), true)) {
- if ($elem['key'] == 'use') {
+ if (($intCheck === 0) && in_array($elem['key'], explode(',', $strRLValues), true)) {
+ if ($elem['key'] === 'use') {
$elem['key'] = 'use_template';
}
$arrTemp = array();
@@ -1171,89 +1190,151 @@ class NagImportClass
}
/**
- * Inserts a relation type 1 (1:1)
- * @param string $strKey Data field name
- * @param string $strValue Data value
- * @param int $intDataId Data ID
- * @param string $strDataTable Data table (Master)
- * @param array $arrRelData Relation data
- * @param array $arrImportData Import Data
+ * Inserts a relation type 5 (1:1 check command)
+ * @param string $strValue Data value
+ * @param int $intDataId Data ID
+ * @param string $strDataTable Data table (Master)
+ * @param array $arrRelData Relation data
*/
- public function writeRelation1($strKey, $strValue, $intDataId, $strDataTable, $arrRelData, $arrImportData)
+ public function writeRelation5(string $strValue, int $intDataId, string $strDataTable, array $arrRelData): void
{
- // Define variables
+ /* Extract data values */
+ $arrCommand = explode('!', $strValue);
+ $strValue = $arrCommand[0];
+ /* Define variables */
$intSlaveId = 0;
- if (strtolower(trim($strValue)) == 'null') {
- // Update data in master table
- $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = -1 WHERE `id` = '
- .$intDataId;
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if (strtolower(trim($strValue)) === 'null') {
+ /* Update data in master table */
+ $strSQL = 'UPDATE `' . $strDataTable . '` SET `' . $arrRelData['fieldName'] . '` = -1 WHERE `id` = ' .
+ $intDataId;
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
} else {
- // Decompose data value
+ /* Decompose data values */
$arrValues = explode(',', $strValue);
- // Process data values
+ /* Process data values */
foreach ($arrValues as $elem) {
- $strWhere = '';
- $strLink = '';
- $strAdd = '';
- // Special processing for serviceextinfo
- if (($strDataTable == 'tbl_serviceextinfo') && ($strKey == 'service_description')) {
- $strLink = 'LEFT JOIN `tbl_lnkServiceToHost` on `tbl_service`.`id`=`idMaster` ' .
- 'LEFT JOIN `tbl_host` ON `idSlave`=`tbl_host`.`id`';
- $strWhere = "AND `tbl_host`.`host_name`='".$arrImportData['host_name']['value']."'";
- }
- // Does the value already exist?
- $strSQL = 'SELECT `' .$arrRelData['tableName1']. '`.`id` FROM `' .$arrRelData['tableName1'].
- "` $strLink " . 'WHERE `' .$arrRelData['target1']."` = '".$elem."' $strWhere AND ".
- '`' .$arrRelData['tableName1']."`.`active`='1' AND ".
- '`' .$arrRelData['tableName1']. '`.`config_id`=' .$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId != '') {
+ /* Does the entry already exist? */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName1'] . '` ' .
+ 'WHERE `' . $arrRelData['target1'] . "` = '" . $elem . "' AND `config_id`=" . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId !== '') {
$intSlaveId = (int)$strId;
}
- if ($intSlaveId == 0) {
- // Insert a temporary value
- if (($strDataTable == 'tbl_serviceextinfo') && ($arrRelData['tableName1'] == 'tbl_service')) {
+ if ($intSlaveId === 0) {
+ /* Insert a temporary value in target table */
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['tableName1'] . '` ' .
+ 'SET `' . $arrRelData['target1'] . "` = '" . $elem . "', `config_id`=" . $this->intDomainId . ', ' .
+ "`active`='0', `last_modified`=NOW()";
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
+ $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
+ }
+ $intSlaveId = $this->myDBClass->intLastId;
+ }
+ /* Update data in master table */
+ $arrCommand[0] = $intSlaveId;
+ $strValue = implode('!', $arrCommand);
+ $strSQL = 'UPDATE `' . $strDataTable . '` ' .
+ 'SET `' . $arrRelData['fieldName'] . "`='" . $this->myDBClass->realEscape($strValue) . "' " .
+ 'WHERE `id` = ' . $intDataId;
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
+ $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
+ }
+ }
+ }
+ }
+
+ /**
+ * Inserts a relation type 1 (1:1)
+ * @param string $strKey Data field name
+ * @param string $strValue Data value
+ * @param int $intDataId Data ID
+ * @param string $strDataTable Data table (Master)
+ * @param array $arrRelData Relation data
+ * @param array $arrImportData Import Data
+ */
+ public function writeRelation1(string $strKey, string $strValue, int $intDataId, string $strDataTable, array $arrRelData, array $arrImportData): void
+ {
+ /* Define variables */
+ $intSlaveId = 0;
+ if (strtolower(trim($strValue)) === 'null') {
+ /* Update data in master table */
+ $strSQL = 'UPDATE `' . $strDataTable . '` SET `' . $arrRelData['fieldName'] . '` = -1 WHERE `id` = '
+ . $intDataId;
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
+ $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
+ }
+ } else {
+ /* Decompose data value */
+ $arrValues = explode(',', $strValue);
+ /* Process data values */
+ foreach ($arrValues as $elem) {
+ $strWhere = '';
+ $strLink = '';
+ $strAdd = '';
+ /* Special processing for serviceextinfo */
+ if (($strDataTable === 'tbl_serviceextinfo') && ($strKey === 'service_description')) {
+ $strLink = 'LEFT JOIN `tbl_lnkServiceToHost` on `tbl_service`.`id`=`idMaster` ' .
+ 'LEFT JOIN `tbl_host` ON `idSlave`=`tbl_host`.`id`';
+ $strWhere = "AND `tbl_host`.`host_name`='" . $arrImportData['host_name']['value'] . "'";
+ }
+ /* Does the value already exist? */
+ $strSQL = 'SELECT `' . $arrRelData['tableName1'] . '`.`id` FROM `' . $arrRelData['tableName1'] .
+ "` $strLink " . 'WHERE `' . $arrRelData['target1'] . "` = '" . $elem . "' $strWhere AND " .
+ '`' . $arrRelData['tableName1'] . "`.`active`='1' AND " .
+ '`' . $arrRelData['tableName1'] . '`.`config_id`=' . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId !== '') {
+ $intSlaveId = (int)$strId;
+ }
+ if ($intSlaveId === 0) {
+ /* Insert a temporary value */
+ if (($strDataTable === 'tbl_serviceextinfo') && ($arrRelData['tableName1'] === 'tbl_service')) {
$strAdd = "`config_name`='imp_tmp_by_serviceextinfo',";
}
- $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' .
- 'SET `' .$arrRelData['target1']."` = '".$elem."', ".
- "$strAdd `config_id`=".$this->intDomainId.", `active`='0', ".
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['tableName1'] . '` ' .
+ 'SET `' . $arrRelData['target1'] . "` = '" . $elem . "', " .
+ "$strAdd `config_id`=" . $this->intDomainId . ", `active`='0', " .
'`last_modified`=NOW()';
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
$intSlaveId = $this->myDBClass->intLastId;
- // Special processing for serviceextinfo
- if (($strDataTable == 'tbl_serviceextinfo') && ($strKey == 'service_description')) {
+ /* Special processing for serviceextinfo */
+ if (($strDataTable === 'tbl_serviceextinfo') && ($strKey === 'service_description')) {
$strSQL = 'SELECT `id` FROM `tbl_host` ' .
- "WHERE `host_name`='".$arrImportData['host_name']['value']."'";
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId != '') {
- $strSQL = 'INSERT INTO `tbl_lnkServiceToHost` ' .
- "SET `idMaster` = '".$intSlaveId."', `idSlave` = '".$strId."'";
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ "WHERE `host_name`='" . $arrImportData['host_name']['value'] . "'";
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId !== '') {
+ $strSQL = 'INSERT INTO `tbl_lnkServiceToHost` ' .
+ "SET `idMaster` = '" . $intSlaveId . "', `idSlave` = '" . $strId . "'";
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- $strSQL = "UPDATE `tbl_service` SET `host_name`=0 WHERE `id`='".$intSlaveId."'";
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ $strSQL = "UPDATE `tbl_service` SET `host_name`=0 WHERE `id`='" . $intSlaveId . "'";
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
}
}
- // Update data in master table
- $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = ' .$intSlaveId. ' ' .
- 'WHERE `id` = ' .$intDataId;
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ /* Update data in master table */
+ $strSQL = 'UPDATE `' . $strDataTable . '` SET `' . $arrRelData['fieldName'] . '` = ' . $intSlaveId . ' ' .
+ 'WHERE `id` = ' . $intDataId;
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
@@ -1262,37 +1343,39 @@ class NagImportClass
/**
* Inserts a relation type 2 (1:n)
- * @param string $strKey Data field name
- * @param string $strValue Data value
- * @param int $intDataId Data ID
- * @param string $strDataTable Data table (Master)
- * @param array $arrRelData Relation data
+ * @param string $strKey Data field name
+ * @param string $strValue Data value
+ * @param int $intDataId Data ID
+ * @param string $strDataTable Data table (Master)
+ * @param array $arrRelData Relation data
*/
- public function writeRelation2($strKey, $strValue, $intDataId, $strDataTable, $arrRelData)
+ public function writeRelation2(string $strKey, string $strValue, int $intDataId, string $strDataTable, array $arrRelData): void
{
- // Does a tploption field exist?
- $strSQL = 'SELECT * FROM `' .$strDataTable. '` WHERE `id` = ' .$intDataId;
+ /* Does a tploption field exist? */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM `' . $strDataTable . '` WHERE `id` = ' . $intDataId;
$this->myDBClass->hasSingleDataset($strSQL, $arrDataset);
- $strFieldName = $arrRelData['fieldName']. '_tploptions';
+ $strFieldName = $arrRelData['fieldName'] . '_tploptions';
if (isset($arrDataset[$strFieldName])) {
$intTplOption = 1;
} else {
$intTplOption = 0;
}
- // Delete data from link table
- $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId;
+ /* Delete data from link table */
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $arrRelData['linkTable'] . '` WHERE `idMaster` = ' . $intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- // Define variables
- if (strtolower(trim($strValue)) == 'null') {
- // Update data in master table
- if ($intTplOption == 1) {
- $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = 0, ' .
- '`' .$arrRelData['fieldName']. '_tploptions` = 1 WHERE `id` = ' .$intDataId;
+ /* Define variables */
+ if (strtolower(trim($strValue)) === 'null') {
+ /* Update data in master table */
+ if ($intTplOption === 1) {
+ $strSQL = 'UPDATE `' . $strDataTable . '` SET `' . $arrRelData['fieldName'] . '` = 0, ' .
+ '`' . $arrRelData['fieldName'] . '_tploptions` = 1 WHERE `id` = ' . $intDataId;
} else {
- $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = 0 WHERE `id` = ' .
+ $strSQL = 'UPDATE `' . $strDataTable . '` SET `' . $arrRelData['fieldName'] . '` = 0 WHERE `id` = ' .
$intDataId;
}
$this->myDBClass->insertData($strSQL);
@@ -1303,101 +1386,103 @@ class NagImportClass
} else {
$intOption = 2;
}
- // Decompose data value
+ /* Decompose data value */
$arrValues = explode(',', $strValue);
- // Process data values
+ if (substr_count($strValue, '*') !== 0) {
+ $intRelValue = 2;
+ } else {
+ $intRelValue = 1;
+ }
+ /* Process data values */
foreach ($arrValues as $elem) {
- if ($elem != '*') {
+ if ($elem !== '*') {
$strWhere = '';
- $strLink = '';
- // Exclude values
+ $strLink = '';
+ /* Exclude values */
if (0 === strpos($elem, '!')) {
$intExclude = 1;
$elem = substr($elem, 1);
} else {
$intExclude = 0;
}
- if ((($strDataTable == 'tbl_servicedependency') || ($strDataTable == 'tbl_serviceescalation')) &&
- (substr_count($strKey, 'service') != 0) && (substr_count($strKey, 'group') == 0)) {
- if (substr_count($strKey, 'depend') != 0) {
- $strLink = 'LEFT JOIN `tbl_lnkServiceToHost` on `id`=`idMaster`';
- $strWhere = 'AND `idSlave` IN (' .substr($this->strList1, 0, -1). ')';
+ if ((($strDataTable === 'tbl_servicedependency') || ($strDataTable === 'tbl_serviceescalation')) &&
+ (substr_count($strKey, 'service') !== 0) && (substr_count($strKey, 'group') === 0)) {
+ $strLink = 'LEFT JOIN `tbl_lnkServiceToHost` on `id`=`idMaster`';
+ if (substr_count($strKey, 'depend') !== 0) {
+ $strWhere = 'AND `idSlave` IN (' . substr($this->strList1, 0, -1) . ')';
} else {
- $strLink = 'LEFT JOIN `tbl_lnkServiceToHost` on `id`=`idMaster`';
- $strWhere = 'AND `idSlave` IN (' .substr($this->strList2, 0, -1). ')';
+ $strWhere = 'AND `idSlave` IN (' . substr($this->strList2, 0, -1) . ')';
}
}
- // Does the entry already exist?
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']."` $strLink ".
- 'WHERE `' .$arrRelData['target1']."` = '".$elem."' $strWhere AND ".
- '`config_id`=' .$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId != '') {
+ /* Does the entry already exist? */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName1'] . "` $strLink " .
+ 'WHERE `' . $arrRelData['target1'] . "` = '" . $elem . "' $strWhere AND " .
+ '`config_id`=' . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId !== '') {
$intSlaveId = (int)$strId;
} else {
$intSlaveId = 0;
}
- if (($intSlaveId == 0) && ($elem != '*')) {
- // Insert a temporary value to the target table
- $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' .
- 'SET `' .$arrRelData['target1']."`='".$elem."', ".
- '`config_id`=' .$this->intDomainId.", `active`='0', `last_modified`=NOW()";
+ if (($intSlaveId === 0) && ($elem !== '*')) {
+ /* Insert a temporary value to the target table */
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['tableName1'] . '` ' .
+ 'SET `' . $arrRelData['target1'] . "`='" . $elem . "', " .
+ '`config_id`=' . $this->intDomainId . ", `active`='0', `last_modified`=NOW()";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
$intSlaveId = $this->myDBClass->intLastId;
}
- // Insert relations
- $strSQL = 'INSERT INTO `' .$arrRelData['linkTable']. '` ' .
- 'SET `idMaster` = ' .$intDataId. ', `idSlave` = ' .$intSlaveId. ', `exclude`=' .$intExclude;
+ /* Insert relations */
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['linkTable'] . '` ' .
+ 'SET `idMaster` = ' . $intDataId . ', `idSlave` = ' . $intSlaveId . ', `exclude`=' . $intExclude;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- // Keep values
- if (($strDataTable == 'tbl_servicedependency') || ($strDataTable == 'tbl_serviceescalation')) {
+ /* Keep values */
+ if (($strDataTable === 'tbl_servicedependency') || ($strDataTable === 'tbl_serviceescalation')) {
$strTemp = '';
- if (($strKey == 'dependent_host_name') || ($strKey == 'host_name')) {
- $strTemp .= $intSlaveId. ',';
- } elseif (($strKey == 'dependent_hostgroup_name') || ($strKey == 'hostgroup_name')) {
+ if (($strKey === 'dependent_host_name') || ($strKey === 'host_name')) {
+ $strTemp .= $intSlaveId . ',';
+ } elseif (($strKey === 'dependent_hostgroup_name') || ($strKey === 'hostgroup_name')) {
$arrDataHostgroups = array();
- $intDCHostgroups = 0;
+ $intDCHostgroups = 0;
$strSQL = 'SELECT DISTINCT `id` FROM `tbl_host` ' .
'LEFT JOIN `tbl_lnkHostToHostgroup` ON `id`=`tbl_lnkHostToHostgroup`.`idMaster` ' .
'LEFT JOIN `tbl_lnkHostgroupToHost` ON `id`=`tbl_lnkHostgroupToHost`.`idSlave` ' .
- "WHERE (`tbl_lnkHostgroupToHost`.`idMaster` = $intSlaveId ".
- "OR `tbl_lnkHostToHostgroup`.`idSlave` = $intSlaveId) ".
- "AND `active`='1' AND `config_id`=".$this->intDomainId;
+ "WHERE (`tbl_lnkHostgroupToHost`.`idMaster` = $intSlaveId " .
+ "OR `tbl_lnkHostToHostgroup`.`idSlave` = $intSlaveId) " .
+ "AND `active`='1' AND `config_id`=" . $this->intDomainId;
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataHostgroups, $intDCHostgroups);
- if ($booReturn && ($intDCHostgroups != 0)) {
+ if ($booReturn && ($intDCHostgroups !== 0)) {
foreach ($arrDataHostgroups as $elem2) {
- $strTemp .= $elem2['id']. ',';
+ $strTemp .= $elem2['id'] . ',';
}
}
}
- if (substr_count($strKey, 'dependent') != 0) {
+ if (substr_count($strKey, 'dependent') !== 0) {
$this->strList1 .= $strTemp;
} else {
$this->strList2 .= $strTemp;
}
}
}
- // Update field values in master table
- if (substr_count($strValue, '*') != 0) {
- $intRelValue = 2;
+ /* Update field values in master table */
+ if ($intTplOption === 1) {
+ $strSQL = 'UPDATE `' . $strDataTable . '` SET `' . $arrRelData['fieldName'] . "`=$intRelValue, " .
+ '`' . $arrRelData['fieldName'] . '_tploptions` = ' . $intOption . ' WHERE `id` = ' . $intDataId;
} else {
- $intRelValue = 1;
+ $strSQL = 'UPDATE `' . $strDataTable . '` SET `' . $arrRelData['fieldName'] . "`=$intRelValue " .
+ 'WHERE `id` = ' . $intDataId;
}
- if ($intTplOption == 1) {
- $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']."`=$intRelValue, ".
- '`' .$arrRelData['fieldName']. '_tploptions` = ' .$intOption. ' WHERE `id` = ' .$intDataId;
- } else {
- $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']."`=$intRelValue ".
- 'WHERE `id` = ' .$intDataId;
- }
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
@@ -1406,21 +1491,21 @@ class NagImportClass
/**
* Inserts a relation type 3 (templates)
- * @param string $strValue Data value
- * @param int $intDataId Data ID
- * @param string $strDataTable Data table (Master)
- * @param array $arrRelData Relation data
+ * @param string $strValue Data value
+ * @param int $intDataId Data ID
+ * @param string $strDataTable Data table (Master)
+ * @param array $arrRelData Relation data
*/
- public function writeRelation3($strValue, $intDataId, $strDataTable, $arrRelData)
+ public function writeRelation3(string $strValue, int $intDataId, string $strDataTable, array $arrRelData): void
{
- // Define variables
+ /* Define variables */
$intSlaveId = 0;
- $intTable = 0;
- $intSortNr = 1;
- if (strtolower(trim($strValue)) == 'null') {
- // Update data in master table
- $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = 0, ' .
- '`' .$arrRelData['fieldName']. '_tploptions` = 1 WHERE `id` = ' .$intDataId;
+ $intTable = 0;
+ $intSortNr = 1;
+ if (strtolower(trim($strValue)) === 'null') {
+ /* Update data in master table */
+ $strSQL = 'UPDATE `' . $strDataTable . '` SET `' . $arrRelData['fieldName'] . '` = 0, ' .
+ '`' . $arrRelData['fieldName'] . '_tploptions` = 1 WHERE `id` = ' . $intDataId;
$this->myDBClass->insertData($strSQL);
} else {
if (0 === strpos(trim($strValue), '+')) {
@@ -1429,61 +1514,66 @@ class NagImportClass
} else {
$intOption = 2;
}
- // Remove old relations
- $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId;
+ /* Remove old relations */
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $arrRelData['linkTable'] . '` WHERE `idMaster` = ' . $intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- // Decompose data value
+ /* Decompose data value */
$arrValues = explode(',', $strValue);
- // Process data values
+ /* Process data values */
foreach ($arrValues as $elem) {
- // Does the template already exist? (table 1)
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']. '` ' .
- 'WHERE `' .$arrRelData['target1']."` = '".$elem."' AND `config_id`=".$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId != '') {
+ /* Does the template already exist? (table 1) */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName1'] . '` ' .
+ 'WHERE `' . $arrRelData['target1'] . "` = '" . $elem . "' AND `config_id`=" . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId !== '') {
$intSlaveId = (int)$strId;
$intTable = 1;
}
- if ($intSlaveId == 0) {
- // Does the template already exist? (table 2)
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' .
- 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND `config_id`=".$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId != '') {
+ if ($intSlaveId === 0) {
+ /* Does the template already exist? (table 2) */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName2'] . '` ' .
+ 'WHERE `' . $arrRelData['target2'] . "` = '" . $elem . "' AND `config_id`=" . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId !== '') {
$intSlaveId = (int)$strId;
- $intTable = 2;
+ $intTable = 2;
}
}
- if ($intSlaveId == 0) {
- // Insert a temporary value to the target table
- $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' .
- 'SET `' .$arrRelData['target1']."` = '".$elem."', `config_id`=".$this->intDomainId. ', ' .
+ if ($intSlaveId === 0) {
+ /* Insert a temporary value to the target table */
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['tableName1'] . '` ' .
+ 'SET `' . $arrRelData['target1'] . "` = '" . $elem . "', `config_id`=" . $this->intDomainId . ', ' .
"`active`='0', `last_modified`=NOW()";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
$intSlaveId = $this->myDBClass->intLastId;
- $intTable = 1;
+ $intTable = 1;
}
- // Insert relations
- $strSQL = 'INSERT INTO `' .$arrRelData['linkTable']. '` ' .
- 'SET `idMaster` = ' .$intDataId. ', `idSlave`=' .$intSlaveId. ', `idSort`=' .$intSortNr. ', ' .
- '`idTable` = ' .$intTable;
+ /* Insert relations */
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['linkTable'] . '` ' .
+ 'SET `idMaster` = ' . $intDataId . ', `idSlave`=' . $intSlaveId . ', `idSort`=' . $intSortNr . ', ' .
+ '`idTable` = ' . $intTable;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
$intSortNr++;
$intSlaveId = 0;
- // Update field data in master table
- $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = 1, ' .
- '`' .$arrRelData['fieldName']. '_tploptions` = ' .$intOption. ' WHERE `id` = ' .$intDataId;
+ /* Update field data in master table */
+ $strSQL = 'UPDATE `' . $strDataTable . '` SET `' . $arrRelData['fieldName'] . '` = 1, ' .
+ '`' . $arrRelData['fieldName'] . '_tploptions` = ' . $intOption . ' WHERE `id` = ' . $intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
@@ -1492,275 +1582,231 @@ class NagImportClass
/**
* Inserts a relation type 4 (free variables)
- * @param string $strKey Data field name
- * @param string $strValue Data value
- * @param int $intDataId Data ID
- * @param string $strDataTable Data table (Master)
- * @param array $arrRelData Relation data
- * @return int 0 = successful / 1 = error
+ * @param string $strKey Data field name
+ * @param string $strValue Data value
+ * @param int $intDataId Data ID
+ * @param int $intRemoveData 0 = do not remove data / 1 = do remove data
+ * @param string $strDataTable Data table (Master)
+ * @param array $arrRelData Relation data
+ * @return int 0 = successful / 1 = error
*/
- public function writeRelation4($strKey, $strValue, $intDataId, $strDataTable, $arrRelData)
+ public function writeRelation4(string $strKey, string $strValue, int $intDataId, int $intRemoveData, string $strDataTable, array $arrRelData): int
{
- // Define variables
+ /* Define variables */
$intReturn = 0;
- // Remove empty variables
- if (($strKey == '') || ($strValue == '')) {
+ /* Remove empty variables */
+ if (($strKey === '') || ($strValue === '')) {
$intReturn = 1;
}
- // Remove NagiosQL variables
- if ($strKey == '_NAGIOSQL_CONFIG_NAME') {
+ /* Remove NagiosQL variables */
+ if ($strKey === '_NAGIOSQL_CONFIG_NAME') {
$intReturn = 1;
}
- if ($intReturn == 0) {
- // Remove old variables
- $strSQL = 'SELECT * FROM '.$arrRelData['linkTable'].' WHERE idMaster='.$intDataId;
+ /* Remove old variables */
+ if ($intRemoveData === 1) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT * FROM ' . $arrRelData['linkTable'] . ' WHERE idMaster=' . $intDataId;
$booResult = $this->myDBClass->hasDataArray($strSQL, $arrLinkData, $intLinkCount);
- if ($booResult && ($intLinkCount != 0)) {
+ if ($booResult && ($intLinkCount !== 0)) {
/** @var array $arrLinkData */
foreach ($arrLinkData as $elem) {
- $strSQL1 = 'DELETE FROM tbl_variabledefinition WHERE id=' .$elem['idSlave'];
+ $strSQL1 = 'DELETE FROM tbl_variabledefinition WHERE id=' . $elem['idSlave'];
$booResult = $this->myDBClass->insertData($strSQL1);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- $strSQL2 = 'DELETE FROM '.$arrRelData['linkTable'].' WHERE idMaster='.$elem['idMaster'];
+ /** @noinspection SqlResolve */
+ $strSQL2 = 'DELETE FROM ' . $arrRelData['linkTable'] . ' WHERE idMaster=' . $elem['idMaster'];
$booResult = $this->myDBClass->insertData($strSQL2);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
}
- // Insert values to the table
+ }
+ /* Insert free Variables */
+ if ($intReturn === 0) {
+ /* Insert values to the table */
$strSQL = "INSERT INTO `tbl_variabledefinition` SET `name` = '" . addslashes($strKey) . "', " .
"`value` = '" . addslashes($strValue) . "', `last_modified`=now()";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
$intSlaveId = $this->myDBClass->intLastId;
- // Insert relations to the table
+ /* Insert relations to the table */
+ /** @noinspection SqlResolve */
$strSQL = 'INSERT INTO `' . $arrRelData['linkTable'] . '` ' .
'SET `idMaster` = ' . $intDataId . ', `idSlave` = ' . $intSlaveId;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- // Update data in master table
+ /* Update data in master table */
$strSQL = 'UPDATE `' . $strDataTable . '` SET `use_variables` = 1 WHERE `id` = ' . $intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
return $intReturn;
}
- /**
- * Inserts a relation type 5 (1:1 check command)
- * @param string $strValue Data value
- * @param int $intDataId Data ID
- * @param string $strDataTable Data table (Master)
- * @param array $arrRelData Relation data
- */
- public function writeRelation5($strValue, $intDataId, $strDataTable, $arrRelData)
- {
- // Extract data values
- $arrCommand = explode('!', $strValue);
- $strValue = $arrCommand[0];
- // Define variables
- $intSlaveId = 0;
- if (strtolower(trim($strValue)) == 'null') {
- // Update data in master table
- $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = -1 WHERE `id` = ' .
- $intDataId;
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
- $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
- }
- } else {
- // Decompose data values
- $arrValues = explode(',', $strValue);
- // Process data values
- foreach ($arrValues as $elem) {
- // Does the entry already exist?
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']. '` ' .
- 'WHERE `' .$arrRelData['target1']."` = '".$elem."' AND `config_id`=".$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId != '') {
- $intSlaveId = (int)$strId;
- }
- if ($intSlaveId == 0) {
- // Insert a temporary value in target table
- $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' .
- 'SET `' .$arrRelData['target1']."` = '".$elem."', `config_id`=".$this->intDomainId. ', ' .
- "`active`='0', `last_modified`=NOW()";
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
- $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
- }
- $intSlaveId = $this->myDBClass->intLastId;
- }
- // Update data in master table
- $arrCommand[0] = $intSlaveId;
- $strValue = implode('!', $arrCommand);
- $strSQL = 'UPDATE `' .$strDataTable. '` ' .
- 'SET `' .$arrRelData['fieldName']."`='".$this->myDBClass->realEscape($strValue)."' ".
- 'WHERE `id` = ' .$intDataId;
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
- $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
- }
- }
- }
- }
-
- ///////////////////////////////////////////////////////////////////////////////////////////
/**
* Inserts a relation type 5 (1:n:n service groups)
- * @param string $strValue Data value
- * @param int $intDataId Data ID
- * @param string $strDataTable Data table (Master)
- * @param array $arrRelData Relation data
+ * @param string $strValue Data value
+ * @param int $intDataId Data ID
+ * @param string $strDataTable Data table (Master)
+ * @param array $arrRelData Relation data
*/
- public function writeRelation6($strValue, $intDataId, $strDataTable, $arrRelData)
+ public function writeRelation6(string $strValue, int $intDataId, string $strDataTable, array $arrRelData): void
{
- // Define variables
- $intSlaveIdH = 0;
+ /* Define variables */
+ $intSlaveIdH = 0;
$intSlaveIdHG = 0;
- // Decompose data value
- $arrValues = explode(',', $strValue);
- // Remove data from link table
- $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId;
+ /* Decompose data value */
+ $arrValues = explode(',', $strValue);
+ /* Remove data from link table */
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $arrRelData['linkTable'] . '` WHERE `idMaster` = ' . $intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- // Check the sum of elements
- if (\count($arrValues) % 2 != 0) {
+ /* Check the sum of elements */
+ if (count($arrValues) % 2 !== 0) {
$this->strErrorMessage .= translate('Error: incorrect number of arguments - cannot import service group ' .
- 'members'). '::';
+ 'members') . '::';
} else {
- // Process data values
+ /* Process data values */
$intCounter = 1;
foreach ($arrValues as $elem) {
- if ($intCounter % 2 == 0) {
- // Does the host entry already exist?
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']. '` ' .
- 'WHERE `' .$arrRelData['target1']."` = '".$strValue."' AND `active`='1' ".
- 'AND `config_id`=' .$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId != '') {
+ if ($intCounter % 2 === 0) {
+ /* Does the host entry already exist? */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName1'] . '` ' .
+ 'WHERE `' . $arrRelData['target1'] . "` = '" . $strValue . "' AND `active`='1' " .
+ 'AND `config_id`=' . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId !== '') {
$intSlaveIdH = (int)$strId;
}
- // Does a hostgroup entry already exist?
- if ($intSlaveIdH == 0) {
- $strSQL = "SELECT `id` FROM `tbl_hostgroup` WHERE `hostgroup_name` = '".$strValue."' ".
- "AND `active`='1' AND `config_id`=".$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId != '') {
+ /* Does a hostgroup entry already exist? */
+ if ($intSlaveIdH === 0) {
+ $strSQL = "SELECT `id` FROM `tbl_hostgroup` WHERE `hostgroup_name` = '" . $strValue . "' " .
+ "AND `active`='1' AND `config_id`=" . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId !== '') {
$intSlaveIdHG = (int)$strId;
}
}
- if (($intSlaveIdH == 0) && ($intSlaveIdHG == 0)) {
- // Insert a temporary value in table
- $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' .
- 'SET `' .$arrRelData['target1']."` = '".$strValue."', ".
- '`config_id`=' .$this->intDomainId.", `active`='0', `last_modified`=NOW()";
+ if (($intSlaveIdH === 0) && ($intSlaveIdHG === 0)) {
+ /* Insert a temporary value in table */
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['tableName1'] . '` ' .
+ 'SET `' . $arrRelData['target1'] . "` = '" . $strValue . "', " .
+ '`config_id`=' . $this->intDomainId . ", `active`='0', `last_modified`=NOW()";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- $intSlaveIdH = $this->myDBClass->intLastId;
+ $intSlaveIdH = $this->myDBClass->intLastId;
}
- // Does the service entry already exist?
- if ($intSlaveIdH != 0) {
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' .
+ /* Does the service entry already exist? */
+ if ($intSlaveIdH !== 0) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName2'] . '` ' .
'LEFT JOIN `tbl_lnkServiceToHost` ON `id` = `idMaster` ' .
- 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND `idSlave` = ".$intSlaveIdH. ' ' .
- 'AND `config_id`=' .$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId == '') {
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' .
+ 'WHERE `' . $arrRelData['target2'] . "` = '" . $elem . "' AND `idSlave` = " . $intSlaveIdH . ' ' .
+ 'AND `config_id`=' . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId === '') {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName2'] . '` ' .
'LEFT JOIN `tbl_lnkServiceToHostgroup` ON ' .
'`id`=`tbl_lnkServiceToHostgroup`.`idMaster` ' .
'LEFT JOIN `tbl_lnkHostgroupToHost` ON ' .
'`tbl_lnkHostgroupToHost`.`idMaster`=`tbl_lnkServiceToHostgroup`.`idSlave` ' .
- 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND ".
- '`tbl_lnkHostgroupToHost`.`idSlave` = ' .$intSlaveIdH. ' AND ' .
- "`active`='1' AND `config_id`=".$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
+ 'WHERE `' . $arrRelData['target2'] . "` = '" . $elem . "' AND " .
+ '`tbl_lnkHostgroupToHost`.`idSlave` = ' . $intSlaveIdH . ' AND ' .
+ "`active`='1' AND `config_id`=" . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
}
- if ($strId == '') {
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' .
+ if ($strId === '') {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName2'] . '` ' .
'LEFT JOIN `tbl_lnkServiceToHostgroup` ON ' .
'`id` = `tbl_lnkServiceToHostgroup`.`idMaster` ' .
'LEFT JOIN `tbl_lnkHostToHostgroup` ON ' .
'`tbl_lnkHostToHostgroup`.`idSlave`=`tbl_lnkServiceToHostgroup`.`idSlave` ' .
- 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND ".
- '`tbl_lnkHostToHostgroup`.`idMaster` = ' .$intSlaveIdH. ' AND ' .
- "`active`='1' AND `config_id`=".$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
+ 'WHERE `' . $arrRelData['target2'] . "` = '" . $elem . "' AND " .
+ '`tbl_lnkHostToHostgroup`.`idMaster` = ' . $intSlaveIdH . ' AND ' .
+ "`active`='1' AND `config_id`=" . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
}
- } elseif ($intSlaveIdHG != 0) {
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' .
+ } elseif ($intSlaveIdHG !== 0) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName2'] . '` ' .
'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `id` = `idMaster` ' .
- 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND `idSlave`=".$intSlaveIdHG. ' ' .
- "AND `active`='1' AND `config_id`=".$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
+ 'WHERE `' . $arrRelData['target2'] . "` = '" . $elem . "' AND `idSlave`=" . $intSlaveIdHG . ' ' .
+ "AND `active`='1' AND `config_id`=" . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
}
- if ($strId != '') {
+ if ($strId !== '') {
$intSlaveIdS = (int)$strId;
} else {
$intSlaveIdS = 0;
}
- if ($intSlaveIdS == 0) {
- // Insert a temporary value in table
- $intHostName = 0;
+ if ($intSlaveIdS === 0) {
+ /* Insert a temporary value in table */
+ $intHostName = 0;
$intHostgroupName = 0;
- if ($intSlaveIdH != 0) {
- $intHostName = 1;
- } elseif ($intSlaveIdHG != 0) {
- $intHostgroupName = 1;
+ if ($intSlaveIdH !== 0) {
+ $intHostName = 1;
+ } elseif ($intSlaveIdHG !== 0) {
+ $intHostgroupName = 1;
}
- $strSQL = 'INSERT INTO `' .$arrRelData['tableName2']. '` ' .
- "SET `config_name`='imp_tmp_by_servicegroup', `host_name`=$intHostName, ".
- "`hostgroup_name`=$intHostgroupName, `".$arrRelData['target2']."` = '".$elem."', ".
- '`config_id`=' .$this->intDomainId.", `active`='0', `last_modified`=NOW()";
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['tableName2'] . '` ' .
+ "SET `config_name`='imp_tmp_by_servicegroup', `host_name`=$intHostName, " .
+ "`hostgroup_name`=$intHostgroupName, `" . $arrRelData['target2'] . "` = '" . $elem . "', " .
+ '`config_id`=' . $this->intDomainId . ", `active`='0', `last_modified`=NOW()";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
$intSlaveIdS = $this->myDBClass->intLastId;
- // Make a relation from temp service to host / hostgroup
- if ($intSlaveIdH != 0) {
- $strSQL = 'INSERT INTO `tbl_lnkServiceToHost` ' .
- "SET `idMaster`='".$intSlaveIdS."', `idSlave`=".$intSlaveIdH.", `exclude`='0'";
+ /* Make a relation from temp service to host / hostgroup */
+ if ($intSlaveIdH !== 0) {
+ $strSQL = 'INSERT INTO `tbl_lnkServiceToHost` ' .
+ "SET `idMaster`='" . $intSlaveIdS . "', `idSlave`=" . $intSlaveIdH . ", `exclude`='0'";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- } elseif ($intSlaveIdHG != 0) {
- $strSQL = 'INSERT INTO `tbl_lnkServiceToHostgroup` ' .
- "SET `idMaster`='".$intSlaveIdS."', `idSlave`=".$intSlaveIdHG. ', ' .
+ } elseif ($intSlaveIdHG !== 0) {
+ $strSQL = 'INSERT INTO `tbl_lnkServiceToHostgroup` ' .
+ "SET `idMaster`='" . $intSlaveIdS . "', `idSlave`=" . $intSlaveIdHG . ', ' .
"`exclude`='0'";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
}
- // Insert relation
- $strSQL = 'INSERT INTO `' .$arrRelData['linkTable']. '` ' .
- 'SET `idMaster`=' .$intDataId. ', `idSlaveH`=' .$intSlaveIdH. ', `idSlaveS`=' .$intSlaveIdS;
+ /* Insert relation */
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['linkTable'] . '` ' .
+ 'SET `idMaster`=' . $intDataId . ', `idSlaveH`=' . $intSlaveIdH . ', `idSlaveS`=' . $intSlaveIdS;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- // Update data in master table
- $strSQL = 'UPDATE `' .$strDataTable. '` ' .
- 'SET `' .$arrRelData['fieldName']. '` = 1 WHERE `id` = ' .$intDataId;
+ /* Update data in master table */
+ $strSQL = 'UPDATE `' . $strDataTable . '` ' .
+ 'SET `' . $arrRelData['fieldName'] . '` = 1 WHERE `id` = ' . $intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
} else {
@@ -1772,109 +1818,113 @@ class NagImportClass
}
/**
- * Inserts a relation type 6 (1:n:str)
- * @param string $strValue Data value
- * @param int $intDataId Data ID
- * @param string $strDataTable Data table (Master)
- * @param array $arrRelData Relation data
+ * Inserts a relation type 7 (1:n:str)
+ * @param string $strValue Data value
+ * @param int $intDataId Data ID
+ * @param string $strDataTable Data table (Master)
+ * @param array $arrRelData Relation data
*/
- public function writeRelation7($strValue, $intDataId, $strDataTable, $arrRelData)
+ public function writeRelation7(string $strValue, int $intDataId, string $strDataTable, array $arrRelData): void
{
- // Delete data from link table
- $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId;
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ /* Delete data from link table */
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $arrRelData['linkTable'] . '` WHERE `idMaster` = ' . $intDataId;
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- // Decompose data value
+ /* Decompose data value */
$arrValues = explode(',', $strValue);
- // Process data values
+ if (substr_count($strValue, '*') !== 0) {
+ $intRelValue = 2;
+ } else {
+ $intRelValue = 1;
+ }
+ /* Process data values */
foreach ($arrValues as $elem) {
- if ($elem != '*') {
+ if ($elem !== '*') {
$strWhere = '';
- // Exclude values
+ /* Exclude values */
if (0 === strpos($elem, '!')) {
$intExclude = 1;
$elem = substr($elem, 1);
} else {
$intExclude = 0;
}
- // Does the entry already exist?
- $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']. '` ' .
- 'WHERE `' .$arrRelData['target1']."`='".$elem."' $strWhere ".
- 'AND `config_id`=' .$this->intDomainId;
- $strId = $this->myDBClass->getFieldData($strSQL);
- if ($strId != '') {
+ /* Does the entry already exist? */
+ /** @noinspection SqlResolve */
+ $strSQL = 'SELECT `id` FROM `' . $arrRelData['tableName1'] . '` ' .
+ 'WHERE `' . $arrRelData['target1'] . "`='" . $elem . "' $strWhere " .
+ 'AND `config_id`=' . $this->intDomainId;
+ $strId = $this->myDBClass->getFieldData($strSQL);
+ if ($strId !== '') {
$intSlaveId = (int)$strId;
} else {
$intSlaveId = 0;
}
- if (($intSlaveId == 0) && ($elem != '*')) {
- // Insert a temporary value to the target table
- $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' .
- 'SET `' .$arrRelData['target1']."` = '".$elem."', `host_name`=2, `hostgroup_name`=2, ".
- "`config_name`='imp_tmp_by_servicedependency', `config_id`=".$this->intDomainId. ', ' .
+ if (($intSlaveId === 0) && ($elem !== '*')) {
+ /* Insert a temporary value to the target table */
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['tableName1'] . '` ' .
+ 'SET `' . $arrRelData['target1'] . "` = '" . $elem . "', `host_name`=2, `hostgroup_name`=2, " .
+ "`config_name`='imp_tmp_by_servicedependency', `config_id`=" . $this->intDomainId . ', ' .
"`active`='0', `last_modified`=NOW()";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
$intSlaveId = $this->myDBClass->intLastId;
}
- // Insert relations
- $strSQL = 'INSERT INTO `' .$arrRelData['linkTable']. '` ' .
- 'SET `idMaster` = ' .$intDataId. ', `idSlave` = ' .$intSlaveId.", `strSlave`='".$elem."', ".
- '`exclude`=' .$intExclude;
+ /* Insert relations */
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO `' . $arrRelData['linkTable'] . '` ' .
+ 'SET `idMaster` = ' . $intDataId . ', `idSlave` = ' . $intSlaveId . ", `strSlave`='" . $elem . "', " .
+ '`exclude`=' . $intExclude;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
- // Update field values in master table
- if (substr_count($strValue, '*') != 0) {
- $intRelValue = 2;
- } else {
- $intRelValue = 1;
- }
- $strSQL = 'UPDATE `' .$strDataTable. '` ' .
- 'SET `' .$arrRelData['fieldName']."` = $intRelValue WHERE `id` = ".$intDataId;
+ /* Update field values in master table */
+ $strSQL = 'UPDATE `' . $strDataTable . '` ' .
+ 'SET `' . $arrRelData['fieldName'] . "` = $intRelValue WHERE `id` = " . $intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
}
}
/**
- * Inserts a relation type 6 (service and servicetemplate parents - 1:service:host)
- * @param string $strValue Data value
- * @param int $intDataId Data ID
- * @param string $strDataTable Data table (Master)
- * @param array $arrRelData Relation data
+ * Inserts a relation type 8 (service and servicetemplate parents - 1:service:host)
+ * @param string $strValue Data value
+ * @param int $intDataId Data ID
+ * @param string $strDataTable Data table (Master)
+ * @param array $arrRelData Relation data
*/
- public function writeRelation8($strValue, $intDataId, $strDataTable, $arrRelData)
+ public function writeRelation8(string $strValue, int $intDataId, string $strDataTable, array $arrRelData): void
{
- // Decompose data value
+ /* Decompose data value */
$arrValues = explode(',', $strValue);
- // Delete data from link table
- $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId;
- $booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ /* Delete data from link table */
+ /** @noinspection SqlResolve */
+ $strSQL = 'DELETE FROM `' . $arrRelData['linkTable'] . '` WHERE `idMaster` = ' . $intDataId;
+ $booResult = $this->myDBClass->insertData($strSQL);
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- // Check the sum of elements
- /** @noinspection ExplodeMissUseInspection */
- if (count($arrValues) % 2 != 0) {
+ /* Check the sum of elements */
+ if (count($arrValues) % 2 !== 0) {
$this->strErrorMessage .= translate('Error: incorrect number of arguments - cannot import service parent ' .
- 'members'). '::';
+ 'members') . '::';
} else {
- // Process data values
- $intCounter = 1;
+ /* Process data values */
+ $intCounter = 1;
$strHostName = '';
foreach ($arrValues as $elem) {
- if ($intCounter % 2 == 0) {
+ if ($intCounter % 2 === 0) {
$strServiceName = $elem;
- if (($strServiceName != '') && ($strHostName != '')) {
+ if (($strServiceName !== '') && ($strHostName !== '')) {
$strSQL = 'SELECT tbl_service.id AS id_1, C.id AS id_2, D.id AS id_3, E.id AS id_4 '
. 'FROM tbl_service '
. 'LEFT JOIN tbl_lnkServiceToHost ON tbl_service.id=tbl_lnkServiceToHost.idMaster '
@@ -1885,44 +1935,45 @@ class NagImportClass
. 'LEFT JOIN tbl_host AS C ON A.idSlave=C.id '
. 'LEFT JOIN tbl_host AS D ON B.idMaster=D.id '
. 'LEFT JOIN tbl_host AS E ON tbl_lnkServiceToHost.idSlave=E.id '
- . "WHERE tbl_service.service_description='".$strServiceName."' "
- . "AND (C.host_name='".$strHostName."' OR D.host_name='".$strHostName."' "
- . "OR E.host_name='".$strHostName."')";
+ . "WHERE tbl_service.service_description='" . $strServiceName . "' "
+ . "AND (C.host_name='" . $strHostName . "' OR D.host_name='" . $strHostName . "' "
+ . "OR E.host_name='" . $strHostName . "')";
$booResult = $this->myDBClass->hasDataArray($strSQL, $arrDataset, $intCount);
- if ($booResult && ($intCount == 1)) {
+ if ($booResult && ($intCount === 1)) {
$intServiceId = 0;
- $intHostId = 0;
- $intId1 = $arrDataset[0]['id_1'];
- $intId2 = $arrDataset[0]['id_2'];
- $intId3 = $arrDataset[0]['id_3'];
- $intId4 = $arrDataset[0]['id_4'];
- if (($intId1!= null) && ($intId1 != 0) && ($intServiceId == 0)) {
+ $intHostId = 0;
+ $intId1 = $arrDataset[0]['id_1'];
+ $intId2 = $arrDataset[0]['id_2'];
+ $intId3 = $arrDataset[0]['id_3'];
+ $intId4 = $arrDataset[0]['id_4'];
+ if (($intId1 !== null) && ($intId1 !== 0) && ($intServiceId === 0)) {
$intServiceId = (int)$intId1;
}
$intHostSum = 0;
- if (($intId2 != null) && ($intId2 != 0) && ($intHostId == 0)) {
- $intHostId = (int)$intId2;
+ if (($intId2 !== null) && ($intId2 !== 0) && ($intHostId === 0)) {
+ $intHostId = (int)$intId2;
$intHostSum += $intHostId;
}
- if (($intId3 != null) && ($intId3 != 0) && ($intHostId == 0)) {
- $intHostId = (int)$intId3;
+ if (($intId3 !== null) && ($intId3 !== 0) && ($intHostId === 0)) {
+ $intHostId = (int)$intId3;
$intHostSum += $intHostId;
}
- if (($intId4 != null) && ($intId4 != 0) && ($intHostId == 0)) {
- $intHostId = (int)$intId4;
+ if (($intId4 !== null) && ($intId4 !== 0) && ($intHostId === 0)) {
+ $intHostId = (int)$intId4;
$intHostSum += $intHostId;
}
- if (($intHostId == $intHostSum) && ($intServiceId != 0) && ($intHostId != 0)) {
- $strSQL = 'INSERT INTO ' .$arrRelData['linkTable']. ' '
+ if (($intHostId === $intHostSum) && ($intServiceId !== 0) && ($intHostId !== 0)) {
+ /** @noinspection SqlResolve */
+ $strSQL = 'INSERT INTO ' . $arrRelData['linkTable'] . ' '
. "SET idMaster=$intDataId, idSlave=$intServiceId, idHost=$intHostId";
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
- $strSQL = 'UPDATE `' .$strDataTable. '` ' .
- 'SET `' .$arrRelData['fieldName']. '` = 1 WHERE `id` = ' .$intDataId;
+ $strSQL = 'UPDATE `' . $strDataTable . '` ' .
+ 'SET `' . $arrRelData['fieldName'] . '` = 1 WHERE `id` = ' . $intDataId;
$booResult = $this->myDBClass->insertData($strSQL);
- if ($booResult == false) {
+ if ($booResult === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
}
} else {
@@ -1932,8 +1983,8 @@ class NagImportClass
}
} else {
$this->strErrorMessage .= translate('Error: cannot import the service parent member ')
- . $strServiceName. '-' .$strHostName. '. '
- . translate('This combination is not unique or does not exist!').'::';
+ . $strServiceName . '-' . $strHostName . '. '
+ . translate('This combination is not unique or does not exist!') . '::';
}
}
} else {
@@ -1943,4 +1994,4 @@ class NagImportClass
}
}
}
-}
+}
\ No newline at end of file
diff --git a/functions/NagVisualClass.php b/functions/NagVisualClass.php
index 6deb6fd..1016825 100644
--- a/functions/NagVisualClass.php
+++ b/functions/NagVisualClass.php
@@ -1,644 +1,253 @@
arrSettings = $arrSession['SETS'];
}
if (isset($arrSession['domain'])) {
- $this->intDomainId = $arrSession['domain'];
+ $this->intDomainId = (int)$arrSession['domain'];
}
$this->arrSession = $arrSession;
}
- /**
- * Search for browser type
- * @return string Browser String
- */
- public function browserCheck()
- {
- $strUserAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING);
- // Define variables
- $strBrowserString = 'unknown';
- if (false !== stripos($strUserAgent, 'msie')) {
- $strBrowserString = 'msie';
- } elseif (false !== stripos($strUserAgent, 'firefox')) {
- $strBrowserString = 'firefox';
- } elseif (false !== stripos($strUserAgent, 'opera')) {
- $strBrowserString = 'opera';
- } elseif (false !== stripos($strUserAgent, 'chrome')) {
- $strBrowserString = 'chrome';
- }
- return $strBrowserString;
- }
-
- /**
- * Checks if an user has acces to an account group
- * @param int $intGroupId Group ID
- * @param string $strType Access type (read,write,link)
- * @return int 0 = access granted / 1 = no access
- */
- public function checkAccountGroup($intGroupId, $strType)
- {
- // Define variables
- $intReturn = 0;
- // Admin user or member og group 0 do not need permissions
- if (($this->arrSession['userid'] != 1) && ($intGroupId != 0)) {
- // Define variables
- $arrDataMain = array();
- // Read database values
- $strTypeValue = $this->getGroupValue($strType);
- if ($strTypeValue != '') {
- $strSQL = "SELECT * FROM `tbl_lnkGroupToUser` WHERE `idMaster`=$intGroupId AND ".
- '`idSlave`=' .$this->arrSession['userid']." AND $strTypeValue";
- $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataMain, $intDataCount);
- if ($booReturn == false) {
- $this->strErrorMessage .= $this->myDBClass->strErrorMessage;
- }
- if (($booReturn == false) || ($intDataCount == 0)) {
- $intReturn = 1;
- }
- }
- }
- return $intReturn;
- }
-
/**
* Find out the actual position inside the menu tree and returns it as an info line
- * @param int $intPageId Current content id
- * @param string $strTop Label string for the root node
- * @return string HTML info string
+ * @param int $intPageId Current content id
+ * @param string $strTop Label string for the root node
+ * @return string HTML info string
*/
- public function getPosition($intPageId, $strTop = '')
+ public function getPosition(int $intPageId, string $strTop = ''): string
{
- // Define variables
- $arrData = array();
+ /* Define variables */
+ $arrData = array();
$intDataCount = 0;
- $strPosition = '';
- // Read database values
- $strSQL = 'SELECT B.`mnuName` AS `mainitem`, B.`mnuLink` AS `mainlink`, A.`mnuName` AS `subitem`, '
+ $strPosition = '';
+ /* Read database values */
+ $strSQL = 'SELECT B.`mnuName` AS `mainitem`, B.`mnuLink` AS `mainlink`, A.`mnuName` AS `subitem`, '
. 'A.`mnuLink` AS `sublink` FROM `tbl_menu` AS A '
- . 'LEFT JOIN `tbl_menu` AS B ON A.`mnuTopId` = B.`mnuId` WHERE A.`mnuId`=' .$intPageId;
+ . 'LEFT JOIN `tbl_menu` AS B ON A.`mnuTopId` = B.`mnuId` WHERE A.`mnuId`=' . $intPageId;
$booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
- if ($booReturn == false) {
+ if ($booReturn === false) {
$this->strErrorMessage .= $this->myDBClass->strErrorMessage;
- } elseif ($intDataCount != 0) {
- $strMainLink = $this->arrSettings['path']['base_url'].$arrData[0]['mainlink'];
- $strMain = $arrData[0]['mainitem'];
- $strSubLink = $this->arrSettings['path']['base_url'].$arrData[0]['sublink'];
- $strSub = $arrData[0]['subitem'];
- if ($strTop != '') {
- $strPosition .= "".$strTop. ' -> ';
+ } elseif ($intDataCount !== 0) {
+ $strMainLink = $this->arrSettings['path']['base_url'] . $arrData[0]['mainlink'];
+ $strMain = $arrData[0]['mainitem'];
+ $strSubLink = $this->arrSettings['path']['base_url'] . $arrData[0]['sublink'];
+ $strSub = $arrData[0]['subitem'];
+ if ($strTop !== '') {
+ $strPosition .= "" . $strTop . ' -> ';
}
- if ($strMain != '') {
- $strPosition .= "".translate($strMain)." -> ".
- translate($strSub). '';
+ if (($strMain !== '') && ($strMain !== null)) {
+ $strPosition .= "" . translate($strMain) . " -> " .
+ translate($strSub) . '';
} else {
- $strPosition .= "".translate($strSub). '';
+ $strPosition .= "" . translate($strSub) . '';
}
}
return $strPosition;
}
/**
- * Returns any group ID with the requested access type
- * @param string $strType Access type (read,write,link)
- * @return string Comma separated string with group id's
+ * Generate the main menu HTML
+ * @param int $intPageId Current content id
+ * @param int $intCntId Menu group ID
+ * @return string HTML menu string
*/
- public function getAccessGroups($strType)
+ public function getMenu(int $intPageId, int $intCntId = 1): string
+ {
+ /* Define variables */
+ $strQueryString = filter_input(INPUT_SERVER, 'QUERY_STRING', FILTER_UNSAFE_RAW);
+ $strPHPSelf = filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_UNSAFE_RAW);
+
+ /* Modify URL for visible/invisible menu */
+ $strQuery = str_replace(
+ array('menu=visible&', 'menu=invisible&', 'menu=visible', 'menu=invisible'),
+ '',
+ $strQueryString
+ );
+ if ($strQuery !== '') {
+ $strVisible = str_replace('&', '&', $strPHPSelf . '?menu=visible&' . $strQuery);
+ $strInvisible = str_replace('&', '&', $strPHPSelf . '?menu=invisible&' . $strQuery);
+ } else {
+ $strVisible = $strPHPSelf . '?menu=visible';
+ $strInvisible = $strPHPSelf . '?menu=invisible';
+ }
+ $this->intPageId = $intPageId;
+ if (!isset($this->arrSession['menu']) || ($this->arrSession['menu'] !== 'invisible')) {
+ /* Menu visible */
+ $strHTML = '
'."\n";
- }
- return $strHTML;
- }
-
- /**
- * Add security features to text values
- * @param string $strKey Process string
- * @return string Modified process string
- */
- public function tfSecure($strKey)
- {
- $strKey = stripslashes($strKey);
- $strKey = $this->myDBClass->realEscape($strKey);
- return $strKey;
- }
-
- /**
- * Build a string which contains links for additional pages. This is used in data lists
- * with more items then defined in settings "lines per page limit"
- * @param string $strSite Link to page
- * @param int $intDataCount Sum of all data lines
- * @param int $chkLimit Actual data limit
- * @param string $strOrderBy OrderBy Field
- * @param string $strOrderDir Order direction
- * @return string Page site number string (HTML)
- */
- public function buildPageLinks($strSite, $intDataCount, $chkLimit, $strOrderBy = '', $strOrderDir = '')
- {
- $intMaxLines = $this->arrSettings['common']['pagelines'];
- $intCount = 1;
- $intCheck = 0;
- $strReturn = '';
- $strSiteHTML = "
';
+if ($intUpdate === 1) {
$arrTemplate['DISABLE_UPDATE'] = '';
} else {
$arrTemplate['DISABLE_UPDATE'] = "disabled=\disabled\"";
}
-if ($intError == 1) {
- $arrTemplate['DISABLE_NEW'] = "disabled=\disabled\"";
+if ($intError === 1) {
+ $arrTemplate['DISABLE_NEW'] = "disabled=\disabled\"";
$arrTemplate['DISABLE_UPDATE'] = "disabled=\disabled\"";
}
-//
-// Write content
-// =============
+/*
+Write content
+*/
$strContent = $myInstClass->parseTemplate($arrTemplate, $preContent);
-echo $strContent;
+echo $strContent;
\ No newline at end of file
diff --git a/install/install.php b/install/install.php
index e071f8a..7fd57e5 100644
--- a/install/install.php
+++ b/install/install.php
@@ -1,165 +1,149 @@
array('default' => 0))
);
-$strSqlFile = str_replace('DBTYPE', $_SESSION['install']['dbtype'], $preSqlNewInstall);
-if (filter_input(INPUT_POST, 'butNewInstall') != null) {
+$strSqlFile = str_replace('DBTYPE', $_SESSION['install']['dbtype'], $preSqlNewInstall);
+if (filter_input(INPUT_POST, 'butNewInstall') !== null) {
$chkModus = 'Installation';
}
-if (filter_input(INPUT_POST, 'butUpgrade') != null) {
+if (filter_input(INPUT_POST, 'butUpgrade') !== null) {
$chkModus = 'Update';
}
if (!isset($_SESSION['install']['mode'])) {
$_SESSION['install']['mode'] = $chkModus;
}
-//
-// Language settings
-// =================
+/*
+Language settings
+*/
if (extension_loaded('gettext')) {
- putenv('LC_ALL=' .$_SESSION['install']['locale'].$preEncode);
- putenv('LANG=' .$_SESSION['install']['locale'].$preEncode);
- // GETTEXT domain
- setlocale(LC_ALL, $_SESSION['install']['locale']. '.' .$preEncode);
+ putenv('LC_ALL=' . $_SESSION['install']['locale'] . $preEncode);
+ putenv('LANG=' . $_SESSION['install']['locale'] . $preEncode);
+ setlocale(LC_ALL, $_SESSION['install']['locale'] . '.' . $preEncode);
bindtextdomain($_SESSION['install']['locale'], $preLocale);
bind_textdomain_codeset($_SESSION['install']['locale'], $preEncode);
textdomain($_SESSION['install']['locale']);
}
$myInstClass->arrSession = $_SESSION;
-//
-// Content in buffer laden
-// =======================
+/*
+Content in buffer laden
+*/
ob_start();
-include 'step' .$chkStep. '.php';
-$strContentRaw = ob_get_contents();
-ob_end_clean();
-//
-// Build content
-// =============
-$arrTemplate['PAGETITLE'] = '[NagiosQL] Installation Wizard';
+include 'step' . $chkStep . '.php';
+$strContentRaw = ob_get_clean();
+/*
+Build content
+*/
+$arrTemplate['PAGETITLE'] = '[NagiosQL] Installation Wizard';
$arrTemplate['MAIN_TITLE'] = $myInstClass->translate('Welcome to the NagiosQL Installation Wizard');
-$arrTemplate['CONTENT'] = $strContentRaw;
-//
-// Write content
-// =============
+$arrTemplate['CONTENT'] = $strContentRaw;
+/*
+Write content
+*/
$myInstClass->filTemplate = $preContent;
$strContent = $myInstClass->parseTemplate($arrTemplate, $preContent);
-echo $strContent;
+echo $strContent;
\ No newline at end of file
diff --git a/install/sql/import_nagios_sample.sql b/install/sql/import_nagios_sample.sql
index 493dd9e..24ae129 100644
--- a/install/sql/import_nagios_sample.sql
+++ b/install/sql/import_nagios_sample.sql
@@ -5,12 +5,12 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
--- (c) 2005-2018 by Martin Willisegger
+-- (c) 2005-2022 by Martin Willisegger
--
-- Project : NagiosQL
-- Component : Import samples build from Nagios 3.0.5 configuration samples
-- Website : https://sourceforge.net/projects/nagiosql/
--- Version : 3.4.0
+-- Version : 3.5.0
-- GIT Repo : https://gitlab.com/wizonet/NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
diff --git a/install/sql/nagiosQL_v32_db_mysql.sql b/install/sql/nagiosQL_v32_db_mysql.sql
index 7f4fba2..75d7f37 100644
--- a/install/sql/nagiosQL_v32_db_mysql.sql
+++ b/install/sql/nagiosQL_v32_db_mysql.sql
@@ -5,12 +5,12 @@
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
--- (c) 2005-2018 by Martin Willisegger
+-- (c) 2005-2023 by Martin Willisegger
--
-- Project : NagiosQL
-- Component : Complete NagiosQL Database
-- Website : https://sourceforge.net/projects/nagiosql/
--- Version : 3.4.0
+-- Version : 3.5.0
-- GIT Repo : https://gitlab.com/wizonet/NagiosQL
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
diff --git a/install/sql/nagiosQL_v341_db_mysql.sql b/install/sql/nagiosQL_v341_db_mysql.sql
new file mode 100644
index 0000000..4b3264c
--- /dev/null
+++ b/install/sql/nagiosQL_v341_db_mysql.sql
@@ -0,0 +1,2862 @@
+--
+-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+--
+-- NagiosQL
+--
+-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+--
+-- (c) 2005-2023 by Martin Willisegger
+--
+-- Project : NagiosQL
+-- Component : Complete NagiosQL Database
+-- Website : https://sourceforge.net/projects/nagiosql/
+-- Version : 3.5.0
+-- GIT Repo : https://gitlab.com/wizonet/NagiosQL
+--
+-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+SET NAMES 'utf8';
+
+--
+-- Structure for table `tbl_command`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_command` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `command_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `command_line` text COLLATE utf8_unicode_ci NOT NULL,
+ `command_type` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `arg1_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
+ `arg2_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
+ `arg3_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
+ `arg4_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
+ `arg5_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
+ `arg6_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
+ `arg7_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
+ `arg8_info` text COLLATE utf8_unicode_ci DEFAULT NULL,
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(10) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`command_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_command`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_configtarget`
+--
+
+CREATE TABLE `tbl_configtarget` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `target` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `server` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `port` int(10) UNSIGNED NOT NULL DEFAULT '22',
+ `method` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `user` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `ssh_key_path` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `ftp_secure` tinyint(3) UNSIGNED NOT NULL DEFAULT '0',
+ `basedir` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `hostconfig` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `serviceconfig` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `backupdir` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `hostbackup` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `servicebackup` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `nagiosbasedir` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `importdir` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `picturedir` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `commandfile` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `binaryfile` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `pidfile` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `conffile` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `cgifile` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `resourcefile` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `version` tinyint(3) UNSIGNED NOT NULL DEFAULT '3',
+ `access_group` int(10) UNSIGNED NOT NULL DEFAULT '0',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `nodelete` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
+ `last_modified` datetime NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `target` (`target`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+--
+-- Datasets for table `tbl_configtarget`
+--
+INSERT INTO `tbl_configtarget` (`id`, `target`, `alias`, `server`, `method`, `user`, `password`, `ssh_key_path`, `ftp_secure`, `basedir`, `hostconfig`, `serviceconfig`, `backupdir`, `hostbackup`, `servicebackup`, `nagiosbasedir`, `importdir`, `picturedir`, `commandfile`, `binaryfile`, `pidfile`, `conffile`, `cgifile`, `resourcefile`, `version`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES (1, 'localhost', 'Local installation', 'localhost', '1', '', '', '', 0, '/etc/nagiosql/', '/etc/nagiosql/hosts/', '/etc/nagiosql/services/', '/etc/nagiosql/backup/', '/etc/nagiosql/backup/hosts/', '/etc/nagiosql/backup/services/', '/etc/nagios/', '/opt/nagios/etc/objects/', '', '/var/nagios/rw/nagios.cmd', '/opt/nagios/bin/nagios', '/var/nagios/nagios.lock', '/etc/nagios/nagios.cfg', '/etc/nagios/cgi.cfg', '/etc/nagios/resource.cfg', 3, 0, '1', '1', NOW());
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_contact`
+--
+CREATE TABLE IF NOT EXISTS `tbl_contact` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `contact_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `contactgroups` int(10) unsigned NOT NULL DEFAULT '0',
+ `contactgroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `minimum_importance` int(11) DEFAULT NULL,
+ `host_notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `service_notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `host_notification_period` int(10) unsigned NOT NULL DEFAULT '0',
+ `service_notification_period` int(10) unsigned NOT NULL DEFAULT '0',
+ `host_notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `service_notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `host_notification_commands` int(10) unsigned NOT NULL DEFAULT '0',
+ `host_notification_commands_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `service_notification_commands` int(10) unsigned NOT NULL DEFAULT '0',
+ `service_notification_commands_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `can_submit_commands` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `pager` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address4` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address5` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address6` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(10) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`contact_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_contact`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_contactgroup`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_contactgroup` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `contactgroup_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `members` int(10) unsigned NOT NULL DEFAULT '0',
+ `contactgroup_members` int(10) unsigned NOT NULL DEFAULT '0',
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(10) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`contactgroup_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_contactgroup`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_contacttemplate`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_contacttemplate` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `template_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `contactgroups` int(10) unsigned NOT NULL DEFAULT '0',
+ `contactgroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `minimum_importance` int(11) DEFAULT NULL,
+ `host_notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `service_notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `host_notification_period` int(11) NOT NULL DEFAULT '0',
+ `service_notification_period` int(11) NOT NULL DEFAULT '0',
+ `host_notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `service_notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `host_notification_commands` int(10) unsigned NOT NULL DEFAULT '0',
+ `host_notification_commands_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `service_notification_commands` int(10) unsigned NOT NULL DEFAULT '0',
+ `service_notification_commands_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `can_submit_commands` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `pager` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address1` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address2` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address3` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address4` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address5` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address6` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(10) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`template_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_contacttemplate`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_datadomain`
+--
+
+
+CREATE TABLE IF NOT EXISTS `tbl_datadomain` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `domain` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `targets` int(10) unsigned NOT NULL,
+ `version` tinyint(3) unsigned NOT NULL DEFAULT '3',
+ `enable_common` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `utf8_decode` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `access_group` int(10) unsigned NOT NULL DEFAULT '0',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `nodelete` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
+ `last_modified` datetime NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `domain` (`domain`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_datadomain`
+--
+
+INSERT INTO `tbl_datadomain` (`id`, `domain`, `alias`, `targets`, `version`, `enable_common`, `utf8_decode`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES(0, 'common', 'Global common domain', 0, 3, 0, 0, 0, '1', '1', NOW());
+UPDATE `tbl_datadomain` SET `id` = '0' WHERE `domain` = 'common';
+ALTER TABLE `tbl_datadomain` AUTO_INCREMENT = 1;
+INSERT INTO `tbl_datadomain` (`id`, `domain`, `alias`, `targets`, `version`, `enable_common`, `utf8_decode`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES(1, 'localhost', 'Local installation', 1, 3, 1, 0, 0, '1', '1', NOW());
+
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_group`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_group` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `groupname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `users` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_group`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_host`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_host` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `host_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `display_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `parents` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `parents_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `importance` int(11) DEFAULT NULL,
+ `hostgroups` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `hostgroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `check_command` text COLLATE utf8_unicode_ci NOT NULL,
+ `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `initial_state` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `max_check_attempts` int(11) DEFAULT NULL,
+ `check_interval` int(11) DEFAULT NULL,
+ `retry_interval` int(11) DEFAULT NULL,
+ `active_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `passive_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `check_period` int(11) NOT NULL DEFAULT '0',
+ `obsess_over_host` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `check_freshness` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `freshness_threshold` int(11) DEFAULT NULL,
+ `event_handler` int(11) NOT NULL DEFAULT '0',
+ `event_handler_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `low_flap_threshold` int(11) DEFAULT NULL,
+ `high_flap_threshold` int(11) DEFAULT NULL,
+ `flap_detection_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `flap_detection_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `process_perf_data` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `contacts` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `contacts_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `contact_groups` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `contact_groups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `notification_interval` int(11) DEFAULT NULL,
+ `notification_period` int(11) NOT NULL DEFAULT '0',
+ `first_notification_delay` int(11) DEFAULT NULL,
+ `notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `stalking_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `icon_image` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
+ `icon_image_alt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `vrml_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `statusmap_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `2d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `3d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(10) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`host_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_host`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_hostdependency`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_hostdependency` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `dependent_host_name` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `dependent_hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `host_name` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `inherits_parent` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `execution_failure_criteria` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `notification_failure_criteria` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `dependency_period` int(11) NOT NULL DEFAULT '0',
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(8) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `import_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`config_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_hostdependency`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_hostescalation`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_hostescalation` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `host_name` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `contacts` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `contact_groups` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `first_notification` int(11) DEFAULT NULL,
+ `last_notification` int(11) DEFAULT NULL,
+ `notification_interval` int(11) DEFAULT NULL,
+ `escalation_period` int(11) NOT NULL DEFAULT '0',
+ `escalation_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(8) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `import_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`config_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_hostescalation`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_hostextinfo`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_hostextinfo` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `host_name` int(11) NOT NULL,
+ `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `statistik_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `icon_image` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
+ `icon_image_alt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `vrml_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `statusmap_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `2d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `3d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(8) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`host_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_hostextinfo`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_hostgroup`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_hostgroup` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `hostgroup_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `members` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `hostgroup_members` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(8) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`hostgroup_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_hostgroup`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_hosttemplate`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_hosttemplate` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `template_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `parents` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `parents_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `importance` int(11) DEFAULT NULL,
+ `hostgroups` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `hostgroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `check_command` text COLLATE utf8_unicode_ci NOT NULL,
+ `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `initial_state` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `max_check_attempts` int(11) DEFAULT NULL,
+ `check_interval` int(11) DEFAULT NULL,
+ `retry_interval` int(11) DEFAULT NULL,
+ `active_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `passive_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `check_period` int(11) NOT NULL DEFAULT '0',
+ `obsess_over_host` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `check_freshness` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `freshness_threshold` int(11) DEFAULT NULL,
+ `event_handler` int(11) NOT NULL DEFAULT '0',
+ `event_handler_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `low_flap_threshold` int(11) DEFAULT NULL,
+ `high_flap_threshold` int(11) DEFAULT NULL,
+ `flap_detection_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `flap_detection_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `process_perf_data` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `contacts` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `contacts_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `contact_groups` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `contact_groups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `notification_interval` int(11) DEFAULT NULL,
+ `notification_period` int(11) NOT NULL DEFAULT '0',
+ `first_notification_delay` int(11) DEFAULT NULL,
+ `notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2',
+ `stalking_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
+ `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `icon_image` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
+ `icon_image_alt` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `vrml_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `statusmap_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `2d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `3d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
+ `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0',
+ `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1',
+ `last_modified` datetime NOT NULL,
+ `access_group` int(8) unsigned NOT NULL DEFAULT '0',
+ `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `config_name` (`template_name`,`config_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_hosttemplate`
+--
+
+
+-- --------------------------------------------------------
+
+--
+-- Structure for table `tbl_info`
+--
+
+CREATE TABLE IF NOT EXISTS `tbl_info` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `key1` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
+ `key2` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
+ `version` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
+ `language` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
+ `infotext` text COLLATE utf8_unicode_ci NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `keypair` (`key1`,`key2`,`version`,`language`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
+
+--
+-- Datasets for table `tbl_info`
+--
+
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(1, 'domain', 'domain', 'all', 'default', 'Common name of this domain. This field is for internal use only.');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(2, 'domain', 'basedir', 'all', 'default', '
Absolute path to your NagiosQL configuration directory.
Examples: /etc/nagiosql/ /usr/local/nagiosql/etc/
Be sure, that your configuration path settings are matching with your nagios.cfg! (cfg_file=/etc/nagiosql/timeperiods.cfg)
');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(3, 'domain', 'hostdir', 'all', 'default', 'NagiosQL writes one configuration file for every host. It is useful to store this files inside an own subdirectory below your Nagios configuration path.
Be sure, that your configuration settings are matching with your nagios.cfg! (cfg_dir=/etc/nagios/hosts)');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(4, 'domain', 'servicedir', 'all', 'default', 'NagiosQL writes services grouped into files identified by the service configuration names. It is useful to store this files inside an own subdirectory below your Nagios configuration path.
Be sure, that your configuration settings are matching with your nagios.cfg! (cfg_dir=/etc/nagios/services)');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(5, 'domain', 'backupdir', 'all', 'default', 'Absolute path to your NagiosQL configuration backup directory.
This directory is for internal configuration backups of NagiosQL and is not used by Nagios itself. ');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(6, 'domain', 'backuphostdir', 'all', 'default', 'Absolute path to your NagiosQL host configuration backup directory.
This directory is for internal configuration backups of NagiosQL only and is not used by Nagios itself.');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(7, 'domain', 'backupservicedir', 'all', 'default', 'Absolute path to your NagiosQL service configuration backup directory.
This directory is for internal configuration backups of NagiosQL only and is not used by Nagios itself.');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(8, 'domain', 'commandfile', 'all', 'default', 'Absolute path to your Nagios command file.
Be sure, that your command file path settings are matching with your nagios.cfg! (command_file=/var/spool/nagios/nagios.cmd) (check_external_commands=1)
\r\nThis is used to reload Nagios directly from NagiosQL after changing a configuration.');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(9, 'common', 'accesskeys', 'all', 'default', '
Access key/keyholes
\r\n
NagiosQL uses a very simplified access control mechanism by using up to 8 keys.
\r\n
To access a secure object (menu, domain), a user must have a key for every defined keyhole.
\r\n
Example:
\r\n
User A has key 1,2,5,7 (can be defined in user management) User B has key 3,5,7,8 (can be defined in user management)
\r\n
Menu 1 has keyhole 3,5 Menu 2 has keyhole 2,5,7 Menu 3 has no keyhole Menu 4 has keyhole 4
User A has access to menu 2 and menu 3 (key 3 for menu 1 and key 4 for menu 4 are missing) User B has access to menu 1 and menu 3 (key 2 for menu 2 and key 4 for menu 4 are missing)
If your webserver uses authentification and the NagiosQL user name is the same which is actually logged in - the NagiosQL login process will passed. This means, that NagiosQL no longer shows a login page if this user is already logged in by webserver authentification.
The nagios version which is running in this domain.
\r\n
Be sure you select the correct version here - otherwise not all configuration options are available or not supported options are shown.
\r\n
You can change this with a running configuration - NagiosQL will then upgrade or downgrade your configuration. Don\'t forget to write your complete configuration after a version change!
\r\n
Difference between version in data domain and configuration domain:
\r\n
\r\n
The version information of the data domain is used to define the options offered in the web forms in NagiosQL.
\r\n
The version information of the configuration domain is used to define the options offered in the written configuration files.
\r\n
\r\n
This way you can create your data in a newer Nagios version and still write in an older version to keep the configuration compatible to the running Nagios version.
This directive is used to define a short name used to identify the host. It is used in host group and service definitions to reference this particular host. Hosts can have multiple services (which are monitored) associated with them. When used properly, the $HOSTNAME$ macro will contain this short name.
This directive is used to define a longer name or description used to identify the host. It is provided in order to allow you to more easily identify a particular host. When used properly, the $HOSTALIAS$ macro will contain this alias/description.
This directive is used to define the address of the host. Normally, this is an IP address, although it could really be anything you want (so long as it can be used to check the status of the host). You can use a FQDN to identify the host instead of an IP address, but if DNS services are not availble this could cause problems. When used properly, the $HOSTADDRESS$ macro will contain this address.
\r\n
Note: If you do not specify an address directive in a host definition, the name of the host will be used as its address. A word of caution about doing this, however - if DNS fails, most of your service checks will fail because the plugins will be unable to resolve the host name.
This directive is used to define an alternate name that should be displayed in the web interface for this host. If not specified, this defaults to the value you specify for the host_name directive.
\r\n
Note: The current CGIs do not use this option, although future versions of the web interface will.
This directive is used to define a comma-delimited list of short names of the "parent" hosts for this particular host. Parent hosts are typically routers, switches, firewalls, etc. that lie between the monitoring host and a remote hosts. A router, switch, etc. which is closest to the remote host is considered to be that host''s "parent". Read the "Determining Status and Reachability of Network Hosts" document for more information.
\r\n
If this host is on the same network segment as the host doing the monitoring (without any intermediate routers, etc.) the host is considered to be on the local network and will not have a parent host. Leave this value blank if the host does not have a parent host (i.e. it is on the same segment as the Nagios host). The order in which you specify parent hosts has no effect on how things are monitored.
This directive is used to identify the short name(s) of the hostgroup(s) that the host belongs to. Multiple hostgroups should be separated by commas. This directive may be used as an alternative to (or in addition to) using the members directive in hostgroup definitions.
\r\n
NagiosQL: If a hostgroup is defined here - this host will not be selected inside the member field of the same hostgroup definition!
In some cases you may not want your host, service, or contact definitions to inherit values of string variables from the templates they reference. If this is the case, you can specify "null" as the value of the variable that you do not want to inherit.
\r\n
Additive Inheritance of String Values
\r\n
Nagios gives preference to local variables instead of values inherited from templates. In most cases local variable values override those that are defined in templates. In some cases it makes sense to allow Nagios to use the values of inherited and local variables together.
\r\n
This "additive inheritance" can be accomplished by prepending the local variable value with a plus sign (+). This features is only available for standard (non-custom) variables that contain string values.
This directive is used to specify the short name of the command that should be used to check if the host is up or down. Typically, this command would try and ping the host to see if it is "alive". The command must return a status of OK (0) or Nagios will assume the host is down.
\r\n
If you leave this argument blank, the host will not be actively checked. Thus, Nagios will likely always assume the host is up (it may show up as being in a "PENDING" state in the web interface). This is useful if you are monitoring printers or other devices that are frequently turned off. The maximum amount of time that the notification command can run is controlled by the host_check_timeout option.
The values defined here will replace the according argument variable behind the selected command. Up to 8 argument variables are supported. Be sure, that you defines a valid value for each required argument variable.
By default Nagios will assume that all hosts are in UP states when in starts. You can override the initial state for a host by using this directive. Valid options are: o = UP, d = DOWN, and u = UNREACHABLE.
This directive is used to define the number of "time units" to wait before scheduling a re-check of the hosts. Hosts are rescheduled at the retry interval when they have changed to a non-UP state. Once the host has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" rate as defined by the check_interval value. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.
This directive is used to define the number of times that Nagios will retry the host check command if it returns any state other than an OK state. Setting this value to 1 will cause Nagios to generate an alert without retrying the host check again. Note: If you do not want to check the status of the host, you must still set this to a minimum value of 1. To bypass the host check, just leave the check_command option blank.
This directive is used to define the number of "time units" between regularly scheduled checks of the host. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.
This directive is used to determine whether or not active checks (either regularly scheduled or on-demand) of this host are enabled. Values: 0 = disable active host checks, 1 = enable active host checks.
\r\n
Parameter name: active_checks_enabled Required: no
This directive is used to determine whether or not passive checks are enabled for this host. Values: 0 = disable passive host checks, 1 = enable passive host checks.
\r\n
Parameter name: passive_checks_enabled Required: no
This directive is used to specify the freshness threshold (in seconds) for this host. If you set this directive to a value of 0, Nagios will determine a freshness threshold to use automatically.
This directive is used to determine whether or not freshness checks are enabled for this host. Values: 0 = disable freshness checks, 1 = enable freshness checks.
This directive is used to specify the short name of the command that should be run whenever a change in the state of the host is detected (i.e. whenever it goes down or recovers). Read the documentation on event handlers for a more detailed explanation of how to write scripts for handling events. The maximum amount of time that the event handler command can run is controlled by the event_handler_timeout option.
This directive is used to determine whether or not the event handler for this host is enabled. Values: 0 = disable host event handler, 1 = enable host event handler.
\r\n
Parameter name: event_handler_enabled Required: no
This directive is used to specify the low state change threshold used in flap detection for this host. If you set this directive to a value of 0, the program-wide value specified by the low_host_flap_threshold directive will be used.
This directive is used to specify the high state change threshold used in flap detection for this host. If you set this directive to a value of 0, the program-wide value specified by the high_host_flap_threshold directive will be used.
This directive is used to determine whether or not flap detection is enabled for this host. Values: 0 = disable host flap detection, 1 = enable host flap detection.
\r\n
Parameter name: flap_detection_enabled Required: no
This directive is used to determine what host states the flap detection logic will use for this host. Valid options are a combination of one or more of the following: o = UP states, d = DOWN states, u = UNREACHABLE states.
\r\n
Parameter name: flap_detection_options Required: no
This directive is used to determine whether or not status-related information about the host is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable status information retention, 1 = enable status information retention.
\r\n
Parameter name: retain_status_information Required: no
This directive is used to determine whether or not non-status information about the host is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable non-status information retention, 1 = enable non-status information retention.
\r\n
Parameter name: retain_nonstatus_information Required: no
This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this host. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each host definition.
\r\n
Parameter name:contacs Required: yes (at least one contact or contact group)
This is a list of the short names of the contact groups that should be notified whenever there are problems (or recoveries) with this host. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each host definition.
\r\n
Parameter name: contact_groups Required: yes (at least one contact or contact group)
This directive is used to specify the short name of the time period during which notifications of events for this host can be sent out to contacts. If a host goes down, becomes unreachable, or recoveries during a time which is not covered by the time period, no notifications will be sent out.
This directive is used to determine when notifications for the host should be sent out. Valid options are a combination of one or more of the following: d = send notifications on a DOWN state, u = send notifications on an UNREACHABLE state, r = send notifications on recoveries (OK state), f = send notifications when the host starts and stops flapping, and s = send notifications when scheduled downtime starts and ends. If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states.
\r\n
Example: If you specify d,r in this field, notifications will only be sent out when the host goes DOWN and when it recovers from a DOWN state.
This directive is used to determine whether or not notifications for this host are enabled. Values: 0 = disable host notifications, 1 = enable host notifications.
This directive determines which host states "stalking" is enabled for. Valid options are a combination of one or more of the following: o = stalk on UP states, d = stalk on DOWN states, and u = stalk on UNREACHABLE states.
This directive is used to determine whether or not the processing of performance data is enabled for this host. Values: 0 = disable performance data processing, 1 = enable performance data processing.
This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still down or unreachable. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this host - only one problem notification will be sent out.
This directive is used to define the number of "time units" to wait before sending out the first problem notification when this host enters a non-UP state. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will start sending out notifications immediately.
\r\n
Parameter name: first_notification_delay Required: no
This directive is used to define an optional string of notes pertaining to the host. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified host).
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be used as the texture map for the specified host in the statuswrl CGI. Unlike the image you use for the icon_image variable, this one should probably not have any transparency.
\r\n
If it does, the host object will look a bit wierd. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This variable is used to define an optional URL that can be used to provide more information about the host. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing host information) that links to the URL you specify here. Any valid URL can be used.
\r\n
If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the host, emergency contact methods, etc. available to other support staff.
This variable is used to define the name of an image that should be associated with this host in the statusmap CGI. You can specify a JPEG, PNG, and GIF image if you want, although I would strongly suggest using a GD2 format image, as other image formats will result in a lot of wasted CPU time when the statusmap image is generated.
\r\n
GD2 images can be created from PNG images by using the pngtogd2 utility supplied with Thomas Boutell''s gd library . The GD2 images should be created in uncompressed format in order to minimize CPU load when the statusmap CGI is generating the network map image.
\r\n
The image will look best if it is 40x40 pixels in size. You can leave these option blank if you are not using the statusmap CGI. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional URL that can be used to provide more actions to be performed on the host. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing host information) that links to the URL you specify here. Any valid URL can be used.
\r\n
If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be displayed in the various places in the CGIs. The image will look best if it is 40x40 pixels in size. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This variable is used to define coordinates to use when drawing the host in the statusmap CGI. Coordinates should be given in positive integers, as they correspond to physical pixels in the generated image. The origin for drawing (0,0) is in the upper left hand corner of the image and extends in the positive x direction (to the right) along the top of the image and in the positive y direction (down) along the left hand side of the image.
\r\n
For reference, the size of the icons drawn is usually about 40x40 pixels (text takes a little extra space). The coordinates you specify here are for the upper left hand corner of the host icon that is drawn. Note: Don''t worry about what the maximum x and y coordinates that you can use are. The CGI will automatically calculate the maximum dimensions of the image it creates based on the largest x and y coordinates you specify.
This variable is used to define coordinates to use when drawing the host in the statuswrl CGI. Coordinates can be positive or negative real numbers. The origin for drawing is (0.0,0.0,0.0). For reference, the size of the host cubes drawn is 0.5 units on each side (text takes a little more space). The coordinates you specify here are used as the center of the host cube.
It is possible to use a host definition as a template for other host configurations. If this definition should be used as template, a generic template name must be defined.
\r\n
We do not recommend to do this - it is more open to define a separate host template than to use this option.
This directive is used to specify a common config name for a group of service definitions. This is a NagiosQL parameter and it will not be written to the configuration file. Every service definitions with the same configuration name will stored in one file. The configuration name is also the file name of this configuration set.
This directive is used to specify the short name(s) of the hostgroup(s) that the service "runs" on or is associated with. The hostgroup_name may be used instead of, or in addition to, the host_name directive.
\r\n
Parameter name: hostgroup_name Required: no (yes, if no host is defined)
This directive is used to define the description of the service, which may contain spaces, dashes, and colons (semicolons, apostrophes, and quotation marks should be avoided). No two services associated with the same host can have the same description. Services are uniquely identified with their host_name and service_description directives.
This directive is used to identify the short name(s) of the servicegroup(s) that the service belongs to. Multiple servicegroups should be separated by commas. This directive may be used as an alternative to using the members directive in servicegroup definitions.
\r\n
NagiosQL: If a servicegroup is defined here - this service will not be selected inside the member field of the same servicegroup definition!
This directive is used to define an alternate name that should be displayed in the web interface for this service. If not specified, this defaults to the value you specify for the service_description directive. Note: The current CGIs do not use this option, although future versions of the web interface will.
This directive is used to specify the short name of the command that Nagios will run in order to check the status of the service. The maximum amount of time that the service check command can run is controlled by the service_check_timeout option.
The values defined here will replace the according argument variable behind the selected command. Up to 8 argument variables are supported. Be sure, that you defines a valid value for each required argument variable.
By default Nagios will assume that all services are in OK states when in starts. You can override the initial state for a service by using this directive. Valid options are: o = OK, w = WARNING, u = UNKNOWN, and c = CRITICAL.
This directive is used to define the number of "time units" to wait before scheduling a re-check of the service. Services are rescheduled at the retry interval when they have changed to a non-OK state. Once the service has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" rate as defined by the check_interval value. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.
This directive is used to define the number of times that Nagios will retry the service check command if it returns any state other than an OK state. Setting this value to 1 will cause Nagios to generate an alert without retrying the service check again.
This directive is used to define the number of "time units" to wait before scheduling the next "regular" check of the service. "Regular" checks are those that occur when the service is in an OK state or when the service is in a non-OK state, but has already been rechecked max_check_attempts number of times. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.
This directive is used to determine whether or not active checks of this service are enabled. Values: 0 = disable active service checks, 1 = enable active service checks.
\r\n
Parameter name: active_checks_enabled Required: no
This directive is used to determine whether or not passive checks of this service are enabled. Values: 0 = disable passive service checks, 1 = enable passive service checks.
\r\n
Parameter name: passive_checks_enabled Required: no
This directive is used to determine whether or not the service check can be parallelized. By default, all service checks are parallelized. Disabling parallel checks of services can result in serious performance problems. More information on service check parallelization can be found in the nagios documentation.
\r\n
Values: 0 = service check cannot be parallelized (use with caution!), 1 = service check can be parallelized.
This directive is used to specify the freshness threshold (in seconds) for this service. If you set this directive to a value of 0, Nagios will determine a freshness threshold to use automatically.
This directive is used to determine whether or not freshness checks are enabled for this service. Values: 0 = disable freshness checks, 1 = enable freshness checks.
This directive is used to specify the short name of the command that should be run whenever a change in the state of the service is detected (i.e. whenever it goes down or recovers). Read the documentation on event handlers for a more detailed explanation of how to write scripts for handling events. The maximum amount of time that the event handler command can run is controlled by the event_handler_timeout option.
This directive is used to determine whether or not the event handler for this service is enabled. Values: 0 = disable service event handler, 1 = enable service event handler.
\r\n
Parameter name: event_handler_enabled Required: no
This directive is used to specify the low state change threshold used in flap detection for this service. More information on flap detection can be found in the nagios documentation. If you set this directive to a value of 0, the program-wide value specified by the low_service_flap_threshold directive will be used.
This directive is used to specify the high state change threshold used in flap detection for this service. More information on flap detection can be found in the nagios documentation. If you set this directive to a value of 0, the program-wide value specified by the high_service_flap_threshold directive will be used.
This directive is used to determine whether or not flap detection is enabled for this service. More information on flap detection can be found in the nagios documentation. Values: 0 = disable service flap detection, 1 = enable service flap detection.
\r\n
Parameter name: flap_detection_enabled Required: no
This directive is used to determine what service states the flap detection logic will use for this service. Valid options are a combination of one or more of the following: o = OK states, w = WARNING states, c = CRITICAL states, u = UNKNOWN states.
\r\n
Parameter name: flap_detection_options Required: no
This directive is used to determine whether or not status-related information about the service is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable status information retention, 1 = enable status information retention.
\r\n
Parameter name: retain_status_information Required: no
This directive is used to determine whether or not non-status information about the service is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable non-status information retention, 1 = enable non-status information retention.
\r\n
Parameter name: retain_nonstatus_information Required: no
This directive is used to determine whether or not the processing of performance data is enabled for this service. Values: 0 = disable performance data processing, 1 = enable performance data processing.
This directive is used to denote whether the service is "volatile". Services are normally not volatile. More information on volatile service and how they differ from normal services can be found in the nagios documentation. Value: 0 = service is not volatile, 1 = service is volatile.
This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this service. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each service definition.
\r\n
Parameter name: contacts Required: yes (no, if a contact group is defined)
This is a list of the short names of the contact groups that should be notified whenever there are problems (or recoveries) with this service. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each service definition.
\r\n
Parameter name: contact_groups Required: yes (no, if a contact is defined)
This directive is used to specify the short name of the time period during which notifications of events for this service can be sent out to contacts. No service notifications will be sent out during times which is not covered by the time period.
This directive is used to determine when notifications for the service should be sent out. Valid options are a combination of one or more of the following: w = send notifications on a WARNING state, u = send notifications on an UNKNOWN state, c = send notifications on a CRITICAL state, r = send notifications on recoveries (OK state), f = send notifications when the service starts and stops flapping, and s = send notifications when scheduled downtime starts and ends.
\r\n
If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states.
\r\n
Example: If you specify w,r in this field, notifications will only be sent out when the service goes into a WARNING state and when it recovers from a WARNING state.
This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still in a non-OK state. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this service - only one problem notification will be sent out.
This directive is used to define the number of "time units" to wait before sending out the first problem notification when this service enters a non-OK state. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will start sending out notifications immediately.
\r\n
Parameter name: first_notification_delay Required: no
This directive is used to determine whether or not notifications for this service are enabled. Values: 0 = disable service notifications, 1 = enable service notifications.
\r\n
Parameter name: notifications_enabled Required: no
This directive determines which service states "stalking" is enabled for. Valid options are a combination of one or more of the following: o = stalk on OK states, w = stalk on WARNING states, u = stalk on UNKNOWN states, and c = stalk on CRITICAL states.
\r\n
More information on state stalking can be found in the nagios documentation.
This directive is used to define an optional string of notes pertaining to the service. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified service).
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this service. This image will be displayed in the status and extended information CGIs. The image will look best if it is 40x40 pixels in size. Images for services are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional URL that can be used to provide more information about the service. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing service information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the service, emergency contact methods, etc. available to other support staff.
This variable is used to define an optional string that is used in the ALT tag of the image specified by the <icon_image> argument. The ALT tag is used in the status, extended information and statusmap CGIs.
This directive is used to define an optional URL that can be used to provide more actions to be performed on the service. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing service information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This is a list of the short names of hosts that should be included in this group. Multiple host names should be separated by commas. This directive may be used as an alternative to (or in addition to) the hostgroups directive in host definitions.
\r\n
NagiosQL: If you select a hostgroup inside a host definition using the hostgroups directive in host definition, this host will not be selected here because these are two different ways to specify a hostgroup!
This directive is used to define is a longer name or description used to identify the host group. It is provided in order to allow you to more easily identify a particular host group.
This directive is used to define an optional string of notes pertaining to the host. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified host).
This variable is used to define an optional URL that can be used to provide more information about the host group. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing hostgroup information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the host group, emergency contact methods, etc. available to other support staff.
This directive is used to define an optional URL that can be used to provide more actions to be performed on the host group. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing hostgroup information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This optional directive can be used to include hosts from other "sub" host groups in this host group. Specify a comma-delimited list of short names of other host groups whose members should be included in this group.
This is a list of the descriptions of services (and the names of their corresponding hosts) that should be included in this group. Host and service names should be separated by commas. This directive may be used as an alternative to the servicegroups directive in service definitions.
\r\n
NagiosQL: If you select a servicegroup inside a service definition using the servicegroups directive in service definition, this service will not be selected here because these are two different ways to specify a servicegroup!
This directive is used to define is a longer name or description used to identify the service group. It is provided in order to allow you to more easily identify a particular service group.
This directive is used to define an optional string of notes pertaining to the service group. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified service group).
This directive is used to define an optional URL that can be used to provide more information about the service group. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing service group information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the service group, emergency contact methods, etc. available to other support staff.
This directive is used to define an optional URL that can be used to provide more actions to be performed on the service group. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing service group information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This optional directive can be used to include services from other "sub" service groups in this service group. Specify a comma-delimited list of short names of other service groups whose members should be included in this group.
This directive is used to define a short name used to identify the contact. It is referenced in contact group definitions. Under the right circumstances, the $CONTACTNAME$ macro will contain this value.
This directive is used to identify the short name(s) of the contactgroup(s) that the contact belongs to. Multiple contactgroups should be separated by commas. This directive may be used as an alternative to (or in addition to) using the members directive in contactgroup definitions.
\r\n
NagiosQL: If a contactgroup is defined here - this contact will not be selected inside the member field of the same contactgroup definition!
This directive is used to define a longer name or description for the contact. Under the rights circumstances, the $CONTACTALIAS$ macro will contain this value. If not specified, the contact_name will be used as the alias.
\r\n
Parameter name: alias Required: no (yes in Nagios 2.x)
This directive is used to define an email address for the contact. Depending on how you configure your notification commands, it can be used to send out an alert email to the contact. Under the right circumstances, the $CONTACTEMAIL$ macro will contain this value.
This directive is used to define a pager number for the contact. It can also be an email address to a pager gateway (i.e. pagejoe@pagenet.com). Depending on how you configure your notification commands, it can be used to send out an alert page to the contact. Under the right circumstances, the $CONTACTPAGER$ macro will contain this value.
Address directives are used to define additional "addresses" for the contact. These addresses can be anything - cell phone numbers, instant messaging addresses, etc. Depending on how you configure your notification commands, they can be used to send out an alert o the contact. Up to six addresses can be defined using these directives (address1 through address6). The $CONTACTADDRESSx$ macro will contain this value.
\r\n
Parameter name: addressx (x as number from 1 to 6) Required: no
This directive is used to determine whether or not the contact will receive notifications about host problems and recoveries. Values: 0 = don''t send notifications, 1 = send notifications.
This directive is used to determine whether or not the contact will receive notifications about service problems and recoveries. Values: 0 = don''t send notifications, 1 = send notifications.
This directive is used to specify the short name of the time period during which the contact can be notified about host problems or recoveries. You can think of this as an "on call" time for host notifications for the contact. Read the documentation on time periods for more information on how this works and potential problems that may result from improper use.
This directive is used to specify the short name of the time period during which the contact can be notified about service problems or recoveries. You can think of this as an "on call" time for service notifications for the contact. Read the documentation on time periods for more information on how this works and potential problems that may result from improper use.
This directive is used to define the host states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: d = notify on DOWN host states, u = notify on UNREACHABLE host states, r = notify on host recoveries (UP states), and f = notify when the host starts and stops flapping. If you specify n (none) as an option, the contact will not receive any type of host notifications.
This directive is used to define the host states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: d = notify on DOWN host states, u = notify on UNREACHABLE host states, r = notify on host recoveries (UP states), f = notify when the host starts and stops flapping, and s = send notifications when host or service scheduled downtime starts and ends. If you specify n (none) as an option, the contact will not receive any type of host notifications.
This directive is used to define the service states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: w = notify on WARNING service states, u = notify on UNKNOWN service states, c = notify on CRITICAL service states, r = notify on service recoveries (OK states), and f = notify when the servuce starts and stops flapping. If you specify n (none) as an option, the contact will not receive any type of host notifications.
This directive is used to define the service states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: w = notify on WARNING service states, u = notify on UNKNOWN service states, c = notify on CRITICAL service states, r = notify on service recoveries (OK states), and f = notify when the host starts and stops flapping, and s = send notifications when host or service scheduled downtime starts and ends. If you specify n (none) as an option, the contact will not receive any type of host notifications.
This directive is used to define a list of the short names of the commands used to notify the contact of a host problem or recovery. Multiple notification commands should be separated by commas. All notification commands are executed when the contact needs to be notified. The maximum amount of time that a notification command can run is controlled by the notification_timeout option.
This directive is used to define a list of the short names of the commands used to notify the contact of a service problem or recovery. Multiple notification commands should be separated by commas. All notification commands are executed when the contact needs to be notified. The maximum amount of time that a notification command can run is controlled by the notification_timeout option.
This directive is used to determine whether or not status-related information about the contact is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable status information retention, 1 = enable status information retention.
\r\n
Parameter name: retain_status_information Required: no
This directive is used to determine whether or not the contact can submit external commands to Nagios from the CGIs. Values: 0 = don''t allow contact to submit commands, 1 = allow contact to submit commands.
This directive is used to determine whether or not non-status information about the contact is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable non-status information retention, 1 = enable non-status information retention.
\r\n
Parameter name: retain_nonstatus_information Required: no
It is possible to use a contact definition as a template for other contact configurations. If this definition should be used as template, a generic template name must be defined.
\r\n
We do not recommend to do this - it is more open to define a separate contact template than use this option.
This directive is used to define a list of the short names of contacts that should be included in this group. Multiple contact names should be separated by commas. This directive may be used as an alternative to (or in addition to) using the contactgroups directive in contact definitions.
\r\n
NagiosQL: If you select a contactgroup inside a contact definition using the contactgroups directive in contact definition, this contact will not be selected here because these are two different ways to specify a contactgroup!
This optional directive can be used to include contacts from other "sub" contact groups in this contact group. Specify a comma-delimited list of short names of other contact groups whose members should be included in this group.
This directive is used to specify the short names of other timeperiod definitions whose time ranges should be excluded from this timeperiod. Multiple timeperiod names should be separated with a comma.
The sunday through saturday directives are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday).
\r\n
Parameter name: [weekday] [exception] Required: no
Each time range is in the form of HH:MM-HH:MM, where hours are specified on a 24 hour clock. For example, 00:15-24:00 means 12:15am in the morning for this day until 12:20am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.
\r\n
Parameter name: [weekday] [exception] Required: no
The weekday directives ("sunday" through "saturday")are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday).
\r\n
You can also specify several different types of exceptions to the standard rotating weekday schedule. Exceptions can take a number of different forms including single days of a specific or generic month, single weekdays in a month, or single calendar dates. You can also specify a range of days/dates and even specify skip intervals to obtain functionality described by "every 3 days between these dates". Rather than list all the possible formats for exception strings, Weekdays and different types of exceptions all have different levels of precedence, so its important to understand how they can affect each other. More information on this can be found in the documentation on timeperiods.
\r\n
Parameter name: [weekday] [exception] Required: no
Each time range is in the form of HH:MM-HH:MM, where hours are specified on a 24 hour clock. For example, 00:15-24:00 means 12:15am in the morning for this day until 12:00am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.
\r\n
Parameter name: [weekday] [exception] Required: no
This directive is the short name used to identify the command. It is referenced in contact, host, and service definitions (in notification, check, and event handler directives), among other places.
This directive is used to define what is actually executed by Nagios when the command is used for service or host checks, notifications, or event handlers. Before the command line is executed, all valid macros are replaced with their respective values. See the documentation on macros for determining when you can use different macros. Note that the command line is not surrounded in quotes. Also, if you want to pass a dollar sign ($) on the command line, you have to escape it with another dollar sign.
\r\n
NOTE: You may not include a semicolon (;) in the command_line directive, because everything after it will be ignored as a config file comment. You can work around this limitation by setting one of the $USER$ macros in your resource file to a semicolon and then referencing the appropriate $USER$ macro in the command_line directive in place of the semicolon.
\r\n
If you want to pass arguments to commands during runtime, you can use $ARGn$ macros in the command_line directive of the command definition and then separate individual arguments from the command name (and from each other) using bang (!) characters in the object definition directive (host check command, service event handler command, etc) that references the command. More information on how arguments in command definitions are processed during runtime can be found in the documentation on macros.
This directive is used to identify the short name(s) of the dependenthostgroup(s). Multiple hostgroups should be separated by commas. The dependent_hostgroup_name may be used instead of, or in addition to, the dependent_host_name directive.
\r\n
Parameter name: dependent_hostgroup_name Required: no (yes, if no dependent host is defined)
This directive is used to identify the short name(s) of the host(s) that is being depended upon (also referred to as the master host). Multiple hosts should be separated by commas.
\r\n
Parameter name: host_name Required: yes (no, if a hostgroup is defined)
This directive is used to identify the short name(s) of the host(s) that is being depended upon (also referred to as the master host). Multiple hosts should be separated by commas.
\r\n
Parameter name: hostgroup_name Required: no (yes, if a no host is defined)
This directive is used to specify a common config name for a hostdependency configration. This is a NagiosQL parameter and it will not be written to the configuration file.
This directive indicates whether or not the dependency inherits dependencies of the host that is being depended upon (also referred to as the master host). In other words, if the master host is dependent upon other hosts and any one of those dependencies fail, this dependency will also fail.
This directive is used to specify the short name of the time period during which this dependency is valid. If this directive is not specified, the dependency is considered to be valid during all times.
This directive is used to specify the criteria that determine when the dependent host should not be actively checked. If the master host is in one of the failure states we specify, the dependent host will not be actively checked. Valid options are a combination of one or more of the following (multiple options are separated with commas): o = fail on an UP state, d = fail on a DOWN state, u = fail on an UNREACHABLE state, and p = fail on a pending state (e.g. the host has not yet been checked).
\r\n
If you specify n (none) as an option, the execution dependency will never fail and the dependent host will always be actively checked (if other conditions allow for it to be).
\r\n
Example: If you specify u,d in this field, the dependent host will not be actively checked if the master host is in either an UNREACHABLE or DOWN state.
\r\n
Parameter name: execution_failure_criteria Required: no
This directive is used to define the criteria that determine when notifications for the dependent host should not be sent out. If the master host is in one of the failure states we specify, notifications for the dependent host will not be sent to contacts. Valid options are a combination of one or more of the following: o = fail on an UP state, d = fail on a DOWN state, u = fail on an UNREACHABLE state, and p = fail on a pending state (e.g. the host has not yet been checked).
\r\n
If you specify n (none) as an option, the notification dependency will never fail and notifications for the dependent host will always be sent out.
\r\n
Example: If you specify d in this field, the notifications for the dependent host will not be sent out if the master host is in a DOWN state.
\r\n
Parameter name: notification_failure_criteria Required: no
This directive is used to identify the short name(s) of the hostgroup(s) that the escalation should apply to. Multiple hostgroups should be separated by commas. If this is used, the escalation will apply to all hosts that are members of the specified hostgroup(s).
\r\n
Parameter name: hostgroup_name Required: no (yes, if no host ist defined)
This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this host. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each host escalation definition.
\r\n
Parameter name: contacts Required: yes (no, if a contactgroup is defined)
This directive is used to identify the short name of the contact group that should be notified when the host notification is escalated. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each host escalation definition.
\r\n
Parameter name: contact_groups Required: yes (no, if a contact is defined)
This directive is used to specify a common config name for a hostescalation configration. This is a NagiosQL parameter and it will not be written to the configuration file.
This directive is used to specify the short name of the time period during which this escalation is valid. If this directive is not specified, the escalation is considered to be valid during all times.
This directive is used to define the criteria that determine when this host escalation is used. The escalation is used only if the host is in one of the states specified in this directive. If this directive is not specified in a host escalation, the escalation is considered to be valid during all host states. Valid options are a combination of one or more of the following: r = escalate on an UP (recovery) state, d = escalate on a DOWN state, and u = escalate on an UNREACHABLE state.
\r\n
Example: If you specify d in this field, the escalation will only be used if the host is in a DOWN state.
This directive is a number that identifies the first notification for which this escalation is effective. For instance, if you set this value to 3, this escalation will only be used if the host is down or unreachable long enough for a third notification to go out.
This directive is a number that identifies the last notification for which this escalation is effective. For instance, if you set this value to 5, this escalation will not be used if more than five notifications are sent out for the host. Setting this value to 0 means to keep using this escalation entry forever (no matter how many notifications go out).
This directive is used to determine the interval at which notifications should be made while this escalation is valid. If you specify a value of 0 for the interval, Nagios will send the first notification when this escalation definition is valid, but will then prevent any more problem notifications from being sent out for the host. Notifications are sent out again until the host recovers.
\r\n
This is useful if you want to stop having notifications sent out after a certain amount of time. Note: If multiple escalation entries for a host overlap for one or more notification ranges, the smallest notification interval from all escalation entries is used.
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be displayed in the status and extended information CGIs. The image will look best if it is 40x40 pixels in size.
\r\n
Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional string of notes pertaining to the host. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified host).
This variable is used to define an optional string that is used in the ALT tag of the image specified by the <icon_image> argument. The ALT tag is used in the status, extended information and statusmap CGIs.
This variable is used to define an optional URL that can be used to provide more information about the host. If you specify an URL, you will see a link that says "Extra Host Notes" in the extended information CGI (when you are viewing information about the specified host). Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the host, emergency contact methods, etc. available to other support staff.
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be used as the texture map for the specified host in the statuswrl CGI. Unlike the image you use for the icon_image variable, this one should probably not have any transparency. If it does, the host object will look a bit wierd.
\r\n
Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional URL that can be used to provide more actions to be performed on the host. If you specify an URL, you will see a link that says "Extra Host Actions" in the extended information CGI (when you are viewing information about the specified host). Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This variable is used to define the name of an image that should be associated with this host in the statusmap CGI. You can specify a JPEG, PNG, and GIF image if you want, although I would strongly suggest using a GD2 format image, as other image formats will result in a lot of wasted CPU time when the statusmap image is generated.
\r\n
GD2 images can be created from PNG images by using the pngtogd2 utility supplied with Thomas Boutell''s gd library. The GD2 images should be created in uncompressed format in order to minimize CPU load when the statusmap CGI is generating the network map image.
\r\n
The image will look best if it is 40x40 pixels in size. You can leave these option blank if you are not using the statusmap CGI. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This variable is used to define coordinates to use when drawing the host in the statusmap CGI. Coordinates should be given in positive integers, as they correspond to physical pixels in the generated image. The origin for drawing (0,0) is in the upper left hand corner of the image and extends in the positive x direction (to the right) along the top of the image and in the positive y direction (down) along the left hand side of the image. For reference, the size of the icons drawn is usually about 40x40 pixels (text takes a little extra space). The coordinates you specify here are for the upper left hand corner of the host icon that is drawn.
\r\n
Note: Don''t worry about what the maximum x and y coordinates that you can use are. The CGI will automatically calculate the maximum dimensions of the image it creates based on the largest x and y coordinates you specify.
This variable is used to define coordinates to use when drawing the host in the statuswrl CGI. Coordinates can be positive or negative real numbers. The origin for drawing is (0.0,0.0,0.0). For reference, the size of the host cubes drawn is 0.5 units on each side (text takes a little more space). The coordinates you specify here are used as the center of the host cube.
This directive is used to specify the short name(s) of the hostgroup(s) that the service escalation should apply to or is associated with. Multiple hostgroups should be separated by commas. The hostgroup_name may be used instead of, or in addition to, the host_name directive.
\r\n
Parameter name: hostgroup_name Required: yes (no, if a host name is defined)
This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this service. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each service escalation definition.
\r\n
Parameter name: contacts Required: yes (no, if a contact group is defined)
This directive is used to identify the short name of the contact group that should be notified when the service notification is escalated. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each service escalation definition.
\r\n
Parameter name: contact_groups Required: yes (no, if a contact is defined)
This directive is used to specify a common config name for a serviceescalation configration. This is a NagiosQL parameter and it will not be written to the configuration file.
This directive is a number that identifies the first notification for which this escalation is effective. For instance, if you set this value to 3, this escalation will only be used if the service is in a non-OK state long enough for a third notification to go out.
This directive is a number that identifies the last notification for which this escalation is effective. For instance, if you set this value to 5, this escalation will not be used if more than five notifications are sent out for the service. Setting this value to 0 means to keep using this escalation entry forever (no matter how many notifications go out).
This directive is used to determine the interval at which notifications should be made while this escalation is valid. If you specify a value of 0 for the interval, Nagios will send the first notification when this escalation definition is valid, but will then prevent any more problem notifications from being sent out for the host. Notifications are sent out again until the host recovers.
\r\n
This is useful if you want to stop having notifications sent out after a certain amount of time. Note: If multiple escalation entries for a host overlap for one or more notification ranges, the smallest notification interval from all escalation entries is used.
This directive is used to specify the short name of the time period during which this escalation is valid. If this directive is not specified, the escalation is considered to be valid during all times.
This directive is used to define the criteria that determine when this service escalation is used. The escalation is used only if the service is in one of the states specified in this directive. If this directive is not specified in a service escalation, the escalation is considered to be valid during all service states. Valid options are a combination of one or more of the following: r = escalate on an OK (recovery) state, w = escalate on a WARNING state, u = escalate on an UNKNOWN state, and c = escalate on a CRITICAL state.
\r\n
Example: If you specify w in this field, the escalation will only be used if the service is in a WARNING state.
This directive is used to identify the short name(s) of the host(s) that the dependent service "runs" on or is associated with. Multiple hosts should be separated by commas. Leaving this directive blank can be used to create "same host" dependencies.
\r\n
Parameter name: dependent_host Required: yes (no, if a dependent hostgroup is defined)
This directive is used to identify the short name(s) of the host(s) that the service that is being depended upon (also referred to as the master service) "runs" on or is associated with. Multiple hosts should be separated by commas.
\r\n
Parameter name: host_name Required: yes (no, if a hostgroup is defined)
This directive is used to specify the short name(s) of the hostgroup(s) that the dependent service "runs" on or is associated with. Multiple hostgroups should be separated by commas. The dependent_hostgroup may be used instead of, or in addition to, the dependent_host directive.
\r\n
Parameter name: dependent_hostgroup Required: yes (no, if a dependent host is defined)
This directive is used to identify the short name(s) of the hostgroup(s) that the service that is being depended upon (also referred to as the master service) "runs" on or is associated with. Multiple hostgroups should be separated by commas. The hostgroup_name may be used instead of, or in addition to, the host_name directive.
\r\n
Parameter name: hostgroup_name Required: yes (no, if a host is defined)
This directive is used to specify a common config name for a servicedependency configration. This is a NagiosQL parameter and it will not be written to the configuration file.
This directive indicates whether or not the dependency inherits dependencies of the service that is being depended upon (also referred to as the master service). In other words, if the master service is dependent upon other services and any one of those dependencies fail, this dependency will also fail.
This directive is used to specify the short name of the time period during which this dependency is valid. If this directive is not specified, the dependency is considered to be valid during all times.
This directive is used to specify the criteria that determine when the dependent service should not be actively checked. If the master service is in one of the failure states we specify, the dependent service will not be actively checked. Valid options are a combination of one or more of the following (multiple options are separated with commas): o = fail on an OK state, w = fail on a WARNING state, u = fail on an UNKNOWN state, c = fail on a CRITICAL state, and p = fail on a pending state (e.g. the service has not yet been checked). If you specify n (none) as an option, the execution dependency will never fail and checks of the dependent service will always be actively checked (if other conditions allow for it to be).
\r\n
Example: If you specify o,c,u in this field, the dependent service will not be actively checked if the master service is in either an OK, a CRITICAL, or an UNKNOWN state.
\r\n
Parameter name: execution_failure_criteria Required: no
This directive is used to define the criteria that determine when notifications for the dependent service should not be sent out. If the master service is in one of the failure states we specify, notifications for the dependent service will not be sent to contacts. Valid options are a combination of one or more of the following: o = fail on an OK state, w = fail on a WARNING state, u = fail on an UNKNOWN state, c = fail on a CRITICAL state, and p = fail on a pending state (e.g. the service has not yet been checked). If you specify n (none) as an option, the notification dependency will never fail and notifications for the dependent service will always be sent out.
\r\n
Example: If you specify w in this field, the notifications for the dependent service will not be sent out if the master service is in a WARNING state.
\r\n
Parameter name: notification_failure_criteria Required: no
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be displayed in the status and extended information CGIs.
\r\n
The image will look best if it is 40x40 pixels in size. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional string of notes pertaining to the service. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified service).
This directive is used to define an optional URL that can be used to provide more actions to be performed on the service. If you specify an URL, you will see a link that says "Extra Service Actions" in the extended information CGI (when you are viewing information about the specified service). Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This directive is used to define an optional URL that can be used to provide more information about the service. If you specify an URL, you will see a link that says "Extra Service Notes" in the extended information CGI (when you are viewing information about the specified service). Any valid URL can be used.
\r\n
If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the service, emergency contact methods, etc. available to other support staff.
This variable is used to define an optional string that is used in the ALT tag of the image specified by the <icon_image> argument. The ALT tag is used in the status, extended information and statusmap CGIs.
Its just a "template" name that can be referenced in other object definitions so they can inherit the objects properties/variables. Template names must be unique amongst objects of the same type, so you can''t have two or more time definitions that have "mytemplate" as their template name.
This directive is used to specify the short names (template names) of other timeperiod definitions whose time ranges should be included to this timeperiod. Multiple timeperiod names should be separated with a comma.
If this option is selected, the specified user is able to modify the access group for every object definition. This should be restricted only to administrators; otherwise a user might be able to lock himself out.
READ = The user can see the objects belong to this group WRITE = The user can modify the objects belong to this group LINK = The user can use the objects belong to this group to link them in other objects*
* Example: If a time object belongs to this group - the user can add (link) this time object to his contact objects.
This option is used to enable or disable the global common domain functionality.
\r\n
If this option is enabled, all objects from the global common domain will be added to this domains configuration files. The global common domain can be used to define objects like timeperiods or contacts that are used in all domains the same.
If this option is enabled, UTF8 data from database will be translated to ISO in configuration file. So, the configuration files will be in ISO mode. This could be helpful, if nagios does not understand the UTF8 data from NagiosQL.
This path is based on your nagios standard image path. Images are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
\r\n
So in the example above, the images are located in:
This variable is used to indicate whether or not the object definition should be "registered" with Nagios. By default, all object definitions are registered. If you are using a partial object definition as a template, you would want to prevent it from being registered (an example of this is provided later). Values are as follows: 0 = do NOT register object definition, 1 = register object definition (this is the default). This variable is NOT inherited; every (partial) object definition used as a template must explicitly set the register directive to be 0. This prevents the need to override an inherited register directive with a value of 1 for every object that should be registered.
Select a configuration domain which is assigned to this data domain
\r\n
The settings where to store the configuration files are defined in a configuration domain. Select here the desired target for your configuration files.
');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(240, 'domain', 'ssh_host_key', 'all', 'default', 'Absolute path to the ssh key directory for the defined ssh user.
This directory includes the key file (id_rsa) for the user to connect to the remote system. Note, that the file name is set to id_rsa!');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(241, 'contact', 'minimum_importance', 'all', 'default', '
Contact - minimum importance
\r\n
This directive is used as the value that the host or service importance value must equal before notification is sent to this contact. The importance values are intended to represent the value of a host or service to an organization. For example, you could set this value and the importance value of a host such that a system administrator would be notified when a development server goes down, but the CIO would only be notified when the company\'s production ecommerce database server was down. The minimum_importance value defaults to zero.
\r\n
In Nagios Core 4.0.0 to 4.0.3 this was known as minimum_value but has been replaced with minimum_importance.
\r\n
Parameter name: minimum_importance Required: no
');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(242, 'domain', 'ftps_option', 'all', 'default', 'Use encrypted FTP (FTPS) to connect to the remote server. ');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(243, 'domain', 'cgifile', 'all', 'default', '
This directive is used to represent the importance of the host to your organization. The importance is used when determining whether to send notifications to a contact. If the host\'s importance value plus the importance values of all of the host\'s services is greater than or equal to the contact\'s minimum_importance, the contact will be notified. For example, you could set this value and the minimum_importance of contacts such that a system administrator would be notified when a development server goes down, but the CIO would only be notified when the company\'s production ecommerce database server was down. The importance could also be used as a sort criteria when generating reports or for calculating a good system administrator\'s bonus. The importance value defaults to zero. In Nagios Core 4.0.0 to 4.0.3 this was known as hourly_value but has been replaced with importance.
This directive is used to represent the importance of the service to your organization. The importance is used when determining whether to send notifications to a contact. If the service\'s importance value is greater than or equal to the contact\'s minimum_importance, the contact will be notified. For example, you could set this value and the minimum_importance of contacts such that a system administrator would be notified of a disk full event on a development server, but the CIO would only be notified when the company\'s production ecommerce database was down. The importance could also be used as a sort criteria when generating reports or for calculating a good system administrator\'s bonus. The importance value defaults to zero. In Nagios Core 4.0.0 to 4.0.3 this was known as hourly_value but has been replaced with importance.
This directive is used to define a comma-delimited list of short names of the \"parent\" services for this particular service. Parent services are typically other services that need to be available in order for a check of this service to occur. For example, if a service checks the status of a disk using SSH, the disk check service would have the SSH service as a parent. If the service has no parent services, simply omit the \"parents\" directive. More complex service dependencies may be specified with service dependency objects.
Absolute path to your NagiosQL configuration directory.
Examples: /etc/nagiosql/ /usr/local/nagiosql/etc/
Be sure, that your configuration path settings are matching with your nagios.cfg! (cfg_file=/etc/nagiosql/timeperiods.cfg)
');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(3, 'domain', 'hostdir', 'all', 'default', 'NagiosQL writes one configuration file for every host. It is useful to store this files inside an own subdirectory below your Nagios configuration path.
Be sure, that your configuration settings are matching with your nagios.cfg! (cfg_dir=/etc/nagios/hosts)');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(4, 'domain', 'servicedir', 'all', 'default', 'NagiosQL writes services grouped into files identified by the service configuration names. It is useful to store this files inside an own subdirectory below your Nagios configuration path.
Be sure, that your configuration settings are matching with your nagios.cfg! (cfg_dir=/etc/nagios/services)');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(5, 'domain', 'backupdir', 'all', 'default', 'Absolute path to your NagiosQL configuration backup directory.
This directory is for internal configuration backups of NagiosQL and is not used by Nagios itself. ');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(6, 'domain', 'backuphostdir', 'all', 'default', 'Absolute path to your NagiosQL host configuration backup directory.
This directory is for internal configuration backups of NagiosQL only and is not used by Nagios itself.');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(7, 'domain', 'backupservicedir', 'all', 'default', 'Absolute path to your NagiosQL service configuration backup directory.
This directory is for internal configuration backups of NagiosQL only and is not used by Nagios itself.');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(8, 'domain', 'commandfile', 'all', 'default', 'Absolute path to your Nagios command file.
Be sure, that your command file path settings are matching with your nagios.cfg! (command_file=/var/spool/nagios/nagios.cmd) (check_external_commands=1)
\r\nThis is used to reload Nagios directly from NagiosQL after changing a configuration.');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(9, 'common', 'accesskeys', 'all', 'default', '
Access key/keyholes
\r\n
NagiosQL uses a very simplified access control mechanism by using up to 8 keys.
\r\n
To access a secure object (menu, domain), a user must have a key for every defined keyhole.
\r\n
Example:
\r\n
User A has key 1,2,5,7 (can be defined in user management) User B has key 3,5,7,8 (can be defined in user management)
\r\n
Menu 1 has keyhole 3,5 Menu 2 has keyhole 2,5,7 Menu 3 has no keyhole Menu 4 has keyhole 4
User A has access to menu 2 and menu 3 (key 3 for menu 1 and key 4 for menu 4 are missing) User B has access to menu 1 and menu 3 (key 2 for menu 2 and key 4 for menu 4 are missing)
If your webserver uses authentification and the NagiosQL user name is the same which is actually logged in - the NagiosQL login process will passed. This means, that NagiosQL no longer shows a login page if this user is already logged in by webserver authentification.
The nagios version which is running in this domain.
\r\n
Be sure you select the correct version here - otherwise not all configuration options are available or not supported options are shown.
\r\n
You can change this with a running configuration - NagiosQL will then upgrade or downgrade your configuration. Don\'t forget to write your complete configuration after a version change!
\r\n
Difference between version in data domain and configuration domain:
\r\n
\r\n
The version information of the data domain is used to define the options offered in the web forms in NagiosQL.
\r\n
The version information of the configuration domain is used to define the options offered in the written configuration files.
\r\n
\r\n
This way you can create your data in a newer Nagios version and still write in an older version to keep the configuration compatible to the running Nagios version.
This directive is used to define a short name used to identify the host. It is used in host group and service definitions to reference this particular host. Hosts can have multiple services (which are monitored) associated with them. When used properly, the $HOSTNAME$ macro will contain this short name.
This directive is used to define a longer name or description used to identify the host. It is provided in order to allow you to more easily identify a particular host. When used properly, the $HOSTALIAS$ macro will contain this alias/description.
This directive is used to define the address of the host. Normally, this is an IP address, although it could really be anything you want (so long as it can be used to check the status of the host). You can use a FQDN to identify the host instead of an IP address, but if DNS services are not availble this could cause problems. When used properly, the $HOSTADDRESS$ macro will contain this address.
\r\n
Note: If you do not specify an address directive in a host definition, the name of the host will be used as its address. A word of caution about doing this, however - if DNS fails, most of your service checks will fail because the plugins will be unable to resolve the host name.
This directive is used to define an alternate name that should be displayed in the web interface for this host. If not specified, this defaults to the value you specify for the host_name directive.
\r\n
Note: The current CGIs do not use this option, although future versions of the web interface will.
This directive is used to define a comma-delimited list of short names of the "parent" hosts for this particular host. Parent hosts are typically routers, switches, firewalls, etc. that lie between the monitoring host and a remote hosts. A router, switch, etc. which is closest to the remote host is considered to be that host''s "parent". Read the "Determining Status and Reachability of Network Hosts" document for more information.
\r\n
If this host is on the same network segment as the host doing the monitoring (without any intermediate routers, etc.) the host is considered to be on the local network and will not have a parent host. Leave this value blank if the host does not have a parent host (i.e. it is on the same segment as the Nagios host). The order in which you specify parent hosts has no effect on how things are monitored.
This directive is used to identify the short name(s) of the hostgroup(s) that the host belongs to. Multiple hostgroups should be separated by commas. This directive may be used as an alternative to (or in addition to) using the members directive in hostgroup definitions.
\r\n
NagiosQL: If a hostgroup is defined here - this host will not be selected inside the member field of the same hostgroup definition!
In some cases you may not want your host, service, or contact definitions to inherit values of string variables from the templates they reference. If this is the case, you can specify "null" as the value of the variable that you do not want to inherit.
\r\n
Additive Inheritance of String Values
\r\n
Nagios gives preference to local variables instead of values inherited from templates. In most cases local variable values override those that are defined in templates. In some cases it makes sense to allow Nagios to use the values of inherited and local variables together.
\r\n
This "additive inheritance" can be accomplished by prepending the local variable value with a plus sign (+). This features is only available for standard (non-custom) variables that contain string values.
This directive is used to specify the short name of the command that should be used to check if the host is up or down. Typically, this command would try and ping the host to see if it is "alive". The command must return a status of OK (0) or Nagios will assume the host is down.
\r\n
If you leave this argument blank, the host will not be actively checked. Thus, Nagios will likely always assume the host is up (it may show up as being in a "PENDING" state in the web interface). This is useful if you are monitoring printers or other devices that are frequently turned off. The maximum amount of time that the notification command can run is controlled by the host_check_timeout option.
The values defined here will replace the according argument variable behind the selected command. Up to 8 argument variables are supported. Be sure, that you defines a valid value for each required argument variable.
By default Nagios will assume that all hosts are in UP states when in starts. You can override the initial state for a host by using this directive. Valid options are: o = UP, d = DOWN, and u = UNREACHABLE.
This directive is used to define the number of "time units" to wait before scheduling a re-check of the hosts. Hosts are rescheduled at the retry interval when they have changed to a non-UP state. Once the host has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" rate as defined by the check_interval value. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.
This directive is used to define the number of times that Nagios will retry the host check command if it returns any state other than an OK state. Setting this value to 1 will cause Nagios to generate an alert without retrying the host check again. Note: If you do not want to check the status of the host, you must still set this to a minimum value of 1. To bypass the host check, just leave the check_command option blank.
This directive is used to define the number of "time units" between regularly scheduled checks of the host. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.
This directive is used to determine whether or not active checks (either regularly scheduled or on-demand) of this host are enabled. Values: 0 = disable active host checks, 1 = enable active host checks.
\r\n
Parameter name: active_checks_enabled Required: no
This directive is used to determine whether or not passive checks are enabled for this host. Values: 0 = disable passive host checks, 1 = enable passive host checks.
\r\n
Parameter name: passive_checks_enabled Required: no
This directive is used to specify the freshness threshold (in seconds) for this host. If you set this directive to a value of 0, Nagios will determine a freshness threshold to use automatically.
This directive is used to determine whether or not freshness checks are enabled for this host. Values: 0 = disable freshness checks, 1 = enable freshness checks.
This directive is used to specify the short name of the command that should be run whenever a change in the state of the host is detected (i.e. whenever it goes down or recovers). Read the documentation on event handlers for a more detailed explanation of how to write scripts for handling events. The maximum amount of time that the event handler command can run is controlled by the event_handler_timeout option.
This directive is used to determine whether or not the event handler for this host is enabled. Values: 0 = disable host event handler, 1 = enable host event handler.
\r\n
Parameter name: event_handler_enabled Required: no
This directive is used to specify the low state change threshold used in flap detection for this host. If you set this directive to a value of 0, the program-wide value specified by the low_host_flap_threshold directive will be used.
This directive is used to specify the high state change threshold used in flap detection for this host. If you set this directive to a value of 0, the program-wide value specified by the high_host_flap_threshold directive will be used.
This directive is used to determine whether or not flap detection is enabled for this host. Values: 0 = disable host flap detection, 1 = enable host flap detection.
\r\n
Parameter name: flap_detection_enabled Required: no
This directive is used to determine what host states the flap detection logic will use for this host. Valid options are a combination of one or more of the following: o = UP states, d = DOWN states, u = UNREACHABLE states.
\r\n
Parameter name: flap_detection_options Required: no
This directive is used to determine whether or not status-related information about the host is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable status information retention, 1 = enable status information retention.
\r\n
Parameter name: retain_status_information Required: no
This directive is used to determine whether or not non-status information about the host is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable non-status information retention, 1 = enable non-status information retention.
\r\n
Parameter name: retain_nonstatus_information Required: no
This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this host. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each host definition.
\r\n
Parameter name:contacs Required: yes (at least one contact or contact group)
This is a list of the short names of the contact groups that should be notified whenever there are problems (or recoveries) with this host. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each host definition.
\r\n
Parameter name: contact_groups Required: yes (at least one contact or contact group)
This directive is used to specify the short name of the time period during which notifications of events for this host can be sent out to contacts. If a host goes down, becomes unreachable, or recoveries during a time which is not covered by the time period, no notifications will be sent out.
This directive is used to determine when notifications for the host should be sent out. Valid options are a combination of one or more of the following: d = send notifications on a DOWN state, u = send notifications on an UNREACHABLE state, r = send notifications on recoveries (OK state), f = send notifications when the host starts and stops flapping, and s = send notifications when scheduled downtime starts and ends. If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states.
\r\n
Example: If you specify d,r in this field, notifications will only be sent out when the host goes DOWN and when it recovers from a DOWN state.
This directive is used to determine whether or not notifications for this host are enabled. Values: 0 = disable host notifications, 1 = enable host notifications.
This directive determines which host states "stalking" is enabled for. Valid options are a combination of one or more of the following: o = stalk on UP states, d = stalk on DOWN states, and u = stalk on UNREACHABLE states.
This directive is used to determine whether or not the processing of performance data is enabled for this host. Values: 0 = disable performance data processing, 1 = enable performance data processing.
This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still down or unreachable. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this host - only one problem notification will be sent out.
This directive is used to define the number of "time units" to wait before sending out the first problem notification when this host enters a non-UP state. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will start sending out notifications immediately.
\r\n
Parameter name: first_notification_delay Required: no
This directive is used to define an optional string of notes pertaining to the host. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified host).
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be used as the texture map for the specified host in the statuswrl CGI. Unlike the image you use for the icon_image variable, this one should probably not have any transparency.
\r\n
If it does, the host object will look a bit wierd. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This variable is used to define an optional URL that can be used to provide more information about the host. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing host information) that links to the URL you specify here. Any valid URL can be used.
\r\n
If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the host, emergency contact methods, etc. available to other support staff.
This variable is used to define the name of an image that should be associated with this host in the statusmap CGI. You can specify a JPEG, PNG, and GIF image if you want, although I would strongly suggest using a GD2 format image, as other image formats will result in a lot of wasted CPU time when the statusmap image is generated.
\r\n
GD2 images can be created from PNG images by using the pngtogd2 utility supplied with Thomas Boutell''s gd library . The GD2 images should be created in uncompressed format in order to minimize CPU load when the statusmap CGI is generating the network map image.
\r\n
The image will look best if it is 40x40 pixels in size. You can leave these option blank if you are not using the statusmap CGI. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional URL that can be used to provide more actions to be performed on the host. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing host information) that links to the URL you specify here. Any valid URL can be used.
\r\n
If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be displayed in the various places in the CGIs. The image will look best if it is 40x40 pixels in size. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This variable is used to define coordinates to use when drawing the host in the statusmap CGI. Coordinates should be given in positive integers, as they correspond to physical pixels in the generated image. The origin for drawing (0,0) is in the upper left hand corner of the image and extends in the positive x direction (to the right) along the top of the image and in the positive y direction (down) along the left hand side of the image.
\r\n
For reference, the size of the icons drawn is usually about 40x40 pixels (text takes a little extra space). The coordinates you specify here are for the upper left hand corner of the host icon that is drawn. Note: Don''t worry about what the maximum x and y coordinates that you can use are. The CGI will automatically calculate the maximum dimensions of the image it creates based on the largest x and y coordinates you specify.
This variable is used to define coordinates to use when drawing the host in the statuswrl CGI. Coordinates can be positive or negative real numbers. The origin for drawing is (0.0,0.0,0.0). For reference, the size of the host cubes drawn is 0.5 units on each side (text takes a little more space). The coordinates you specify here are used as the center of the host cube.
It is possible to use a host definition as a template for other host configurations. If this definition should be used as template, a generic template name must be defined.
\r\n
We do not recommend to do this - it is more open to define a separate host template than to use this option.
This directive is used to specify a common config name for a group of service definitions. This is a NagiosQL parameter and it will not be written to the configuration file. Every service definitions with the same configuration name will stored in one file. The configuration name is also the file name of this configuration set.
This directive is used to specify the short name(s) of the hostgroup(s) that the service "runs" on or is associated with. The hostgroup_name may be used instead of, or in addition to, the host_name directive.
\r\n
Parameter name: hostgroup_name Required: no (yes, if no host is defined)
This directive is used to define the description of the service, which may contain spaces, dashes, and colons (semicolons, apostrophes, and quotation marks should be avoided). No two services associated with the same host can have the same description. Services are uniquely identified with their host_name and service_description directives.
This directive is used to identify the short name(s) of the servicegroup(s) that the service belongs to. Multiple servicegroups should be separated by commas. This directive may be used as an alternative to using the members directive in servicegroup definitions.
\r\n
NagiosQL: If a servicegroup is defined here - this service will not be selected inside the member field of the same servicegroup definition!
This directive is used to define an alternate name that should be displayed in the web interface for this service. If not specified, this defaults to the value you specify for the service_description directive. Note: The current CGIs do not use this option, although future versions of the web interface will.
This directive is used to specify the short name of the command that Nagios will run in order to check the status of the service. The maximum amount of time that the service check command can run is controlled by the service_check_timeout option.
The values defined here will replace the according argument variable behind the selected command. Up to 8 argument variables are supported. Be sure, that you defines a valid value for each required argument variable.
By default Nagios will assume that all services are in OK states when in starts. You can override the initial state for a service by using this directive. Valid options are: o = OK, w = WARNING, u = UNKNOWN, and c = CRITICAL.
This directive is used to define the number of "time units" to wait before scheduling a re-check of the service. Services are rescheduled at the retry interval when they have changed to a non-OK state. Once the service has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" rate as defined by the check_interval value. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.
This directive is used to define the number of times that Nagios will retry the service check command if it returns any state other than an OK state. Setting this value to 1 will cause Nagios to generate an alert without retrying the service check again.
This directive is used to define the number of "time units" to wait before scheduling the next "regular" check of the service. "Regular" checks are those that occur when the service is in an OK state or when the service is in a non-OK state, but has already been rechecked max_check_attempts number of times. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.
This directive is used to determine whether or not active checks of this service are enabled. Values: 0 = disable active service checks, 1 = enable active service checks.
\r\n
Parameter name: active_checks_enabled Required: no
This directive is used to determine whether or not passive checks of this service are enabled. Values: 0 = disable passive service checks, 1 = enable passive service checks.
\r\n
Parameter name: passive_checks_enabled Required: no
This directive is used to determine whether or not the service check can be parallelized. By default, all service checks are parallelized. Disabling parallel checks of services can result in serious performance problems. More information on service check parallelization can be found in the nagios documentation.
\r\n
Values: 0 = service check cannot be parallelized (use with caution!), 1 = service check can be parallelized.
This directive is used to specify the freshness threshold (in seconds) for this service. If you set this directive to a value of 0, Nagios will determine a freshness threshold to use automatically.
This directive is used to determine whether or not freshness checks are enabled for this service. Values: 0 = disable freshness checks, 1 = enable freshness checks.
This directive is used to specify the short name of the command that should be run whenever a change in the state of the service is detected (i.e. whenever it goes down or recovers). Read the documentation on event handlers for a more detailed explanation of how to write scripts for handling events. The maximum amount of time that the event handler command can run is controlled by the event_handler_timeout option.
This directive is used to determine whether or not the event handler for this service is enabled. Values: 0 = disable service event handler, 1 = enable service event handler.
\r\n
Parameter name: event_handler_enabled Required: no
This directive is used to specify the low state change threshold used in flap detection for this service. More information on flap detection can be found in the nagios documentation. If you set this directive to a value of 0, the program-wide value specified by the low_service_flap_threshold directive will be used.
This directive is used to specify the high state change threshold used in flap detection for this service. More information on flap detection can be found in the nagios documentation. If you set this directive to a value of 0, the program-wide value specified by the high_service_flap_threshold directive will be used.
This directive is used to determine whether or not flap detection is enabled for this service. More information on flap detection can be found in the nagios documentation. Values: 0 = disable service flap detection, 1 = enable service flap detection.
\r\n
Parameter name: flap_detection_enabled Required: no
This directive is used to determine what service states the flap detection logic will use for this service. Valid options are a combination of one or more of the following: o = OK states, w = WARNING states, c = CRITICAL states, u = UNKNOWN states.
\r\n
Parameter name: flap_detection_options Required: no
This directive is used to determine whether or not status-related information about the service is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable status information retention, 1 = enable status information retention.
\r\n
Parameter name: retain_status_information Required: no
This directive is used to determine whether or not non-status information about the service is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable non-status information retention, 1 = enable non-status information retention.
\r\n
Parameter name: retain_nonstatus_information Required: no
This directive is used to determine whether or not the processing of performance data is enabled for this service. Values: 0 = disable performance data processing, 1 = enable performance data processing.
This directive is used to denote whether the service is "volatile". Services are normally not volatile. More information on volatile service and how they differ from normal services can be found in the nagios documentation. Value: 0 = service is not volatile, 1 = service is volatile.
This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this service. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each service definition.
\r\n
Parameter name: contacts Required: yes (no, if a contact group is defined)
This is a list of the short names of the contact groups that should be notified whenever there are problems (or recoveries) with this service. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each service definition.
\r\n
Parameter name: contact_groups Required: yes (no, if a contact is defined)
This directive is used to specify the short name of the time period during which notifications of events for this service can be sent out to contacts. No service notifications will be sent out during times which is not covered by the time period.
This directive is used to determine when notifications for the service should be sent out. Valid options are a combination of one or more of the following: w = send notifications on a WARNING state, u = send notifications on an UNKNOWN state, c = send notifications on a CRITICAL state, r = send notifications on recoveries (OK state), f = send notifications when the service starts and stops flapping, and s = send notifications when scheduled downtime starts and ends.
\r\n
If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states.
\r\n
Example: If you specify w,r in this field, notifications will only be sent out when the service goes into a WARNING state and when it recovers from a WARNING state.
This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still in a non-OK state. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this service - only one problem notification will be sent out.
This directive is used to define the number of "time units" to wait before sending out the first problem notification when this service enters a non-OK state. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will start sending out notifications immediately.
\r\n
Parameter name: first_notification_delay Required: no
This directive is used to determine whether or not notifications for this service are enabled. Values: 0 = disable service notifications, 1 = enable service notifications.
\r\n
Parameter name: notifications_enabled Required: no
This directive determines which service states "stalking" is enabled for. Valid options are a combination of one or more of the following: o = stalk on OK states, w = stalk on WARNING states, u = stalk on UNKNOWN states, and c = stalk on CRITICAL states.
\r\n
More information on state stalking can be found in the nagios documentation.
This directive is used to define an optional string of notes pertaining to the service. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified service).
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this service. This image will be displayed in the status and extended information CGIs. The image will look best if it is 40x40 pixels in size. Images for services are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional URL that can be used to provide more information about the service. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing service information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the service, emergency contact methods, etc. available to other support staff.
This variable is used to define an optional string that is used in the ALT tag of the image specified by the <icon_image> argument. The ALT tag is used in the status, extended information and statusmap CGIs.
This directive is used to define an optional URL that can be used to provide more actions to be performed on the service. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing service information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This is a list of the short names of hosts that should be included in this group. Multiple host names should be separated by commas. This directive may be used as an alternative to (or in addition to) the hostgroups directive in host definitions.
\r\n
NagiosQL: If you select a hostgroup inside a host definition using the hostgroups directive in host definition, this host will not be selected here because these are two different ways to specify a hostgroup!
This directive is used to define is a longer name or description used to identify the host group. It is provided in order to allow you to more easily identify a particular host group.
This directive is used to define an optional string of notes pertaining to the host. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified host).
This variable is used to define an optional URL that can be used to provide more information about the host group. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing hostgroup information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the host group, emergency contact methods, etc. available to other support staff.
This directive is used to define an optional URL that can be used to provide more actions to be performed on the host group. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing hostgroup information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This optional directive can be used to include hosts from other "sub" host groups in this host group. Specify a comma-delimited list of short names of other host groups whose members should be included in this group.
This is a list of the descriptions of services (and the names of their corresponding hosts) that should be included in this group. Host and service names should be separated by commas. This directive may be used as an alternative to the servicegroups directive in service definitions.
\r\n
NagiosQL: If you select a servicegroup inside a service definition using the servicegroups directive in service definition, this service will not be selected here because these are two different ways to specify a servicegroup!
This directive is used to define is a longer name or description used to identify the service group. It is provided in order to allow you to more easily identify a particular service group.
This directive is used to define an optional string of notes pertaining to the service group. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified service group).
This directive is used to define an optional URL that can be used to provide more information about the service group. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing service group information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the service group, emergency contact methods, etc. available to other support staff.
This directive is used to define an optional URL that can be used to provide more actions to be performed on the service group. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing service group information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This optional directive can be used to include services from other "sub" service groups in this service group. Specify a comma-delimited list of short names of other service groups whose members should be included in this group.
This directive is used to define a short name used to identify the contact. It is referenced in contact group definitions. Under the right circumstances, the $CONTACTNAME$ macro will contain this value.
This directive is used to identify the short name(s) of the contactgroup(s) that the contact belongs to. Multiple contactgroups should be separated by commas. This directive may be used as an alternative to (or in addition to) using the members directive in contactgroup definitions.
\r\n
NagiosQL: If a contactgroup is defined here - this contact will not be selected inside the member field of the same contactgroup definition!
This directive is used to define a longer name or description for the contact. Under the rights circumstances, the $CONTACTALIAS$ macro will contain this value. If not specified, the contact_name will be used as the alias.
\r\n
Parameter name: alias Required: no (yes in Nagios 2.x)
This directive is used to define an email address for the contact. Depending on how you configure your notification commands, it can be used to send out an alert email to the contact. Under the right circumstances, the $CONTACTEMAIL$ macro will contain this value.
This directive is used to define a pager number for the contact. It can also be an email address to a pager gateway (i.e. pagejoe@pagenet.com). Depending on how you configure your notification commands, it can be used to send out an alert page to the contact. Under the right circumstances, the $CONTACTPAGER$ macro will contain this value.
Address directives are used to define additional "addresses" for the contact. These addresses can be anything - cell phone numbers, instant messaging addresses, etc. Depending on how you configure your notification commands, they can be used to send out an alert o the contact. Up to six addresses can be defined using these directives (address1 through address6). The $CONTACTADDRESSx$ macro will contain this value.
\r\n
Parameter name: addressx (x as number from 1 to 6) Required: no
This directive is used to determine whether or not the contact will receive notifications about host problems and recoveries. Values: 0 = don''t send notifications, 1 = send notifications.
This directive is used to determine whether or not the contact will receive notifications about service problems and recoveries. Values: 0 = don''t send notifications, 1 = send notifications.
This directive is used to specify the short name of the time period during which the contact can be notified about host problems or recoveries. You can think of this as an "on call" time for host notifications for the contact. Read the documentation on time periods for more information on how this works and potential problems that may result from improper use.
This directive is used to specify the short name of the time period during which the contact can be notified about service problems or recoveries. You can think of this as an "on call" time for service notifications for the contact. Read the documentation on time periods for more information on how this works and potential problems that may result from improper use.
This directive is used to define the host states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: d = notify on DOWN host states, u = notify on UNREACHABLE host states, r = notify on host recoveries (UP states), and f = notify when the host starts and stops flapping. If you specify n (none) as an option, the contact will not receive any type of host notifications.
This directive is used to define the host states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: d = notify on DOWN host states, u = notify on UNREACHABLE host states, r = notify on host recoveries (UP states), f = notify when the host starts and stops flapping, and s = send notifications when host or service scheduled downtime starts and ends. If you specify n (none) as an option, the contact will not receive any type of host notifications.
This directive is used to define the service states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: w = notify on WARNING service states, u = notify on UNKNOWN service states, c = notify on CRITICAL service states, r = notify on service recoveries (OK states), and f = notify when the servuce starts and stops flapping. If you specify n (none) as an option, the contact will not receive any type of host notifications.
This directive is used to define the service states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following: w = notify on WARNING service states, u = notify on UNKNOWN service states, c = notify on CRITICAL service states, r = notify on service recoveries (OK states), and f = notify when the host starts and stops flapping, and s = send notifications when host or service scheduled downtime starts and ends. If you specify n (none) as an option, the contact will not receive any type of host notifications.
This directive is used to define a list of the short names of the commands used to notify the contact of a host problem or recovery. Multiple notification commands should be separated by commas. All notification commands are executed when the contact needs to be notified. The maximum amount of time that a notification command can run is controlled by the notification_timeout option.
This directive is used to define a list of the short names of the commands used to notify the contact of a service problem or recovery. Multiple notification commands should be separated by commas. All notification commands are executed when the contact needs to be notified. The maximum amount of time that a notification command can run is controlled by the notification_timeout option.
This directive is used to determine whether or not status-related information about the contact is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable status information retention, 1 = enable status information retention.
\r\n
Parameter name: retain_status_information Required: no
This directive is used to determine whether or not the contact can submit external commands to Nagios from the CGIs. Values: 0 = don''t allow contact to submit commands, 1 = allow contact to submit commands.
This directive is used to determine whether or not non-status information about the contact is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable non-status information retention, 1 = enable non-status information retention.
\r\n
Parameter name: retain_nonstatus_information Required: no
It is possible to use a contact definition as a template for other contact configurations. If this definition should be used as template, a generic template name must be defined.
\r\n
We do not recommend to do this - it is more open to define a separate contact template than use this option.
This directive is used to define a list of the short names of contacts that should be included in this group. Multiple contact names should be separated by commas. This directive may be used as an alternative to (or in addition to) using the contactgroups directive in contact definitions.
\r\n
NagiosQL: If you select a contactgroup inside a contact definition using the contactgroups directive in contact definition, this contact will not be selected here because these are two different ways to specify a contactgroup!
This optional directive can be used to include contacts from other "sub" contact groups in this contact group. Specify a comma-delimited list of short names of other contact groups whose members should be included in this group.
This directive is used to specify the short names of other timeperiod definitions whose time ranges should be excluded from this timeperiod. Multiple timeperiod names should be separated with a comma.
The sunday through saturday directives are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday).
\r\n
Parameter name: [weekday] [exception] Required: no
Each time range is in the form of HH:MM-HH:MM, where hours are specified on a 24 hour clock. For example, 00:15-24:00 means 12:15am in the morning for this day until 12:20am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.
\r\n
Parameter name: [weekday] [exception] Required: no
The weekday directives ("sunday" through "saturday")are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday).
\r\n
You can also specify several different types of exceptions to the standard rotating weekday schedule. Exceptions can take a number of different forms including single days of a specific or generic month, single weekdays in a month, or single calendar dates. You can also specify a range of days/dates and even specify skip intervals to obtain functionality described by "every 3 days between these dates". Rather than list all the possible formats for exception strings, Weekdays and different types of exceptions all have different levels of precedence, so its important to understand how they can affect each other. More information on this can be found in the documentation on timeperiods.
\r\n
Parameter name: [weekday] [exception] Required: no
Each time range is in the form of HH:MM-HH:MM, where hours are specified on a 24 hour clock. For example, 00:15-24:00 means 12:15am in the morning for this day until 12:00am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.
\r\n
Parameter name: [weekday] [exception] Required: no
This directive is the short name used to identify the command. It is referenced in contact, host, and service definitions (in notification, check, and event handler directives), among other places.
This directive is used to define what is actually executed by Nagios when the command is used for service or host checks, notifications, or event handlers. Before the command line is executed, all valid macros are replaced with their respective values. See the documentation on macros for determining when you can use different macros. Note that the command line is not surrounded in quotes. Also, if you want to pass a dollar sign ($) on the command line, you have to escape it with another dollar sign.
\r\n
NOTE: You may not include a semicolon (;) in the command_line directive, because everything after it will be ignored as a config file comment. You can work around this limitation by setting one of the $USER$ macros in your resource file to a semicolon and then referencing the appropriate $USER$ macro in the command_line directive in place of the semicolon.
\r\n
If you want to pass arguments to commands during runtime, you can use $ARGn$ macros in the command_line directive of the command definition and then separate individual arguments from the command name (and from each other) using bang (!) characters in the object definition directive (host check command, service event handler command, etc) that references the command. More information on how arguments in command definitions are processed during runtime can be found in the documentation on macros.
This directive is used to identify the short name(s) of the dependenthostgroup(s). Multiple hostgroups should be separated by commas. The dependent_hostgroup_name may be used instead of, or in addition to, the dependent_host_name directive.
\r\n
Parameter name: dependent_hostgroup_name Required: no (yes, if no dependent host is defined)
This directive is used to identify the short name(s) of the host(s) that is being depended upon (also referred to as the master host). Multiple hosts should be separated by commas.
\r\n
Parameter name: host_name Required: yes (no, if a hostgroup is defined)
This directive is used to identify the short name(s) of the host(s) that is being depended upon (also referred to as the master host). Multiple hosts should be separated by commas.
\r\n
Parameter name: hostgroup_name Required: no (yes, if a no host is defined)
This directive is used to specify a common config name for a hostdependency configration. This is a NagiosQL parameter and it will not be written to the configuration file.
This directive indicates whether or not the dependency inherits dependencies of the host that is being depended upon (also referred to as the master host). In other words, if the master host is dependent upon other hosts and any one of those dependencies fail, this dependency will also fail.
This directive is used to specify the short name of the time period during which this dependency is valid. If this directive is not specified, the dependency is considered to be valid during all times.
This directive is used to specify the criteria that determine when the dependent host should not be actively checked. If the master host is in one of the failure states we specify, the dependent host will not be actively checked. Valid options are a combination of one or more of the following (multiple options are separated with commas): o = fail on an UP state, d = fail on a DOWN state, u = fail on an UNREACHABLE state, and p = fail on a pending state (e.g. the host has not yet been checked).
\r\n
If you specify n (none) as an option, the execution dependency will never fail and the dependent host will always be actively checked (if other conditions allow for it to be).
\r\n
Example: If you specify u,d in this field, the dependent host will not be actively checked if the master host is in either an UNREACHABLE or DOWN state.
\r\n
Parameter name: execution_failure_criteria Required: no
This directive is used to define the criteria that determine when notifications for the dependent host should not be sent out. If the master host is in one of the failure states we specify, notifications for the dependent host will not be sent to contacts. Valid options are a combination of one or more of the following: o = fail on an UP state, d = fail on a DOWN state, u = fail on an UNREACHABLE state, and p = fail on a pending state (e.g. the host has not yet been checked).
\r\n
If you specify n (none) as an option, the notification dependency will never fail and notifications for the dependent host will always be sent out.
\r\n
Example: If you specify d in this field, the notifications for the dependent host will not be sent out if the master host is in a DOWN state.
\r\n
Parameter name: notification_failure_criteria Required: no
This directive is used to identify the short name(s) of the hostgroup(s) that the escalation should apply to. Multiple hostgroups should be separated by commas. If this is used, the escalation will apply to all hosts that are members of the specified hostgroup(s).
\r\n
Parameter name: hostgroup_name Required: no (yes, if no host ist defined)
This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this host. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each host escalation definition.
\r\n
Parameter name: contacts Required: yes (no, if a contactgroup is defined)
This directive is used to identify the short name of the contact group that should be notified when the host notification is escalated. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each host escalation definition.
\r\n
Parameter name: contact_groups Required: yes (no, if a contact is defined)
This directive is used to specify a common config name for a hostescalation configration. This is a NagiosQL parameter and it will not be written to the configuration file.
This directive is used to specify the short name of the time period during which this escalation is valid. If this directive is not specified, the escalation is considered to be valid during all times.
This directive is used to define the criteria that determine when this host escalation is used. The escalation is used only if the host is in one of the states specified in this directive. If this directive is not specified in a host escalation, the escalation is considered to be valid during all host states. Valid options are a combination of one or more of the following: r = escalate on an UP (recovery) state, d = escalate on a DOWN state, and u = escalate on an UNREACHABLE state.
\r\n
Example: If you specify d in this field, the escalation will only be used if the host is in a DOWN state.
This directive is a number that identifies the first notification for which this escalation is effective. For instance, if you set this value to 3, this escalation will only be used if the host is down or unreachable long enough for a third notification to go out.
This directive is a number that identifies the last notification for which this escalation is effective. For instance, if you set this value to 5, this escalation will not be used if more than five notifications are sent out for the host. Setting this value to 0 means to keep using this escalation entry forever (no matter how many notifications go out).
This directive is used to determine the interval at which notifications should be made while this escalation is valid. If you specify a value of 0 for the interval, Nagios will send the first notification when this escalation definition is valid, but will then prevent any more problem notifications from being sent out for the host. Notifications are sent out again until the host recovers.
\r\n
This is useful if you want to stop having notifications sent out after a certain amount of time. Note: If multiple escalation entries for a host overlap for one or more notification ranges, the smallest notification interval from all escalation entries is used.
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be displayed in the status and extended information CGIs. The image will look best if it is 40x40 pixels in size.
\r\n
Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional string of notes pertaining to the host. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified host).
This variable is used to define an optional string that is used in the ALT tag of the image specified by the <icon_image> argument. The ALT tag is used in the status, extended information and statusmap CGIs.
This variable is used to define an optional URL that can be used to provide more information about the host. If you specify an URL, you will see a link that says "Extra Host Notes" in the extended information CGI (when you are viewing information about the specified host). Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the host, emergency contact methods, etc. available to other support staff.
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be used as the texture map for the specified host in the statuswrl CGI. Unlike the image you use for the icon_image variable, this one should probably not have any transparency. If it does, the host object will look a bit wierd.
\r\n
Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional URL that can be used to provide more actions to be performed on the host. If you specify an URL, you will see a link that says "Extra Host Actions" in the extended information CGI (when you are viewing information about the specified host). Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This variable is used to define the name of an image that should be associated with this host in the statusmap CGI. You can specify a JPEG, PNG, and GIF image if you want, although I would strongly suggest using a GD2 format image, as other image formats will result in a lot of wasted CPU time when the statusmap image is generated.
\r\n
GD2 images can be created from PNG images by using the pngtogd2 utility supplied with Thomas Boutell''s gd library. The GD2 images should be created in uncompressed format in order to minimize CPU load when the statusmap CGI is generating the network map image.
\r\n
The image will look best if it is 40x40 pixels in size. You can leave these option blank if you are not using the statusmap CGI. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This variable is used to define coordinates to use when drawing the host in the statusmap CGI. Coordinates should be given in positive integers, as they correspond to physical pixels in the generated image. The origin for drawing (0,0) is in the upper left hand corner of the image and extends in the positive x direction (to the right) along the top of the image and in the positive y direction (down) along the left hand side of the image. For reference, the size of the icons drawn is usually about 40x40 pixels (text takes a little extra space). The coordinates you specify here are for the upper left hand corner of the host icon that is drawn.
\r\n
Note: Don''t worry about what the maximum x and y coordinates that you can use are. The CGI will automatically calculate the maximum dimensions of the image it creates based on the largest x and y coordinates you specify.
This variable is used to define coordinates to use when drawing the host in the statuswrl CGI. Coordinates can be positive or negative real numbers. The origin for drawing is (0.0,0.0,0.0). For reference, the size of the host cubes drawn is 0.5 units on each side (text takes a little more space). The coordinates you specify here are used as the center of the host cube.
This directive is used to specify the short name(s) of the hostgroup(s) that the service escalation should apply to or is associated with. Multiple hostgroups should be separated by commas. The hostgroup_name may be used instead of, or in addition to, the host_name directive.
\r\n
Parameter name: hostgroup_name Required: yes (no, if a host name is defined)
This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this service. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each service escalation definition.
\r\n
Parameter name: contacts Required: yes (no, if a contact group is defined)
This directive is used to identify the short name of the contact group that should be notified when the service notification is escalated. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each service escalation definition.
\r\n
Parameter name: contact_groups Required: yes (no, if a contact is defined)
This directive is used to specify a common config name for a serviceescalation configration. This is a NagiosQL parameter and it will not be written to the configuration file.
This directive is a number that identifies the first notification for which this escalation is effective. For instance, if you set this value to 3, this escalation will only be used if the service is in a non-OK state long enough for a third notification to go out.
This directive is a number that identifies the last notification for which this escalation is effective. For instance, if you set this value to 5, this escalation will not be used if more than five notifications are sent out for the service. Setting this value to 0 means to keep using this escalation entry forever (no matter how many notifications go out).
This directive is used to determine the interval at which notifications should be made while this escalation is valid. If you specify a value of 0 for the interval, Nagios will send the first notification when this escalation definition is valid, but will then prevent any more problem notifications from being sent out for the host. Notifications are sent out again until the host recovers.
\r\n
This is useful if you want to stop having notifications sent out after a certain amount of time. Note: If multiple escalation entries for a host overlap for one or more notification ranges, the smallest notification interval from all escalation entries is used.
This directive is used to specify the short name of the time period during which this escalation is valid. If this directive is not specified, the escalation is considered to be valid during all times.
This directive is used to define the criteria that determine when this service escalation is used. The escalation is used only if the service is in one of the states specified in this directive. If this directive is not specified in a service escalation, the escalation is considered to be valid during all service states. Valid options are a combination of one or more of the following: r = escalate on an OK (recovery) state, w = escalate on a WARNING state, u = escalate on an UNKNOWN state, and c = escalate on a CRITICAL state.
\r\n
Example: If you specify w in this field, the escalation will only be used if the service is in a WARNING state.
This directive is used to identify the short name(s) of the host(s) that the dependent service "runs" on or is associated with. Multiple hosts should be separated by commas. Leaving this directive blank can be used to create "same host" dependencies.
\r\n
Parameter name: dependent_host Required: yes (no, if a dependent hostgroup is defined)
This directive is used to identify the short name(s) of the host(s) that the service that is being depended upon (also referred to as the master service) "runs" on or is associated with. Multiple hosts should be separated by commas.
\r\n
Parameter name: host_name Required: yes (no, if a hostgroup is defined)
This directive is used to specify the short name(s) of the hostgroup(s) that the dependent service "runs" on or is associated with. Multiple hostgroups should be separated by commas. The dependent_hostgroup may be used instead of, or in addition to, the dependent_host directive.
\r\n
Parameter name: dependent_hostgroup Required: yes (no, if a dependent host is defined)
This directive is used to identify the short name(s) of the hostgroup(s) that the service that is being depended upon (also referred to as the master service) "runs" on or is associated with. Multiple hostgroups should be separated by commas. The hostgroup_name may be used instead of, or in addition to, the host_name directive.
\r\n
Parameter name: hostgroup_name Required: yes (no, if a host is defined)
This directive is used to specify a common config name for a servicedependency configration. This is a NagiosQL parameter and it will not be written to the configuration file.
This directive indicates whether or not the dependency inherits dependencies of the service that is being depended upon (also referred to as the master service). In other words, if the master service is dependent upon other services and any one of those dependencies fail, this dependency will also fail.
This directive is used to specify the short name of the time period during which this dependency is valid. If this directive is not specified, the dependency is considered to be valid during all times.
This directive is used to specify the criteria that determine when the dependent service should not be actively checked. If the master service is in one of the failure states we specify, the dependent service will not be actively checked. Valid options are a combination of one or more of the following (multiple options are separated with commas): o = fail on an OK state, w = fail on a WARNING state, u = fail on an UNKNOWN state, c = fail on a CRITICAL state, and p = fail on a pending state (e.g. the service has not yet been checked). If you specify n (none) as an option, the execution dependency will never fail and checks of the dependent service will always be actively checked (if other conditions allow for it to be).
\r\n
Example: If you specify o,c,u in this field, the dependent service will not be actively checked if the master service is in either an OK, a CRITICAL, or an UNKNOWN state.
\r\n
Parameter name: execution_failure_criteria Required: no
This directive is used to define the criteria that determine when notifications for the dependent service should not be sent out. If the master service is in one of the failure states we specify, notifications for the dependent service will not be sent to contacts. Valid options are a combination of one or more of the following: o = fail on an OK state, w = fail on a WARNING state, u = fail on an UNKNOWN state, c = fail on a CRITICAL state, and p = fail on a pending state (e.g. the service has not yet been checked). If you specify n (none) as an option, the notification dependency will never fail and notifications for the dependent service will always be sent out.
\r\n
Example: If you specify w in this field, the notifications for the dependent service will not be sent out if the master service is in a WARNING state.
\r\n
Parameter name: notification_failure_criteria Required: no
This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be displayed in the status and extended information CGIs.
\r\n
The image will look best if it is 40x40 pixels in size. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
This directive is used to define an optional string of notes pertaining to the service. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified service).
This directive is used to define an optional URL that can be used to provide more actions to be performed on the service. If you specify an URL, you will see a link that says "Extra Service Actions" in the extended information CGI (when you are viewing information about the specified service). Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).
This directive is used to define an optional URL that can be used to provide more information about the service. If you specify an URL, you will see a link that says "Extra Service Notes" in the extended information CGI (when you are viewing information about the specified service). Any valid URL can be used.
\r\n
If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the service, emergency contact methods, etc. available to other support staff.
This variable is used to define an optional string that is used in the ALT tag of the image specified by the <icon_image> argument. The ALT tag is used in the status, extended information and statusmap CGIs.
Its just a "template" name that can be referenced in other object definitions so they can inherit the objects properties/variables. Template names must be unique amongst objects of the same type, so you can''t have two or more time definitions that have "mytemplate" as their template name.
This directive is used to specify the short names (template names) of other timeperiod definitions whose time ranges should be included to this timeperiod. Multiple timeperiod names should be separated with a comma.
If this option is selected, the specified user is able to modify the access group for every object definition. This should be restricted only to administrators; otherwise a user might be able to lock himself out.
READ = The user can see the objects belong to this group WRITE = The user can modify the objects belong to this group LINK = The user can use the objects belong to this group to link them in other objects*
* Example: If a time object belongs to this group - the user can add (link) this time object to his contact objects.
This option is used to enable or disable the global common domain functionality.
\r\n
If this option is enabled, all objects from the global common domain will be added to this domains configuration files. The global common domain can be used to define objects like timeperiods or contacts that are used in all domains the same.
If this option is enabled, UTF8 data from database will be translated to ISO in configuration file. So, the configuration files will be in ISO mode. This could be helpful, if nagios does not understand the UTF8 data from NagiosQL.
This path is based on your nagios standard image path. Images are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).
\r\n
So in the example above, the images are located in:
This variable is used to indicate whether or not the object definition should be "registered" with Nagios. By default, all object definitions are registered. If you are using a partial object definition as a template, you would want to prevent it from being registered (an example of this is provided later). Values are as follows: 0 = do NOT register object definition, 1 = register object definition (this is the default). This variable is NOT inherited; every (partial) object definition used as a template must explicitly set the register directive to be 0. This prevents the need to override an inherited register directive with a value of 1 for every object that should be registered.
Select a configuration domain which is assigned to this data domain
\r\n
The settings where to store the configuration files are defined in a configuration domain. Select here the desired target for your configuration files.
');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(240, 'domain', 'ssh_host_key', 'all', 'default', 'Absolute path to the ssh key directory for the defined ssh user.
This directory includes the key file (id_rsa) for the user to connect to the remote system. Note, that the file name is set to id_rsa!');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(241, 'contact', 'minimum_importance', 'all', 'default', '
Contact - minimum importance
\r\n
This directive is used as the value that the host or service importance value must equal before notification is sent to this contact. The importance values are intended to represent the value of a host or service to an organization. For example, you could set this value and the importance value of a host such that a system administrator would be notified when a development server goes down, but the CIO would only be notified when the company\'s production ecommerce database server was down. The minimum_importance value defaults to zero.
\r\n
In Nagios Core 4.0.0 to 4.0.3 this was known as minimum_value but has been replaced with minimum_importance.
\r\n
Parameter name: minimum_importance Required: no
');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(242, 'domain', 'ftps_option', 'all', 'default', 'Use encrypted FTP (FTPS) to connect to the remote server. ');
+INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(243, 'domain', 'cgifile', 'all', 'default', '
This directive is used to represent the importance of the host to your organization. The importance is used when determining whether to send notifications to a contact. If the host\'s importance value plus the importance values of all of the host\'s services is greater than or equal to the contact\'s minimum_importance, the contact will be notified. For example, you could set this value and the minimum_importance of contacts such that a system administrator would be notified when a development server goes down, but the CIO would only be notified when the company\'s production ecommerce database server was down. The importance could also be used as a sort criteria when generating reports or for calculating a good system administrator\'s bonus. The importance value defaults to zero. In Nagios Core 4.0.0 to 4.0.3 this was known as hourly_value but has been replaced with importance.
This directive is used to represent the importance of the service to your organization. The importance is used when determining whether to send notifications to a contact. If the service\'s importance value is greater than or equal to the contact\'s minimum_importance, the contact will be notified. For example, you could set this value and the minimum_importance of contacts such that a system administrator would be notified of a disk full event on a development server, but the CIO would only be notified when the company\'s production ecommerce database was down. The importance could also be used as a sort criteria when generating reports or for calculating a good system administrator\'s bonus. The importance value defaults to zero. In Nagios Core 4.0.0 to 4.0.3 this was known as hourly_value but has been replaced with importance.
This directive is used to define a comma-delimited list of short names of the \"parent\" services for this particular service. Parent services are typically other services that need to be available in order for a check of this service to occur. For example, if a service checks the status of a disk using SSH, the disk check service would have the SSH service as a parent. If the service has no parent services, simply omit the \"parents\" directive. More complex service dependencies may be specified with service dependency objects.
\n";
- $arrTemplate['MESSAGE'] .= $myInstClass->translate('Read the INSTALLATION file in the NagiosQL doc directory '
+if ($intError !== 0) {
+ $arrTemplate['MESSAGE'] = '' . $myInstClass->translate('There are some errors - please '
+ . 'check your system settings and read the requirements of NagiosQL!') . "
\n";
+ $arrTemplate['MESSAGE'] .= $myInstClass->translate('Read the INSTALLATION file in the NagiosQL doc directory '
. 'or the installation PDF file on our');
- $arrTemplate['MESSAGE'] .= ' ';
- $arrTemplate['MESSAGE'] .= $myInstClass->translate('online documentation'). ' ' .
- $myInstClass->translate('site to find out, how to fix them.') ." \n";
- $arrTemplate['MESSAGE'] .= $myInstClass->translate('After that - refresh this page to proceed') ."... \n";
- $arrTemplate['DIV_ID'] = 'install-center';
- $arrTemplate['FORM_CONTENT'] = 'translate('online documentation') . ' ' .
+ $myInstClass->translate('site to find out, how to fix them.') . " \n";
+ $arrTemplate['MESSAGE'] .= $myInstClass->translate('After that - refresh this page to proceed') . "... \n";
+ $arrTemplate['DIV_ID'] = 'install-center';
+ $arrTemplate['FORM_CONTENT'] = ' ';
- $arrTemplate['FORM_CONTENT'] .= $myInstClass->translate('Refresh')."\n";
+ $arrTemplate['FORM_CONTENT'] .= $myInstClass->translate('Refresh') . "\n";
} else {
- $arrTemplate['MESSAGE'] = '' .$myInstClass->translate('Environment test completed '
- . 'successfully')."
\ No newline at end of file
+
\ No newline at end of file
diff --git a/install/templates/step2.htm.tpl b/install/templates/step2.htm.tpl
index 542c6a4..9750466 100644
--- a/install/templates/step2.htm.tpl
+++ b/install/templates/step2.htm.tpl
@@ -1,9 +1,9 @@
-
+
-
+
+
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/install/templates/step3.htm.tpl b/install/templates/step3.htm.tpl
index a768db0..ef21f6a 100644
--- a/install/templates/step3.htm.tpl
+++ b/install/templates/step3.htm.tpl
@@ -1,9 +1,9 @@
-
+
-
+
@@ -14,7 +14,7 @@
-
{STEP3_TITLE}
+
{STEP3_TITLE}
-
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/libraries/pear/HTML/Template/IT.php b/libraries/pear/HTML/Template/IT.php
index a48faeb..ae78cc7 100644
--- a/libraries/pear/HTML/Template/IT.php
+++ b/libraries/pear/HTML/Template/IT.php
@@ -11,7 +11,7 @@
* with this package in the file LICENSE, and is available through
* the world-wide-web at
* http://www.opensource.org/licenses/bsd-license.php
- * If you did not receive a copy of the new BSDlicense and are unable
+ * If you did not receive a copy of the new BSD license and are unable
* to obtain it through the world-wide-web, please send a note to
* pajoye@php.net so we can mail you a copy immediately.
*
@@ -23,13 +23,12 @@
* @package HTML_Template_IT
* @author Ulf Wendel
* @license BSD http://www.opensource.org/licenses/bsd-license.php
- * @version CVS: $Id: IT.php 3 2017-06-22 07:32:17Z martin $
+ * @version CVS: $Id$
* @link http://pear.php.net/packages/HTML_Template_IT
* @access public
*/
require_once 'PEAR.php';
-$myPEAR = new PEAR();
define('IT_OK', 1);
define('IT_ERROR', -1);
@@ -49,7 +48,7 @@ define('IT_UNKNOWN_OPTION', -6);
* one you can build. template::parse() [phplib template = Isotemplate] requests
* you to name a source and a target where the current block gets parsed into.
* Source and target can be block names or even handler names. This API gives you
- * a maximum of fexibility but you always have to know what you do which is
+ * a maximum of flexibility but you always have to know what you do which is
* quite unusual for php skripter like me.
*
* I noticed that I do not any control on which block gets parsed into which one.
@@ -148,7 +147,6 @@ class HTML_Template_IT
/**
* Clear cache on get()?
-
* @var boolean
* @acces public
*/
@@ -279,9 +277,9 @@ class HTML_Template_IT
* should be preserved although they are empty (no placeholder replaced).
* Think of a shopping basket. If it's empty you have to drop a message to
* the user. If it's filled you have to show the contents of
- * the shopping baseket. Now where do you place the message that the basket
+ * the shopping basket. Now where do you place the message that the basket
* is empty? It's no good idea to place it in you applications as customers
- * tend to like unecessary minor text changes. Having another template file
+ * tend to like unnecessary minor text changes. Having another template file
* for an empty basket means that it's very likely that one fine day
* the filled and empty basket templates have different layout. I decided
* to introduce blocks that to not contain any placeholder but only
@@ -289,7 +287,7 @@ class HTML_Template_IT
*
* Now if there is no replacement done in such a block the block will
* be recognized as "empty" and by default ($removeEmptyBlocks = true) be
- * stripped off. To avoid thisyou can now call touchBlock() to avoid this.
+ * stripped off. To avoid this you can now call touchBlock() to avoid this.
*
* The array $touchedBlocks stores a list of touched block which must not
* be removed even if they are empty.
@@ -298,15 +296,7 @@ class HTML_Template_IT
* @see touchBlock(), $removeEmptyBlocks
* @access private
*/
- var $touchedBlocks = array();
-
- /**
- * List of blocks which should not be shown even if not "empty"
- * @var array $_hiddenBlocks
- * @see hideBlock(), $removeEmptyBlocks
- * @access private
- */
- var $_hiddenBlocks = array();
+ var $touchedBlocks = array();
/**
* Variable cache.
@@ -395,7 +385,7 @@ class HTML_Template_IT
);
/**
- * Builds some complex regular expressions and optinally sets the
+ * Builds some complex regular expressions and optionally sets the
* file root directory.
*
* Make sure that you call this constructor if you derive your template
@@ -415,15 +405,15 @@ class HTML_Template_IT
}
$this->variablesRegExp = '@' . $this->openingDelimiter .
- '(' . $this->variablenameRegExp . ')' .
- $this->closingDelimiter . '@sm';
+ '(' . $this->variablenameRegExp . ')' .
+ $this->closingDelimiter . '@sm';
$this->removeVariablesRegExp = '@' . $this->openingDelimiter .
- "\s*(" . $this->variablenameRegExp .
- ")\s*" . $this->closingDelimiter .'@sm';
+ "\s*(" . $this->variablenameRegExp .
+ ")\s*" . $this->closingDelimiter .'@sm';
$this->blockRegExp = '@(.*)@sm';
+ ')\s+-->(.*)@sm';
$this->setRoot($root);
} // end constructor
@@ -440,8 +430,7 @@ class HTML_Template_IT
*/
function setOption($option, $value)
{
- global $myPEAR;
- switch ($option) {
+ switch ($option) {
case 'removeEmptyBlocks':
$this->removeEmptyBlocks = $value;
return IT_OK;
@@ -452,7 +441,7 @@ class HTML_Template_IT
return IT_OK;
}
- return $myPEAR->raiseError(
+ return PEAR::raiseError(
$this->errorMessage(IT_UNKNOWN_OPTION) . ": '{$option}'",
IT_UNKNOWN_OPTION
);
@@ -472,12 +461,10 @@ class HTML_Template_IT
*/
function setOptions($options)
{
- global $myPEAR;
if (is_array($options)) {
foreach ($options as $option => $value) {
$error = $this->setOption($option, $value);
- if ($myPEAR->isError($error)) {
-
+ if (PEAR::isError($error)) {
return $error;
}
}
@@ -512,13 +499,12 @@ class HTML_Template_IT
*/
function get($block = '__global__')
{
- global $myPEAR;
- if ($block == '__global__' && !$this->flagGlobalParsed) {
+ if ($block == '__global__' && !$this->flagGlobalParsed) {
$this->parse('__global__');
}
if (!isset($this->blocklist[$block])) {
- $this->err[] = $myPEAR->raiseError(
+ $this->err[] = PEAR::raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'",
IT_BLOCK_NOT_FOUND
);
@@ -562,11 +548,10 @@ class HTML_Template_IT
*/
function parse($block = '__global__', $flag_recursion = false)
{
- global $myPEAR;
- static $regs, $values;
+ static $regs, $values;
if (!isset($this->blocklist[$block])) {
- return $myPEAR->raiseError(
+ return PEAR::raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'",
IT_BLOCK_NOT_FOUND
);
@@ -587,7 +572,7 @@ class HTML_Template_IT
if ($this->clearCacheOnParse) {
foreach ($this->variableCache as $name => $value) {
$regs[] = $this->openingDelimiter .
- $name . $this->closingDelimiter;
+ $name . $this->closingDelimiter;
$values[] = $value;
@@ -601,7 +586,7 @@ class HTML_Template_IT
if (isset($this->variableCache[$allowedvar])) {
$regs[] = $this->openingDelimiter .
- $allowedvar . $this->closingDelimiter;
+ $allowedvar . $this->closingDelimiter;
$values[] = $this->variableCache[$allowedvar];
unset($this->variableCache[$allowedvar]);
@@ -622,7 +607,7 @@ class HTML_Template_IT
}
$placeholder = $this->openingDelimiter . "__" .
- $innerblock . "__" . $this->closingDelimiter;
+ $innerblock . "__" . $this->closingDelimiter;
$outer = str_replace(
$placeholder,
@@ -754,7 +739,7 @@ class HTML_Template_IT
/**
* Sets a variable value.
*
- * The function can be used eighter like setVariable( "varname", "value")
+ * The function can be used either like setVariable( "varname", "value")
* or with one array $variables["varname"] = "value"
* given setVariable($variables) quite like phplib templates set_var().
*
@@ -791,9 +776,9 @@ class HTML_Template_IT
*/
function setCurrentBlock($block = '__global__')
{
- global $myPEAR;
+
if (!isset($this->blocklist[$block])) {
- return $myPEAR->raiseError(
+ return PEAR::raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND)
. '"' . $block . "'",
IT_BLOCK_NOT_FOUND
@@ -817,9 +802,8 @@ class HTML_Template_IT
*/
function touchBlock($block)
{
- global $myPEAR;
- if (!isset($this->blocklist[$block])) {
- return $myPEAR->raiseError(
+ if (!isset($this->blocklist[$block])) {
+ return PEAR::raiseError(
$this->errorMessage(IT_BLOCK_NOT_FOUND) . '"' . $block . "'",
IT_BLOCK_NOT_FOUND
);
@@ -876,7 +860,7 @@ class HTML_Template_IT
/**
* Sets the template.
*
- * You can eighter load a template file from disk with
+ * You can either load a template file from disk with
* LoadTemplatefile() or set the template manually using this function.
*
* @param string $template template content
@@ -888,8 +872,8 @@ class HTML_Template_IT
* @return boolean
*/
function setTemplate( $template,
- $removeUnknownVariables = true,
- $removeEmptyBlocks = true) {
+ $removeUnknownVariables = true,
+ $removeEmptyBlocks = true) {
$this->removeUnknownVariables = $removeUnknownVariables;
$this->removeEmptyBlocks = $removeEmptyBlocks;
@@ -901,7 +885,7 @@ class HTML_Template_IT
$this->currentBlock = '__global__';
} else {
$this->template = '' . $template .
- '';
+ '';
$this->init();
}
@@ -925,8 +909,8 @@ class HTML_Template_IT
* $removeEmptyBlocks
*/
function loadTemplatefile( $filename,
- $removeUnknownVariables = true,
- $removeEmptyBlocks = true ) {;
+ $removeUnknownVariables = true,
+ $removeEmptyBlocks = true ) {;
$template = '';
if (!$this->flagCacheTemplatefile
|| $this->lastTemplatefile != $filename
@@ -936,9 +920,9 @@ class HTML_Template_IT
$this->lastTemplatefile = $filename;
return $template != '' ?
- $this->setTemplate(
- $template,
- $removeUnknownVariables,
+ $this->setTemplate(
+ $template,
+ $removeUnknownVariables,
$removeEmptyBlocks) : false;
} // end func LoadTemplatefile
@@ -999,7 +983,7 @@ class HTML_Template_IT
foreach ($this->blockvariables['__global__'] as $allowedvar => $v) {
if (isset($this->variableCache[$allowedvar])) {
$regs[] = '@' . $this->openingDelimiter .
- $allowedvar . $this->closingDelimiter . '@';
+ $allowedvar . $this->closingDelimiter . '@';
$values[] = $this->variableCache[$allowedvar];
unset($this->variableCache[$allowedvar]);
}
@@ -1009,7 +993,7 @@ class HTML_Template_IT
} // end func getGlobalvariables
/**
- * Recusively builds a list of all blocks within the template.
+ * Recursively builds a list of all blocks within the template.
*
* @param string $string string that gets scanned
*
@@ -1019,8 +1003,7 @@ class HTML_Template_IT
*/
function findBlocks($string)
{
- global $myPEAR;
- $blocklist = array();
+ $blocklist = array();
if (preg_match_all($this->blockRegExp, $string, $regs, PREG_SET_ORDER)) {
foreach ($regs as $k => $match) {
@@ -1030,7 +1013,7 @@ class HTML_Template_IT
if (isset($this->blocklist[$blockname])) {
$msg = $this->errorMessage(IT_BLOCK_DUPLICATE, $blockname);
- $this->err[] = $myPEAR->raiseError($msg, IT_BLOCK_DUPLICATE);
+ $this->err[] = PEAR::raiseError($msg, IT_BLOCK_DUPLICATE);
$this->flagBlocktrouble = true;
}
@@ -1073,15 +1056,14 @@ class HTML_Template_IT
*/
function getFile($filename)
{
- global $myPEAR;
- if ($filename{0} == '/' && substr($this->fileRoot, -1) == '/') {
+ if ($filename[0] == '/' && substr($this->fileRoot, -1) == '/') {
$filename = substr($filename, 1);
}
$filename = $this->fileRoot . $filename;
if (!($fh = @fopen($filename, 'r'))) {
- $this->err[] = $myPEAR->raiseError(
+ $this->err[] = PEAR::raiseError(
$this->errorMessage(IT_TPL_NOT_FOUND) . ': "' .$filename .'"',
IT_TPL_NOT_FOUND
);
@@ -1097,10 +1079,9 @@ class HTML_Template_IT
$content = fread($fh, $fsize);
fclose($fh);
- // "##ime", wma/PEAR error
- return preg_replace(
+ return preg_replace_callback(
"##im",
- "\$this->getFile('\\1')",
+ function ($m) { return $this->getFile($m[1]); },
$content
);
} // end func getFile
@@ -1148,13 +1129,13 @@ class HTML_Template_IT
function _preserveOpeningDelimiter($str)
{
return (false === strpos($str, $this->openingDelimiter))?
- $str:
- str_replace(
- $this->openingDelimiter,
- $this->openingDelimiter .
- '%preserved%' . $this->closingDelimiter,
- $str
- );
+ $str:
+ str_replace(
+ $this->openingDelimiter,
+ $this->openingDelimiter .
+ '%preserved%' . $this->closingDelimiter,
+ $str
+ );
}
/**
@@ -1169,8 +1150,7 @@ class HTML_Template_IT
*/
function errorMessage($value, $blockname = '')
{
- global $myPEAR;
- static $errorMessages;
+ static $errorMessages;
if (!isset($errorMessages)) {
$errorMessages = array(
IT_OK => '',
@@ -1178,20 +1158,19 @@ class HTML_Template_IT
IT_TPL_NOT_FOUND => 'Cannot read the template file',
IT_BLOCK_NOT_FOUND => 'Cannot find this block',
IT_BLOCK_DUPLICATE => 'The name of a block must be'.
- ' uniquewithin a template.'.
- ' Found "' . $blockname . '" twice.'.
- 'Unpredictable results '.
- 'may appear.',
+ ' uniquewithin a template.'.
+ ' Found "' . $blockname . '" twice.'.
+ 'Unpredictable results '.
+ 'may appear.',
IT_UNKNOWN_OPTION => 'Unknown option'
);
}
- if ($myPEAR->isError($value)) {
+ if (PEAR::isError($value)) {
$value = $value->getCode();
}
return isset($errorMessages[$value]) ?
- $errorMessages[$value] : $errorMessages[IT_ERROR];
+ $errorMessages[$value] : $errorMessages[IT_ERROR];
}
-} // end class IntegratedTemplate
-?>
+} // end class IntegratedTemplate
\ No newline at end of file
diff --git a/libraries/pear/HTML/Template/ITX.php b/libraries/pear/HTML/Template/ITX.php
index 4753b78..211e87d 100644
--- a/libraries/pear/HTML/Template/ITX.php
+++ b/libraries/pear/HTML/Template/ITX.php
@@ -11,7 +11,7 @@
* with this package in the file LICENSE, and is available through
* the world-wide-web at
* http://www.opensource.org/licenses/bsd-license.php
- * If you did not receive a copy of the new BSDlicense and are unable
+ * If you did not receive a copy of the new BSD license and are unable
* to obtain it through the world-wide-web, please send a note to
* pajoye@php.net so we can mail you a copy immediately.
*
@@ -23,7 +23,7 @@
* @package HTML_Template_IT
* @author Ulf Wendel
* @license BSD http://www.opensource.org/licenses/bsd-license.php
- * @version CVS: $Id: ITX.php 3 2017-06-22 07:32:17Z martin $
+ * @version CVS: $Id$
* @link http://pear.php.net/packages/HTML_Template_IT
* @access public
*/
@@ -32,24 +32,24 @@ require_once 'HTML/Template/IT.php';
require_once 'HTML/Template/IT_Error.php';
/**
-* Integrated Template Extension - ITX
-*
-* With this class you get the full power of the phplib template class.
-* You may have one file with blocks in it but you have as well one main file
-* and multiple files one for each block. This is quite usefull when you have
-* user configurable websites. Using blocks not in the main template allows
-* you to modify some parts of your layout easily.
-*
-* Note that you can replace an existing block and add new blocks at runtime.
-* Adding new blocks means changing a variable placeholder to a block.
-*
+ * Integrated Template Extension - ITX
+ *
+ * With this class you get the full power of the phplib template class.
+ * You may have one file with blocks in it but you have as well one main file
+ * and multiple files one for each block. This is quite useful when you have
+ * user configurable websites. Using blocks not in the main template allows
+ * you to modify some parts of your layout easily.
+ *
+ * Note that you can replace an existing block and add new blocks at runtime.
+ * Adding new blocks means changing a variable placeholder to a block.
+ *
* @category HTML
* @package HTML_Template_IT
* @author Ulf Wendel
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @link http://pear.php.net/packages/HTML_Template_IT
* @access public
-*/
+ */
class HTML_Template_ITX extends HTML_Template_IT
{
/**
@@ -136,15 +136,15 @@ class HTML_Template_ITX extends HTML_Template_IT
* @access public
* @see HTML_Template_IT()
*/
- function HTML_Template_ITX($root = '')
+ function __construct($root = '')
{
$this->checkblocknameRegExp = '@' . $this->blocknameRegExp . '@';
$this->functionRegExp = '@' . $this->functionPrefix . '(' .
- $this->functionnameRegExp . ')\s*\(@sm';
+ $this->functionnameRegExp . ')\s*\(@sm';
- $this->HTML_Template_IT($root);
+ parent::__construct($root);
} // end func constructor
/**
@@ -173,7 +173,7 @@ class HTML_Template_ITX extends HTML_Template_IT
* Replaces an existing block with new content.
*
* This function will replace a block of the template and all blocks
- * contained in the replaced block and add a new block insted, means
+ * contained in the replaced block and add a new block instead, means
* you can dynamically change your template.
*
* Note that changing the template structure violates one of the IT[X]
@@ -199,8 +199,8 @@ class HTML_Template_ITX extends HTML_Template_IT
{
if (!isset($this->blocklist[$block])) {
return new IT_Error("The block "."'$block'".
- " does not exist in the template and thus it can't be replaced.",
- __FILE__, __LINE__);
+ " does not exist in the template and thus it can't be replaced.",
+ __FILE__, __LINE__);
}
if ($template == '') {
@@ -287,17 +287,17 @@ class HTML_Template_ITX extends HTML_Template_IT
// Don't trust any user even if it's a programmer or yourself...
if ($placeholder == '') {
return new IT_Error('No variable placeholder given.',
- __FILE__, __LINE__);
+ __FILE__, __LINE__);
} elseif ($blockname == '' ||
- !preg_match($this->checkblocknameRegExp, $blockname)
+ !preg_match($this->checkblocknameRegExp, $blockname)
) {
return new IT_Error("No or invalid blockname '$blockname' given.",
- __FILE__, __LINE__);
+ __FILE__, __LINE__);
} elseif ($template == '') {
return new IT_Error('No block content given.', __FILE__, __LINE__);
} elseif (isset($this->blocklist[$blockname])) {
return new IT_Error('The block already exists.',
- __FILE__, __LINE__);
+ __FILE__, __LINE__);
}
// find out where to insert the new block
@@ -305,25 +305,25 @@ class HTML_Template_ITX extends HTML_Template_IT
if (count($parents) == 0) {
return new IT_Error("The variable placeholder".
- " '$placeholder' was not found in the template.",
- __FILE__, __LINE__);
+ " '$placeholder' was not found in the template.",
+ __FILE__, __LINE__);
} elseif (count($parents) > 1) {
reset($parents);
- while (list($k, $parent) = each($parents)) {
+ foreach ($parents as $k => $parent) {
$msg .= "$parent, ";
}
$msg = substr($parent, -2);
return new IT_Error("The variable placeholder "."'$placeholder'".
- " must be unique, found in multiple blocks '$msg'.",
- __FILE__, __LINE__);
+ " must be unique, found in multiple blocks '$msg'.",
+ __FILE__, __LINE__);
}
$template = ""
- . $template
- . "";
+ . $template
+ . "";
$this->findBlocks($template);
if ($this->flagBlocktrouble) {
return false; // findBlocks() already throws an exception
@@ -373,7 +373,7 @@ class HTML_Template_ITX extends HTML_Template_IT
*
* @return string Name of the (first) block that contains
* the specified placeholder.
- * If the placeholder was not found or an error occured
+ * If the placeholder was not found or an error occurred
* an empty string is returned.
* @throws IT_Error
* @access public
@@ -397,7 +397,7 @@ class HTML_Template_ITX extends HTML_Template_IT
if (is_array($variables = $this->blockvariables[$block])) {
// search the value in the list of blockvariables
reset($variables);
- while (list($k, $variable) = each($variables)) {
+ foreach ($variables as $k => $variable) {
if ($k == $placeholder) {
$found = $block;
break;
@@ -409,7 +409,7 @@ class HTML_Template_ITX extends HTML_Template_IT
// search all blocks and return the name of the first block that
// contains the placeholder
reset($this->blockvariables);
- while (list($blockname, $variables) = each($this->blockvariables)) {
+ foreach ($this->blockvariables as $blockname => $variables) {
if (is_array($variables) && isset($variables[$placeholder])) {
$found = $blockname;
break;
@@ -430,7 +430,7 @@ class HTML_Template_ITX extends HTML_Template_IT
function performCallback()
{
reset($this->functions);
- while (list($func_id, $function) = each($this->functions)) {
+ foreach ($this->functions as $func_id => $function) {
if (isset($this->callback[$function['name']])) {
if ($this->callback[$function['name']]['expandParameters']) {
$callFunction = 'call_user_func_array';
@@ -439,14 +439,14 @@ class HTML_Template_ITX extends HTML_Template_IT
}
if ($this->callback[$function['name']]['object'] != '') {
- $call = $callFunction(
+ $call = $callFunction(
array(
&$GLOBALS[$this->callback[$function['name']]['object']],
$this->callback[$function['name']]['function']),
$function['args']);
} else {
- $call = $callFunction(
+ $call = $callFunction(
$this->callback[$function['name']]['function'],
$function['args']);
}
@@ -493,7 +493,7 @@ class HTML_Template_ITX extends HTML_Template_IT
*
* This is an absolutely evil feature. If your application makes heavy
* use of such callbacks and you're even implementing if-then etc. on
- * the level of a template engine you're reiventing the wheel... - that's
+ * the level of a template engine you're reinventing the wheel... - that's
* actually how PHP came into life. Anyway, sometimes it's handy.
*
* Consider also using XML/XSLT or native PHP. And please do not push
@@ -528,22 +528,22 @@ class HTML_Template_ITX extends HTML_Template_IT
* @return boolean False on failure.
* @throws IT_Error
* @access public
- * @deprecated The $callbackobject parameter is depricated since
+ * @deprecated The $callbackobject parameter is deprecated since
* version 1.2 and might be dropped in further versions.
*/
function setCallbackFunction($tplfunction, $callbackfunction,
- $callbackobject = '',
- $expandCallbackParameters = false) {
+ $callbackobject = '',
+ $expandCallbackParameters = false) {
if ($tplfunction == '' || $callbackfunction == '') {
return new IT_Error("No template function "."('$tplfunction')".
- " and/or no callback function ('$callback') given.",
- __FILE__, __LINE__);
+ " and/or no callback function ('$callbackfunction') given.",
+ __FILE__, __LINE__);
}
$this->callback[$tplfunction] = array(
- 'function' => $callbackfunction,
- 'object' => $callbackobject,
- 'expandParameters' => (boolean)
- $expandCallbackParameters);
+ 'function' => $callbackfunction,
+ 'object' => $callbackobject,
+ 'expandParameters' => (boolean)
+ $expandCallbackParameters);
return true;
} // end func setCallbackFunction
@@ -567,7 +567,7 @@ class HTML_Template_ITX extends HTML_Template_IT
} // end func setCallbackFunctiontable
/**
- * Recursively removes all data assiciated with a block, including
+ * Recursively removes all data associated with a block, including
* all inner blocks
*
* @param string $block block to be removed
@@ -610,7 +610,7 @@ class HTML_Template_ITX extends HTML_Template_IT
} // end func getBlocklist
/**
- * Checks wheter a block exists.
+ * Checks whether a block exists.
*
* @param string $blockname Blockname
*
@@ -647,7 +647,7 @@ class HTML_Template_ITX extends HTML_Template_IT
} // end func getBlockvariables
/**
- * Checks wheter a block variable exists.
+ * Checks whether a block variable exists.
*
* @param string $block Blockname
* @param string $variable Variablename
@@ -687,8 +687,8 @@ class HTML_Template_ITX extends HTML_Template_IT
$search = $regs[0] . $head . ')';
$replace = $this->openingDelimiter .
- '__function' . $num . '__' .
- $this->closingDelimiter;
+ '__function' . $num . '__' .
+ $this->closingDelimiter;
$this->template = str_replace($search, $replace, $this->template);
$template = str_replace($search, $replace, $template);
@@ -697,7 +697,7 @@ class HTML_Template_ITX extends HTML_Template_IT
$arg2 = trim($args2);
$args[] = ('"' == $arg2{0} || "'" == $arg2{0}) ?
- substr($arg2, 1, -1) : $arg2;
+ substr($arg2, 1, -1) : $arg2;
if ($arg2 == $head) {
break;
@@ -706,13 +706,13 @@ class HTML_Template_ITX extends HTML_Template_IT
}
$this->functions[$num++] = array('name' => $regs[1],
- 'args' => $args);
+ 'args' => $args);
}
} // end func buildFunctionlist
/**
- * Truncates the given code from the first occurence of
+ * Truncates the given code from the first occurrence of
* $delimiter but ignores $delimiter enclosed by " or '.
*
* @param string $code The code which should be parsed
@@ -782,7 +782,7 @@ class HTML_Template_ITX extends HTML_Template_IT
}
reset($this->blockvariables[$block]);
- while (list($varname, $val) = each($this->blockvariables[$block])) {
+ foreach ($this->blockvariables[$block] as $varname => $val) {
if (isset($variables[$varname])) {
unset($this->blockvariables[$block][$varname]);
}
@@ -840,10 +840,10 @@ class HTML_Template_ITX extends HTML_Template_IT
{
$parents = array();
reset($this->blocklist);
- while (list($blockname, $content) = each($this->blocklist)) {
+ foreach ($this->blocklist as $blockname => $content) {
reset($this->blockvariables[$blockname]);
- while (list($varname, $val) = each($this->blockvariables[$blockname])) {
+ foreach ($this->blockvariables[$blockname] as $varname => $val) {
if ($variable == $varname) {
$parents[] = $blockname;
}
@@ -858,8 +858,8 @@ class HTML_Template_ITX extends HTML_Template_IT
* calls die() depending on the flags
*
* @param string $message Warning
- * @param string $file File where the warning occured
- * @param int $line Linenumber where the warning occured
+ * @param string $file File where the warning occurred
+ * @param int $line Linenumber where the warning occurred
*
* @see $warn, $printWarning, $haltOnWarning
* @access private
@@ -885,5 +885,4 @@ class HTML_Template_ITX extends HTML_Template_IT
}
} // end func warning
-} // end class HTML_Template_ITX
-?>
+} // end class HTML_Template_ITX
\ No newline at end of file
diff --git a/libraries/pear/HTML/Template/IT_Error.php b/libraries/pear/HTML/Template/IT_Error.php
index b9a08e1..0f199ee 100644
--- a/libraries/pear/HTML/Template/IT_Error.php
+++ b/libraries/pear/HTML/Template/IT_Error.php
@@ -1,29 +1,29 @@
+ * Pierre-Alain Joye
+ * David Soria Parra
*
- * This source file is subject to the New BSD license, That is bundled
- * with this package in the file LICENSE, and is available through
- * the world-wide-web at
- * http://www.opensource.org/licenses/bsd-license.php
- * If you did not receive a copy of the new BSDlicense and are unable
- * to obtain it through the world-wide-web, please send a note to
- * pajoye@php.net so we can mail you a copy immediately.
- *
- * Author: Ulf Wendel
- * Pierre-Alain Joye
- * David Soria Parra
- *
* @category HTML
* @package HTML_Template_IT
* @author Ulf Wendel
* @license BSD http://www.opensource.org/licenses/bsd-license.php
- * @version CVS: $Id: IT_Error.php 3 2017-06-22 07:32:17Z martin $
+ * @version CVS: $Id$
* @link http://pear.php.net/packages/HTML_Template_IT
* @access public
*/
@@ -31,35 +31,34 @@
require_once "PEAR.php";
/**
-* IT[X] Error class
-*
+ * IT[X] Error class
+ *
* @category HTML
* @package HTML_Template_IT
* @author Ulf Wendel
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @link http://pear.php.net/packages/HTML_Template_IT
* @access public
-*/
+ */
class IT_Error extends PEAR_Error
{
/**
* Prefix of all error messages.
- *
+ *
* @var string
*/
var $error_message_prefix = "IntegratedTemplate Error: ";
-
+
/**
* Creates an cache error object.
- *
+ *
* @param string $msg error message
- * @param string $file file where the error occured
- * @param string $line linenumber where the error occured
+ * @param string $file file where the error occurred
+ * @param string $line linenumber where the error occurred
*/
- function IT_Error($msg, $file = __FILE__, $line = __LINE__)
+ function __construct($msg, $file = __FILE__, $line = __LINE__)
{
- $this->PEAR_Error(sprintf("%s [%s on line %d].", $msg, $file, $line));
+ $this->PEAR_Error(sprintf("%s [%s on line %d].", $msg, $file, $line));
} // end func IT_Error
-
-} // end class IT_Error
-?>
+
+} // end class IT_Error
\ No newline at end of file
diff --git a/scripts/do_config.php b/scripts/do_config.php
index c621d32..19fe6b9 100644
--- a/scripts/do_config.php
+++ b/scripts/do_config.php
@@ -1,40 +1,51 @@
#!/usr/bin/php
getFieldData($strSQL);
-$strSQL = "SELECT `id` FROM `tbl_datadomain` WHERE `domain`='$argDomain'";
-$intDomain = $myDBClass->getFieldData($strSQL);
-if ($intDomain == '') {
- echo "Domain '".$argDomain."' doesn not exist\n";
+/*
+Get domain ID
+*/
+$strSQL = "SELECT `targets` FROM `tbl_datadomain` WHERE `domain`='$argDomain'";
+$intTarget = $myDBClass->getFieldData($strSQL);
+$strSQL = "SELECT `id` FROM `tbl_datadomain` WHERE `domain`='$argDomain'";
+$intDomain = $myDBClass->getFieldData($strSQL);
+if ($intDomain === '') {
+ echo "Domain '" . $argDomain . "' doesn not exist\n";
exit(1);
}
-if ($intDomain == '0') {
- echo "Domain '".$argDomain."' cannot be used\n";
+if ($intDomain === '0') {
+ echo "Domain '" . $argDomain . "' cannot be used\n";
exit(1);
}
$myDataClass->intDomainId = $intDomain;
$myConfigClass->intDomainId = $intDomain;
$myImportClass->intDomainId = $intDomain;
-$myConfigClass->getConfigData($intTarget, 'method', $intMethod);
-//
-// Process form variables
-// ======================
-if ($argFunction == 'check') {
+$strMethod = '';
+$intMethod = 0;
+/* Get connection method */
+if ($myConfigClass->getConfigData($intTarget, 'method', $strMethod) === 0) {
+ $intMethod = (int)$strMethod;
+}
+/*
+Process form variables
+*/
+if ($argFunction === 'check') {
$myConfigClass->getConfigData($intTarget, 'binaryfile', $strBinary);
$myConfigClass->getConfigData($intTarget, 'basedir', $strBaseDir);
$myConfigClass->getConfigData($intTarget, 'nagiosbasedir', $strNagiosBaseDir);
$myConfigClass->getConfigData($intTarget, 'conffile', $strConffile);
- if ($intMethod == 1) {
+ if ($intMethod === 1) {
if (file_exists($strBinary) && is_executable($strBinary)) {
- $resFile = popen($strBinary. ' -v ' .$strConffile, 'r');
+ $resFile = popen($strBinary . ' -v ' . $strConffile, 'r');
} else {
echo "Cannot find the Nagios binary or no execute permissions!\n";
exit(1);
}
- } elseif ($intMethod == 2) {
+ } elseif ($intMethod === 2) {
$booReturn = 0;
- if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) {
+ if (empty($myConfigClass->conFTPConId)) {
$booReturn = $myConfigClass->getFTPConnection($intTarget);
}
- if ($booReturn == 1) {
+ if ($booReturn === 1) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
} else {
$intErrorReporting = error_reporting();
error_reporting(0);
- if (!($resFile = ftp_exec($myConfigClass->resConnectId, $strBinary.' -v '.$strConffile))) {
+ if (!($resFile = ftp_exec($myConfigClass->conFTPConId, $strBinary . ' -v ' . $strConffile))) {
echo "Remote execution (FTP SITE EXEC) is not supported on your system!\n";
error_reporting($intErrorReporting);
exit(1);
}
- ftp_close($conn_id);
+ ftp_close($myConfigClass->conFTPConId);
error_reporting($intErrorReporting);
}
- } elseif ($intMethod == 3) {
+ } elseif ($intMethod === 3) {
$booReturn = 0;
- if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) {
+ if (empty($myConfigClass->resSSHConId) || !is_resource($myConfigClass->resSSHConId)) {
$booReturn = $myConfigClass->getSSHConnection($intTarget);
}
- if ($booReturn == 1) {
- echo 'SSH connection failure: ' .str_replace('::', "\n", $myConfigClass->strErrorMessage);
+ if ($booReturn === 1) {
+ echo 'SSH connection failure: ' . str_replace('::', "\n", $myConfigClass->strErrorMessage);
exit(1);
}
- $intRet1 = $myConfigClass->sendSSHCommand('ls '.$strBinary, $arrRet1);
- $intRet2 = $myConfigClass->sendSSHCommand('ls '.$strConffile, $arrRet2);
- if (($intRet1 == 0) && ($intRet2 == 0) && is_array($arrRet1) && is_array($arrRet2)) {
- $intRet3 = $myConfigClass->sendSSHCommand($strBinary.' -v '.$strConffile, $arrResult);
- if ($intRet3 != 0) {
+ $intRet1 = $myConfigClass->sendSSHCommand('ls ' . $strBinary, $arrRet1);
+ $intRet2 = $myConfigClass->sendSSHCommand('ls ' . $strConffile, $arrRet2);
+ if (($intRet1 === 0) && ($intRet2 === 0) && is_array($arrRet1) && is_array($arrRet2)) {
+ $intRet3 = $myConfigClass->sendSSHCommand($strBinary . ' -v ' . $strConffile, $arrResult);
+ if ($intRet3 !== 0) {
echo "Remote execution of nagios verify command failed (remote SSH)!\n";
exit(1);
}
@@ -121,16 +136,16 @@ if ($argFunction == 'check') {
}
}
}
-if ($argFunction == 'restart') {
- // Read config file
+if ($argFunction === 'restart') {
+ /* Read config file */
$myConfigClass->getConfigData($intTarget, 'commandfile', $strCommandfile);
$myConfigClass->getConfigData($intTarget, 'pidfile', $strPidfile);
- // Check state nagios demon
+ /* Check state nagios demon */
clearstatcache();
- if ($intMethod == 1) {
+ if ($intMethod === 1) {
if (file_exists($strPidfile)) {
if (file_exists($strCommandfile) && is_writable($strCommandfile)) {
- $strCommandString = '[' .time(). '] RESTART_PROGRAM;' .time()."\n";
+ $strCommandString = '[' . time() . '] RESTART_PROGRAM;' . time() . "\n";
$timeout = 3;
$old = ini_set('default_socket_timeout', $timeout);
$resCmdFile = fopen($strCommandfile, 'wb');
@@ -150,24 +165,24 @@ if ($argFunction == 'restart') {
echo "Nagios daemon is not running, cannot send restart command!\n";
exit(1);
}
- if ($intMethod == 2) {
+ if ($intMethod === 2) {
echo "Nagios restart is not possible via FTP remote connection!\n";
exit(1);
}
- if ($intMethod == 3) {
+ if ($intMethod === 3) {
$booReturn = 0;
- if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) {
+ if (empty($myConfigClass->resSSHConId) || !is_resource($myConfigClass->resSSHConId)) {
$booReturn = $myConfigClass->getSSHConnection($intTarget);
}
- if ($booReturn == 1) {
+ if ($booReturn === 1) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
} else {
- $intRet1 = $myConfigClass->sendSSHCommand('ls '.$strBinary, $arrRet1);
- if (($intRet1 == 0) && is_array($arrRet1)) {
- $strCommandString = '[' .time(). '] RESTART_PROGRAM;' .time()."\n";
- $strCommand = 'echo "'.$strCommandString.'" >> '.$strCommandfile;
- $intRet2 = $myConfigClass->sendSSHCommand($strCommand, $arrResult);
- if ($intRet2 != 0) {
+ $intRet1 = $myConfigClass->sendSSHCommand('ls ' . $strCommandfile, $arrRet1);
+ if (($intRet1 === 0) && is_array($arrRet1)) {
+ $strCommandString = '[' . time() . '] RESTART_PROGRAM;' . time() . "\n";
+ $strCommand = 'echo "' . $strCommandString . '" >> ' . $strCommandfile;
+ $intRet2 = $myConfigClass->sendSSHCommand($strCommand, $arrResult);
+ if ($intRet2 !== 0) {
echo "Restart failed - Nagios command file not found or no rights to execute (remote SSH)!\n";
exit(1);
}
@@ -179,69 +194,69 @@ if ($argFunction == 'restart') {
}
}
}
-if ($argFunction == 'write') {
- if (substr_count($argObject, 'tbl_') != 0) {
+if ($argFunction === 'write') {
+ if (substr_count($argObject, 'tbl_') !== 0) {
$argObject = str_replace('tbl_', '', $argObject);
}
- if (substr_count($argObject, '.cfg') != 0) {
+ if (substr_count($argObject, '.cfg') !== 0) {
$argObject = str_replace('.cfg', '', $argObject);
}
- if ($argObject == 'host') {
- // Write host configuration
+ if ($argObject === 'host') {
+ /* Write host configuration */
$strInfo = "Write host configurations ...\n";
- $strSQL = "SELECT `id` FROM `tbl_host` WHERE `config_id` = $intDomain AND `active`='1'";
+ $strSQL = "SELECT `id` FROM `tbl_host` WHERE `config_id` = $intDomain AND `active`='1'";
$myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
$intError = 0;
- if ($intDataCount != 0) {
+ if ($intDataCount !== 0) {
foreach ($arrData as $data) {
$intReturn = $myConfigClass->createConfigSingle('tbl_host', $data['id']);
- if ($intReturn == 1) {
+ if ($intReturn === 1) {
$intError++;
}
}
}
- if ($intError == 0) {
+ if ($intError === 0) {
$strInfo .= "Host configuration files successfully written!\n";
} else {
$strInfo .= "Cannot open/overwrite the configuration file (check the permissions)!\n";
}
- } elseif ($argObject == 'service') {
- // Write service configuration
- $strInfo = "Write service configurations ...\n";
- $strSQL = 'SELECT `id`, `config_name` FROM `tbl_service` '
+ } elseif ($argObject === 'service') {
+ /* Write service configuration */
+ $strInfo = "Write service configurations ...\n";
+ $strSQL = 'SELECT `id`, `config_name` FROM `tbl_service` '
. "WHERE `config_id` = $intDomain AND `active`='1' GROUP BY `config_name`";
$myDBClass->hasDataArray($strSQL, $arrData, $intDataCount);
$intError = 0;
- if ($intDataCount != 0) {
+ if ($intDataCount !== 0) {
foreach ($arrData as $data) {
$intReturn = $myConfigClass->createConfigSingle('tbl_service', $data['id']);
- if ($intReturn == 1) {
+ if ($intReturn === 1) {
$intError++;
}
}
}
- if ($intError == 0) {
+ if ($intError === 0) {
$strInfo .= "Service configuration file successfully written!\n";
} else {
$strInfo .= "Cannot open/overwrite the configuration file (check the permissions)!\n";
}
} else {
- $strInfo = 'Write ' .$argObject.".cfg ...\n";
- $booReturn = $myConfigClass->createConfig('tbl_' .$argObject);
- if ($booReturn == 0) {
- $strInfo .= 'Configuration file ' .$argObject.".cfg successfully written!\n";
+ $strInfo = 'Write ' . $argObject . ".cfg ...\n";
+ $booReturn = $myConfigClass->createConfig('tbl_' . $argObject);
+ if ($booReturn === 0) {
+ $strInfo .= 'Configuration file ' . $argObject . ".cfg successfully written!\n";
} else {
echo $myConfigClass->strErrorMessage;
- $strInfo .= 'Cannot open/overwrite the configuration file ' .$argObject. '.cfg (check the permissions or '
- . 'probably tbl_' .$argObject." does not exists)!\n";
+ $strInfo .= 'Cannot open/overwrite the configuration file ' . $argObject . '.cfg (check the permissions or '
+ . 'probably tbl_' . $argObject . " does not exists)!\n";
}
}
echo $strInfo;
}
-if ($argFunction == 'import') {
- $strInfo = "Importing configurations ...\n";
- $intReturn = $myImportClass->fileImport($argObject, $intTarget, '1');
- if ($intReturn != 0) {
+if ($argFunction === 'import') {
+ $strInfo = "Importing configurations ...\n";
+ $intReturn = $myImportClass->fileImport($argObject, $intTarget, '1');
+ if ($intReturn !== 0) {
$strInfo .= $myImportClass->strErrorMessage;
} else {
$strInfo .= $myImportClass->strInfoMessage;
@@ -249,27 +264,26 @@ if ($argFunction == 'import') {
$strInfo = strip_tags($strInfo);
echo str_replace('::', "\n", $strInfo);
}
-
-//
-// Output processing
-// =================
-if (isset($resFile) && ($resFile != false)) {
- $intError = 0;
+/*
+Output processing
+*/
+if (isset($resFile) && ($resFile !== false)) {
+ $intError = 0;
$intWarning = 0;
- $strOutput = '';
+ $strOutput = '';
while (!feof($resFile)) {
$strLine = fgets($resFile, 1024);
- if (substr_count($strLine, 'Error:') != 0) {
+ if (substr_count($strLine, 'Error:') !== 0) {
$intError++;
}
- if (substr_count($strLine, 'Warning:') != 0) {
+ if (substr_count($strLine, 'Warning:') !== 0) {
$intWarning++;
}
$strOutput .= $strLine;
}
pclose($resFile);
echo $strOutput."\n";
- if (($intError == 0) && ($intWarning == 0)) {
+ if (($intError === 0) && ($intWarning === 0)) {
echo "Written configuration files are valid, Nagios can be restarted!\n\n";
}
} elseif (isset($arrResult) && is_array($arrResult)) {
@@ -277,16 +291,16 @@ if (isset($resFile) && ($resFile != false)) {
$intWarning = 0;
$strOutput = '';
foreach ($arrResult as $elem) {
- if (substr_count($elem, 'Error:') != 0) {
+ if (substr_count($elem, 'Error:') !== 0) {
$intError++;
}
- if (substr_count($elem, 'Warning:') != 0) {
+ if (substr_count($elem, 'Warning:') !== 0) {
$intWarning++;
}
$strOutput .= $elem."\n";
}
echo $strOutput."\n";
- if (($intError == 0) && ($intWarning == 0)) {
+ if (($intError === 0) && ($intWarning === 0)) {
echo "Written configuration files are valid, Nagios can be restarted!\n\n";
}
-}
+}
\ No newline at end of file
diff --git a/templates/admin/checkcommands.htm.tpl b/templates/admin/checkcommands.htm.tpl
index 255fc7b..d5e5717 100644
--- a/templates/admin/checkcommands.htm.tpl
+++ b/templates/admin/checkcommands.htm.tpl
@@ -1,20 +1,21 @@
-
+
-
+