Damage to databases is tricky to resolve, particularly so in distributed databases. You might try starting from scratch with a brand new nagioslogserver index, but this would remove any queries/alerts/configurations you had previously defined. You might be able to restore the configurations from these files, and I would suggest backing them up if you have complex configurations:
The following commands should start fresh for version 1.4.4.
.
Code: Select all
#This will delete all the configs/alerts/queries/users etc
curl -XDELETE 'http://localhost:9200/nagioslogserver/'
#This will create the appropriate command subsystem jobs
curl -XPUT 'http://localhost:9200/nagioslogserver/commands/backups' -d '{"created":"2016-11-22 00:00:00","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"do_backups","run_time":1479846591,"frequency":"86400","last_run_time":"1970-01-01 00:00:00","last_run_status":"SUCCESS"}'
curl -XPUT 'http://localhost:9200/nagioslogserver/commands/backup_maintenance' -d '{"created":"2016-11-22 00:00:00","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"do_maintenance","run_time":1479846572,"frequency":"86400","last_run_output":"Maintenance and Backup jobs are being executed","last_run_time":"1970-01-01 00:00:00","last_run_status":"SUCCESS"}'
curl -XPUT 'http://localhost:9200/nagioslogserver/commands/cleanup_cmdsubsys' -d '{"created":"2016-11-22 00:00:00","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"cleanup","run_time":1479839486,"frequency":"3600","last_run_time":"1970-01-01 00:00:00","last_run_status":"SUCCESS"}'
curl -XPUT 'http://localhost:9200/nagioslogserver/commands/run_all_alerts' -d '{"created":"2016-11-22 00:00:00","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"run_alerts","run_time":1479838091,"frequency":"20","last_run_time":"1970-01-01 00:00:00","last_run_status":"SUCCESS"}'
curl -XPUT 'http://localhost:9200/nagioslogserver/commands/run_update_check' -d '{"created":"2016-11-22 00:00:00","created_by":"1","active":1,"status":"waiting","type":"system","node":"global","command":"update_check","run_time":1479846591,"frequency":"86400","last_run_time":"1970-01-01 00:00:00","last_run_status":"SUCCESS"}'
# This will restore the default configurations/queries/filters:
curl -XPUT 'http://localhost:9200/nagioslogserver/node/global' -d '{"config_inputs":[{"raw":"syslog {\r\n type => '\''syslog'\''\r\n}","name":"Syslog (Default)","active":"1"},{"raw":"tcp {\r\n type => '\''eventlog'\''\r\n port => 3515\r\n codec => json {\r\n charset => '\''CP1252'\''\r\n }\r\n}","name":"Windows Event Log (Default)","active":"1"},{"raw":"tcp {\r\n type => '\''import_raw'\''\r\n tags => '\''import_raw'\''\r\n port => 2056\r\n}\r\nudp {\r\n type => '\''import_raw'\''\r\n tags => '\''import_raw'\''\r\n port => 2056\r\n}","name":"Import Files - Raw (Default)","active":"1"},{"raw":"tcp {\r\n type => '\''import_json'\''\r\n tags => '\''import_json'\''\r\n port => 2057\r\n codec => json\r\n}","name":"Import Files - JSON (Default)","active":"0"}],"config_filters":[{"raw":"if [program] == '\''apache_access'\'' {\r\n grok {\r\n match => [ '\''message'\'', '\''%{COMBINEDAPACHELOG}'\'']\r\n }\r\n date {\r\n match => [ '\''timestamp'\'', '\''dd/MMM/yyyy:HH:mm:ss Z'\'', '\''MMM dd HH:mm:ss'\'', '\''ISO8601'\'' ]\r\n }\r\n mutate {\r\n replace => [ '\''type'\'', '\''apache_access'\'' ]\r\n convert => [ '\''bytes'\'', '\''integer'\'' ]\r\n convert => [ '\''response'\'', '\''integer'\'' ]\r\n }\r\n}\r\n \r\nif [program] == '\''apache_error'\'' {\r\n grok {\r\n match => [ '\''message'\'', '\''\\[(?<timestamp>%{DAY:day} %{MONTH:month} %{MONTHDAY} %{TIME} %{YEAR})\\] \\[%{WORD:class}\\] \\[%{WORD:originator} %{IP:clientip}\\] %{GREEDYDATA:errmsg}'\'']\r\n }\r\n mutate {\r\n replace => [ '\''type'\'', '\''apache_error'\'' ]\r\n }\r\n}","name":"Apache (Default)","active":"1"}],"config_outputs":[]}'
#This will create a user named "someuser" with the password "nagiosls". You can use this account to log in and optionally create the accounts that you need, then delete the "someuser" account as one of the other users when done.
curl -XPUT 'http://localhost:9200/nagioslogserver/user/1' -d '{"username":"someuser","password":"c678bcf3b5138b9263a95c44d28097f22c2e02877193d2c25313478821d45c19","auth_type":"admin","email":"[email protected]","language":"default","apiaccess":"1","apikey":"1396e08757545557073844695e5b64caa0bd3ad3","created":"2015-01-23 10:00:00","created_by":0,"default_dashboard":"/dashboard/elasticsearch/default"}'
The other option is to start with a completely fresh installation.