×


Category: Server Management Service


Boot an EC2 Windows instance into DSRM - How to perform this task

This article covers how to boot an EC2 Windows instance into DSRM. If an instance running Microsoft Active Directory experiences a system failure or other critical issues you can troubleshoot the instance by booting into a special version of Safe Mode called Directory Services Restore Mode (DSRM). In DSRM you can repair or recover Active Directory.


How to Configure an Instance to Boot into DSRM?

1. To boot an online instance into DSRM using the System Configuration dialog box

i. In the Run dialog box, type msconfig and press Enter.

ii. Choose the Boot tab.

iii. Under Boot options choose Safe boot.

iv. Choose Active Directory repair and then choose OK. The system prompts you to reboot the server.


2. To boot an online instance into DSRM using the command line

From a Command Prompt window, run the following command:

$ bcdedit /set safeboot dsrepair

If an instance is offline and unreachable, you must detach the root volume and attach it to another instance to enable DSRM mode.


Cannot download Docker images behind a proxy - Fix it Now

This article covers the error, Cannot download Docker images behind a proxy. 

You can fix this docker issue by doing the following:

1. In the file /etc/default/docker, add the line:

export http_proxy='http://<host>:<port>'

2. Restart Docker:

$ sudo service docker restart


Also, you can Follow the steps given below to fix this docker error:

1. Create a systemd drop-in directory for the docker service:

$ mkdir /etc/systemd/system/docker.service.d

2. Create a file called /etc/systemd/system/docker.service.d/http-proxy.conf and add the HTTP_PROXY env variable:

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

3. If you have internal Docker registries that you need to contact without proxying you can specify them via the NO_PROXY environment variable:

Environment="HTTP_PROXY=http://proxy.example.com:80/"
Environment="NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com"

4. Flush changes:

$ sudo systemctl daemon-reload

5. Verify that the configuration has been loaded:

$ sudo systemctl show --property Environment docker
Environment=HTTP_PROXY=http://proxy.example.com:80/

6. Restart Docker:

$ sudo systemctl restart docker


Define Global Environment Variables in Nagios - Fix it Now

This article covers how to define Global Environment Variables in Nagios. In some environments, when the plugin is executed by the monitoring engine, these environment variables are not loaded and hence the plugin does not know where to find them and fails.

Therefore, when the plugin is executed, environment variables may not load.


To Define Global Environment Variables in Nagios:

Here, you will define variables required for you plugins globally.

a. Add the path /usr/local/important_application to the PATH environment

b. Add the variable ORACLE_HOME=/usr/lib/oracle/11.2/client64

1. To do this, edit a specific file that nagios checks when it starts:

$ vi /etc/sysconfig/nagios

2. Add the following lines to the file and then save:

export PATH=$PATH:/usr/local/important_application
export ORACLE_HOME=/usr/lib/oracle/11.2/client64

3. Finally, restart Nagios:

$ systemctl restart nagios.service


If you have Mod-Gearman, 

The following is being applied:

a. Re-define the PATH environment to include /usr/local/important_application

b. Add the variable ORACLE_HOME=/usr/lib/oracle/11.2/client64

1. This is performed by editing a specific file that mod-gearman2-worker checks when the service starts:

/etc/sysconfig/mod-gearman2-worker

2. Open an SSH session to your Mod-Gearman worker.

Type:

$ vi /etc/sysconfig/mod-gearman2-worker

3. Add the following lines to the end of the file and save:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/important_application
ORACLE_HOME=/usr/lib/oracle/11.2/client64

4. Now reload the daemons and restart the Mod-Gearman worker:

$ systemctl daemon-reload
$ systemctl restart mod-gearman2-worker.service


Bad interpreter No such file or directory error in Nagios

This article covers Nagios error, 'bad interpreter no such file or directory'. Nagios bad interpreter: No such file or directory error occurs after uploading a plugin which is in a "Windows" format instead of a "Unix" format. It has to do with the line endings / carriage returns.

To fix this error, you will convert the file to a Unix format:

$ yum install -y dos2unix
$ dos2unix /usr/local/nagios/libexec/check_apc_pdu_load.sh


Nagios error Could not bind to the LDAP server - Fix it now

This article covers tips to resolve 'could not bind to the LDAP server. Nagios error. This cause secure lookup on 636 or using TLS to fail.

The check_ldap plugin makes use of OpenLDAP, the OpenLDAP package is installed as part of the NagiosXI installation because the plugins have dependencies on it but it is left in a non-configured state.

To resolve the problem on each node (wtgc-nagios-01 and wtgc-nagios-02) the following is required, firstly edit the file: /etc/openldap/ldap.conf and at the bottom of the file add the following line:

TLS_REQCERT allow


330 Content Decoding Failed - Nagios Web browser error

This article covers how to fix 330 Content Decoding Failed Nagios browser error. Basically, this error occurs when an HTTP request's headers claim that the content is gzip encoded, but it is not. 

To fix this error:

The Apache web server requires zlib.output_compression to be configured to On in the /etc/php.ini file.

Execute the following command to open the file in vi:

vi /etc/php.ini

When using the vi editor, to make changes press i on the keyboard first to enter insert mode.

Press Esc to exit insert mode.

To locate the line zlib.output_compression = type the following:

/output_compression =

This should take you directly to the line. Change the setting to On:

zlib.output_compression = On

When you have finished, save the changes in vi by typing:

:wq

and press Enter.

The last step is to restart the Apache service using one of the commands below:

RHEL 7 + | CentOS 7 + | Oracle Linux 7 +

$ systemctl restart httpd.service

 Debian | Ubuntu 16/18/20

$ systemctl restart apache2.service

After the service has restarted the problem should no longer occur.