How to change prometheus alert manager port address - prometheus-alertmanager

I have downloaded prometheus alert manager from prometheus.io and try to run it.
Alert manager is not running because some of our internal applications are running on the port 9093.
So i need to change the alert manager running port from 9093 to some other port say 3002.
How to change this?

Run alertmanager binary with a --web.listen-address option. For example:
alertmanager --web.listen-address=http://localhost:9876
alertmanager --web.listen-address=http://:9876
This flag was added some time ago and can be found in output of alertmanager -h command.

Related

how to see client's ip address instead of hostname in remote syslogs

my client machine has syslog-ng and my remote machine has rsyslog configuration.
my server/remote machine manages many clients and I need to differentiate which machine is sending which logs.
normally I would use syslog-ng on the server side but these machines aren't meant to have them.
Also would like to mention it isn't for apache or web servers just physical machines.
On the client's side
Tried altering and adding different options or changing them to yes/no respectively.
options {
keep_hostname(yes);
create_dirs(no);
use_dns(no);
};
for eg:keep_hostname to no, it worked but only when I changed the hostname to the machine's ip address. which is not what I want.
Using a template
template("$(ISODATE) $(FULLHOST_FROM) $(SOURCEIP) $(HOST) $(HOSTNAME) ${PROGRAM}: ${MESSAGE}\n")
output:
day time localhost abc[ID] .source.s_local SourceIP=127.0.0.1 localhost localhost (root) CMD (xyz.conf)#ID
this isn't the output I want, it is printing in the message section when I want it in the place of the "host" and I don't understand how the source ip is the loopback address.
Using structured logging
rewrite r_sourceip{
set('${SOURCEIP}' value(HOST));
};
log { source(s_local); rewrite(r_sourceip);destination(d_syslog_tcp); };
output:
and the ip is displayed in the logs as the loopback address instead of the machine ip.
day date time 127.0.0.1 syslog-ng.service: Succeeded.
Tried installing rsyslog on my client but it doesn't work
sudo add-apt-repository ppa:adiscon/v8-stable
sudo apt-get update
sudo apt-get install rsyslog
I kept running into many errors, fixing them was impossible due to the difference in OS version or type maybe.
add apt repository command not found
wget command not found
On the server's side
Using a template
which creates a folder with the client's hostname and stores the logs in that particular folder.
not the solution I want.
$template DynaFile,"/var/log/%FROMHOST-IP%/%syslogfacility-text%.log"
*.* -?DynaFile
I want the logs to appear as such
day date time `client's ip address` syslog-ng.service: Succeeded.
Can someone suggest me a solution and why I keep getting the loopback address as my client's ip?

Azure container App fails to start with Julia image

