Zabbix agent can't connect to Zabbix5.0 server - ubuntu-18.04

I installed zabbix agent on Ubuntu 18.04 server. I changed the IP address and hostname pointing to the Zabbix server in zabbix_agentd.config file in /etc. And Restart Zabbix agent. Seems like the server is running, but the agent is not conneting to the server. How can I fix it?
/etc/zabbix# sudo systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
Loaded: loaded (/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2020-07-29 15:26:30 NZST; 5s ago
Process: 16401 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 16403 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 16406 (zabbix_agentd)
Tasks: 6 (limit: 2325)
CGroup: /system.slice/zabbix-agent.service
├─16406 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
├─16407 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
├─16408 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
├─16409 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
├─16410 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
└─16411 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
Jul 29 15:26:29 UbuntuServe-001 systemd[1]: Starting Zabbix Agent...
Jul 29 15:26:30 UbuntuServe-001 systemd[1]: zabbix-agent.service: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
Jul 29 15:26:30 UbuntuServe-001 systemd[1]: Started Zabbix Agent.

Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
The /run/zabbix directory does not exists. Remove the PIDFILE= line from config file, and zabbxi will create the pid file in temporary directory. Alternatively, create /run/zabbix directory and chown it to zabbix user.

Related

mongod.service active : failed (failed to start mongodb server)

I just started learning mongodb everything was going well until I tried stoping the server using sudo systemctl stop mongod and restarting it usingsudo systemctl start mongod.
now its showing:-
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2021-01-16 12:39:04 IST; 3s ago
Docs: https://docs.mongodb.org/manual
Process: 357998 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAILURE)
Main PID: 357998 (code=exited, status=1/FAILURE)
Jan 16 12:39:04 prabal-computer systemd[1]: Started MongoDB Database Server.
Jan 16 12:39:04 prabal-computer mongod[357998]: {"t":{"$date":"2021-01-16T07:09:04.669Z"},"s":"F", "c":"CONTROL", "id":20574, "ctx":"main">
Jan 16 12:39:04 prabal-computer systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAILURE
Jan 16 12:39:04 prabal-computer systemd[1]: mongod.service: Failed with result 'exit-code'.
lines 1-11/11 (END)
whenever I am trying to start and see the status using sudo systemctl status mongod,this error appears.
note: I have already tried reinstalling the mongodb

Unable to connect to SQL server instance ubuntu 18.04

I am running SQL server on ubuntu 18.04 which I was able to connect to successfully via SSMS. But I am not able to connect anymore.
My first instinct was to check if the SQL server was running by executing
sudo systemctl status mssql-server
lo and behold the SQL server instance was active so I rebooted the entire server and ran the above command again and saw the following:
mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-10-16 16:49:17 UTC; 1min 13s ago
Docs: https://learn.microsoft.com/en-us/sql/linux
Process: 1025 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=1/FAILURE)
Main PID: 1025 (code=exited, status=1/FAILURE)
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Main process exited, code=exited, status=1/FAILURE
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Scheduled restart job, restart counter is at 3.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: Stopped Microsoft SQL Server Database Engine.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Start request repeated too quickly.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Oct 16 16:49:17 lamp-xxxxx systemd[1]: Failed to start Microsoft SQL Server Database Engine.
I checked the logs at /var/opt/mssql/log/errorlog and found this .
2019-10-14 13:52:56.16 spid51 CImageHelper::Init () Failed load of
symbol file with path = /binn/;/BINN - Not enough storage is available to
process this command.
2019-10-14 13:52:56.17 spid51 CImageHelper::Init () Failed load of
symbol file with path = /binn/;/BINN - Not enough storage is available to process this command.
2019-10-14 13:52:56.19 spid51 Error: 19099, Severity: 16, State: 1.
2019-10-14 13:52:56.19 spid51 Trace ID '1' was stopped because of an error. Cause: 0x80070005(Access is denied.). Restart the trace after correcting the problem.
2019-10-14 13:52:56.20 spid51 Error: 17053, Severity: 16, State: 1.
2019-10-14 13:52:56.20 spid51 FCB::MakePreviousWritesDurable: Operating system error (null) encountered.
2019-10-14 13:52:56.21 spid51 Error: 9001, Severity: 21, State: 1.
2019-10-14 13:52:56.21 spid51 The log for database 'master' is not available. Check the operating system error log for related error messages. Resolve any errors and restart the database.
2019-10-14 13:52:56.24 spid51 Error: 9001, Severity: 21, State: 16.
I'm not an expert and don't know the next move to make.
So the reason for this error was getting was because I messed up with the file ownership..
running the following command fixed it for me too bad I spend so much time on this:
cd /var/opt
sudo chown mssql:mssql -R mssql
time to take that dump :-D.

