Zabbix scheduledreport: test failed Cannot connect to web service couldn't connect to server - zabbix

I am using zabbix to monitor my workplace infra, everything works fine. Now, I want to start generating reports. Although I followed everything as it is on the doc I still get this error:
Report generating test failed.
Cannot connect to web service: couldn't connect to server
​
Zabbix server (6.0 LTS), the database (mysql) and the web gui are all installed on the same VM on centos 8 stream without gui. I access, manage and administrate from my computer through ssh to the server and access the web gui through https://server_ip/zabbix. All traffic needed is allowed on firewall. I installed google-chrome-stable and the zabbix-web-service and configured it as it says (http://server_ip:10053/report). In the zabbix gui I added the Frontend URL https://server_ip/zabbix. I went through all the combinations of #ip, localhost, 127.0.0.1 between the server and the web-service and still get the same error, I also tried chromium and nothing.
From the server I tried curl -v http://server-ip:10053/report and I got
* Trying ip#...
* TCP_NODELAY set
* Connected to ip# (ip#) port 10053 (#0)
GET /report HTTP/1.1
Host: ip#:10053
User-Agent: curl/7.61.1
Accept: */*
HTTP/1.1 405 Method Not Allowed
Content-Type: application/problem+json
X-Content-Type-Options: nosniff
Date: Tue, 07 Feb 2023 14:35:16 GMT
Content-Length: 38
{"detail":"Method is not supported."}
* Connection #0 to host ip# left intact
Normally it should work because everything is on the same VM!

Related

Mysql Nginx Proxy with VERIFY_IDENTITY

We have configured an Nginx proxy for AWS RDS to get a static IP address, which has to be whitelist on the Network ACL outbound of the VPC on another AWS Account ( tunneling is not possible ). The Nginx proxy pass is working but the MySQL server validation ( VERIFY_IDENTITY ) is failing with the error.
mysql -h Proxy Server Address --ssl-ca=rds-ca-2015-root.pem --ssl-mode=VERIFY_IDENTITY -u admin -p
Failed to verify the server certificate via X509 certificate matching functions
I use this AWS Document to download the CA certificate link
Nginx configuration
stream {
upstream mysql_server {
server *******.us-east-1.rds.amazonaws.com:3306;
}
server {
listen 3306;
proxy_pass mysql_server;
}
}
I am missing anything on the Nginx configuration or is it not possible to do the server identity verify when the AWS RDS is behind the Nginx TCP proxy?
I see you're using rds-ca-2015-root.pem and looks like your rds server has been updated to 2019 certificate. you need to download the new certificate and connect again
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/ssl-certificate-rotation-mysql.html

Can`t connect to mysql server on X.X.X.X on Windows

As the title says I want to connect remotely to mysql and it is on windows server but I got this error message.
Cant connect to mysql server on X.X.X.X
I am tring it with HeidiSql
I have MariaDB installed.
Also I can connect to server using remote connection.
Server is running and can connect to mysql localy
What have I tried:
I located my my.ini file and checked that I dont have one of these commands:
Skip-networking
bind-address = some IP
I didnt have them there in the first place
I logged in my MariaDB terminal and granted all permisions to user using this:
GRANT ALL PRIVILEGES ON *.* TO 'root'#'192.168.100.%'
IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;
I have added port 3306 to windows firewall
I guess it is worth mentioning that I cant ping that server either
if I do
ping X.X.X.X
it returns:
Pinging X.X.X.X with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for X.X.X.X:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
I have spent many hours on forums and tried all instructions but still cant connect.
Any help would be much appreciated!
The detailed problem can be from two different causes:
First option:
MySQL is binded to 127.0.0.1 or no ip at all. Check netstat on windows cmd for locating 3306 port opened to mysql process and binded to your network LAN interface or 0.0.0.0 (not to loopback / 127.0.0.1 // ::1)
For check netstat, use netstat -a -n -o, you can see in the response the PID of the process too.
For check MySQL is working on the same machine, try to connect from local console using mysql -h 127.0.0.1 (for localhost connection) or mysql -h (your LAN IP) (If you have mysql binded only to your LAN IP address).
Second option:
If first test are OK. Maybe windows firewall is not configured correctly. Try to disable windows firewall (double check disabling it). The error response on your question are because windows firewall are active and blocking connections. When you have verified you can reach 3306 with firewall off, enable it and configure. Check always you're opening the port on the required network profile (Remember, windows firewall can have different rules for private / public connections).
For check firewall correctly configured, try to access to the 3306 port on the computer from another comp on the LAN.
If you have a huge LAN network with VLANs and similar technologies, check your routing topology. Also, remember always for initial checks, disable windows firewall. Your ping are failing because firewall are enabled.

Stuggling to access my localhost with xampp

I'm trying to access my localhost in order to reach phpmyadmin and change mysql password, however when I type "localhost" into the browser it says the page cannot be found. I have started Apache and MySQL in XAMPP - I initially had issues starting Apache but followed a tutorial which told be to change my Main Port to 8080 and my SSL port to 4433, which was all fine and dandy - that's running now - but could that have something to do with the localhost still not working?
You would have to change your http port 80 and SSL to 443 in order to use the default localhost without :8080 or :4433. In order to do that, you need to check that nothing is already running on these ports. That would typically be another web server.

SMTP MAIL FROM AUTH= format to connect to gmail

I have an older PHP system that uses SMTP commands for mail. We are switching over to gmail and I need to authenticate. I can connect to the server. Unfortunately, I get a 530-5.5.1 Authentication Required. Learn more at" message when I send the MAIL FROM command in my PHP code.
if (fputs($this->Socket, "MAIL FROM: \"admin\" <admin#yourdomain.com>\r\n")<0){
I cannot find a clear example of adding authentication. I read at http://www.faqs.org/rfcs/rfc2554.html that I must add AUTH= to my MAIL FROM command. I am having troubles interpretting what to put in the AUTH=
Examples:
C: MAIL FROM:<e=mc2#example.com> AUTH=e+3Dmc2#example.com
S: 250 OK
Do you know the format of authentication?
There are several ways to do SMTP authentication, but one of them is to use the SMTP AUTH LOGIN command. The transcript of the session would look like this:
host: 220 banner_here
client: EHLO StephaniePC
host: 250-name.of.host hello [clientip], pleased to meet you
host: 250-AUTH LOGIN PLAIN
host: 250 OK
client: AUTH LOGIN
host: 334 VXNlcm5hbWU6
client: am9lc21pdGg=
host: 334 UGFzc3dvcmQ6
client: bGV0bWVpbg0K
host: 235 2.7.0 Authentication successful
client: MAIL FROM: <sender#senderdomain.tld>
host: 250 2.1.0 Ok
client: RCPT TO: <recipient#recipientdomain.tld>
host: 250 2.1.0 Ok
client: DATA
host: 354 End data with <CR><LF>.<CR><LF>
....
The encoded strings that you see above are base64 encoded. If you have a mail client that is capable of logging, you can try sending a message through gmail, and the transcript of the session should look like the transcript above.
FYI, instead of writing code yourself to do SMTP authentication, you might want to use phpmailer. phpmailer can do SMTP authentication, and it's very lightweight and easy to use.

Webmin port 25 is blocked

I have set up webmin on my CentOS server with a few domains. I have also added a test email account but cannot send any emails from my Outlook after configuring the settings for IMAP/STMP server. If I try and telnet to port 25, i get an error. Iptables isn't blocking port 25, postfix server is running and ISP isn't blocking any ports. I have also tried turning off iptables which made no difference.
Any ideas?