I am trying to run Julia code in azure container app, but it fails for some reason.
docker file is pretty simple:
FROM julia:1.7-bullseye
COPY . /
EXPOSE 8080
RUN julia --project='/' -e 'using Pkg; Pkg.build()'
ENTRYPOINT julia --project='/' main.jl "0.0.0.0" "8080"
"0.0.0.0" and "8080" there is the host and port on which HTTP is served:
HTTP.serve(GENERAL_ROUTER, host, port_restful_api)
The app supposed to run a simple HTTP server that is served over port 8080, GET to / is the health check that returns simple "Up"
When I run that same image locally with docker run -p 8080:8080 my-test:latest it works fine and hitting localhost:8080 gives me my expected response
But when I have it in container app - revision fails to be provisioned (and no extra errors provided). In the ingress I added availability to accept traffic from anywhere and target port is 8080...
What I am missing?
UPDATE
At the same time in log analytics I can see my output to console that should indicate that the app is supposedly running fine, e.g.
[ Info: API handler service: Running on thread 1
In Julia those are done with
#info "API Server: Running on thread $(Threads.threadid())"
But in logs those are in stderr stream. Could it be that the ACA treats any output to stderr as startup error?
UPDATE 2:
The very same code works without any issues or changes on Azure Container Instance and in Azure Kubernetes Service...
So for now I stopped investigating and decided to use ACI.
You should verify if any process inside the julia image needs root privileges as ACA do not support running privileged containers based on the docs:
Azure Container Apps can't run privileged containers. If your program
attempts to run a process that requires root access, the application
inside the container experiences a runtime error.
Did you specify 8080 as your target port when configuring the HTTP ingress of your Container App? https://learn.microsoft.com/en-us/azure/container-apps/ingress?tabs=bash
The platform will try to ping your app at the specified port due to the default health probes. If it receives no response, it will restart your app: https://learn.microsoft.com/en-us/azure/container-apps/health-probes?tabs=arm-template

Running taurus command from master node on azure containers which is unable to reach slave node due to error in method java.rmi.MarshalException

Error at master node trying to connect to remote jmter slave node in same network
You need to ensure that at least port 1099 is open, check out How to open ports to a virtual machine with the Azure portal article for more details.
Apart from port 1099 you need to open:
The port you specify as the server.rmi.localport on slaves
The port you specify as the client.rmi.localport on master
More information:
Remote hosts and RMI configuration
JMeter Distributed Testing with Docker
JMeter Remote Testing: Using a different port

Azure AppService, Container fails to start even though NextJS is up

I'm trying a simple NextJS server in an Azure AppService, and the container fails to start, even though the logs indicate that NextJS is up and ready to server files. The code works fine locally.
My code is here: https://github.com/CutieDarkFae/Catz
The container log finishes with:
***2020-06-11T08:43:19.032969810Z Extracting modules...
2020-06-11T08:43:44.262867136Z Done.
2020-06-11T08:43:45.328947365Z
2020-06-11T08:43:45.328985465Z > cats#0.1.0 start /home/site/wwwroot
2020-06-11T08:43:45.328992064Z > next start
2020-06-11T08:43:45.328996364Z
2020-06-11T08:43:47.016355156Z ready - started server on http://localhost:3000***
But the AppService logs end with:
2020-06-11T08:46:44.113Z INFO - Waiting for response to warmup request for container catz_0_39a9d511. Elapsed time = 210.9209243 sec
2020-06-11T08:46:59.249Z INFO - Waiting for response to warmup request for container catz_0_39a9d511. Elapsed time = 226.0570954 sec
2020-06-11T08:47:03.323Z ERROR - Container catz_0_39a9d511 for site catz did not start within expected time limit. Elapsed time = 230.1311154 sec
2020-06-11T08:47:03.326Z ERROR - Container catz_0_39a9d511 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2020-06-11T08:47:03.342Z INFO - Stopping site catz because it failed during startup.
How can I get the container to notice that the app is up and running? and not to time out?
Or is an AppService the wrong place to put a NextJS server?
It looks like your app is starting on port 3000 but the App Service is expecting it on port 8080.
Set the app setting WEBSITES_PORT to 3000. https://learn.microsoft.com/en-us/azure/app-service/containers/configure-custom-container
The suggestion here didn't work for me alas, it kept trying on 8080 no matter what :(
What did work is the approved answer here:
unable to deploy next js to azure
I would have preferred a much simpler solution though
As Silent mentioned. Kindly use app setting WEBSITES_PORT to set the port for your own docker image while for blessed images use PORT environment variable as the listening port.
In your application, please use the PORT or WEBSITES_PORT (as applicable) environment variable as the main web server’s listening port, instead of using a hardcoded port number ( on app start-up on locahost:3000). The PORT environment variable is automatically set by App Service platform at startup time.
As mentioned, you could try these ways:
Use the EXPOSE instruction in your Dockerfile to expose port 3000.
Use the WEBSITES_PORT app setting with a value of "3000" to expose that port.
If the issue still persist, just to isolate, you could change the script to - "/home/site/wwwroot/node_modules/next/dist/bin/next start" and change the change the port 80 and see if that helps.

Unable to Connect Jenkins Windows 10 Slave to Master running

My environment:
Master:
Azure VM running Ubuntu 14.10
Docker (1.9) running Jenkins Image
I have added port 8080 (for UI) and 50000 (for slave) as endpoints on the Azure VM.
Slave:
Windows 10 (running on Mac via BootCamp)
Configured the firewall to allow inbound and outbound traffic on port 50000 (that slave jnlp seems to be using).
I can access my Jenkins Master install over the web. I am trying to configure the slave on my Windows 10 m/c. I have tried all 3 methods to configure the slave.
Each time after several retries, the slave throws the "Connection Refused" error (screenshot attached).
Slave Error Screenshot
Can someone help point me in the right direction? I have little knowledge of Linux systems but proficient with Windows.
I have tried the workaround here but it hasn't worked for me.
There's three things that I think you can check here:
Check that you expose port 50000 on your Jenkins docker container. Check for the Dockerfile, there must be a clause EXPOSE 5000 or something. Or when you run your container run it with something like this: docker run -it -p 50000:50000 which maps local post 50000 to the containers port 50000.
Check that you don't have any security rules on Azure blocking port 50000 to your Azure VM. Don't know about Azure but in AWS you allow port 50000 in your security group(s).
Check your Azure VM's firewall. Is it Windows? Check the firewall and allow port 50000. Is it Linux ? Check iptables and allow port 50000.
Hope it helps.

Resources