MSSQL Service failed to start on ubuntu

Every time i checked the MSSQL service is failing i have over 5 GB memory on my virtual server. I have changed the sql port to 1533.
r*****k:~# sudo systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine
Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Fri 2017-11-17 15:39:39 UTC; 1min 37s ago
Process: 4906 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=255)
Main PID: 4906 (code=exited, status=255)
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Unit entered failed state.
Nov 17 15:39:39 SV0*****com systemd[1]: mssql-server.service: Failed with result 'exit-code'.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Service hold-off time over, scheduling restart.
Nov 17 15:39:39 SV0*****.com systemd[1]: Stopped Microsoft SQL Server Database Engine.
Nov 17 15:39:39 SV0*****.com systemd[1]: mssql-server.service: Start request repeated too quickly.
Nov 17 15:39:39 SV0*****.com systemd[1]: Failed to start Microsoft SQL Server Database Engine.
r*****k:/var/opt/mssql# cat mssql.conf
> [EULA] accepteula = Y</br>
>
> [network] ipaddress = 6*.*1.1*2.*8 kerberoskeytabfile =
> /var/opt/mssql/secrets/mssql.keytab tcpport = 1533
>
> [memory] memorylimitmb = 3328
>
> [filelocation] defaultdatadir = /tmp/data
Anyone can help to stable the mssql service on the vm.
Does your Ubuntu server have the firewall enabled? If so, it may be blocking port 1533, which is preventing the service from starting on that custom port.
You may want to look in /var/log/messages for additional information as well.

Nagios Core 4.2.0 Service not running after reboot

I am running Nagios Core 4.2.0 to monitor hosts and services via Check_MK plugin. This is running on a VM. Once I rebooted, I cannot get a PID for Nagios.
root#hostname:/etc/init.d# service nagios status
● nagios.service - Nagios
Loaded: loaded (/etc/systemd/system/nagios.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2017-08-10 09:09:34 CDT; 1min 2s ago
Process: 2369 ExecStart=/usr/local/nagios/bin/nagios /usr/local/nagios/etc/nagios.cfg (code=exited, status=1/FAILURE)
Main PID: 2369 (code=exited, status=1/FAILURE)
Aug 10 09:09:34 hostname systemd[1]: Started Nagios.
Aug 10 09:09:34 hostname systemd[1]: nagios.service: Main process exited, code=exited, status=1/FAILURE
Aug 10 09:09:34 hostname systemd[1]: nagios.service: Unit entered failed state.
Aug 10 09:09:34 hostname systemd[1]: nagios.service: Failed with result 'exit-code'.
Is there a way to get this PID to run? I am not sure how a simple reboot can make this go bad.

Apache2 is not starting after apt upgrade

I updated Apache2 on my Rapsberry Pi (using: apt install apache2 --only-upgrade) and now it is not starting:
root#pi:/etc/apache2 # service apache2 start
Job for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
root#pi:/etc/apache2 # systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled)
Active: failed (Result: resources) since Sun 2017-02-05 16:19:48 CET; 28min ago
Feb 05 16:47:44 pi systemd[1]: Starting The Apache HTTP Server...
Feb 05 16:47:44 pi systemd[1]: apache2.service failed to run 'start' task: No such file or directory
Feb 05 16:47:44 pi systemd[1]: Failed to start The Apache HTTP Server.
Version of apache2:
Server version: Apache/2.4.25 (Raspbian)
Server built: 2017-01-25T22:59:26
apache2ctl -t shows:
Syntax OK
I tried disabling all virtual hosts (only default left) but it didn't change anything.
Output of just apache2:
[Mon Feb 06 01:25:09.079790 2017] [core:warn] [pid 2954] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
I had the same issue after upgrading a Dockerfile from 14.04 to 17.04.
The solution for me was to manually add the apache directory in /var/run
So the fix was:
mkdir /var/run/apache2
The DefaultRuntimeDir was set to /var/run/apache2 but the folder was missing.

Resources