cloudshiftco
cloudshiftco
Cloud Shift
2 posts
Where the cloud shifting is possible 
Don't wanna be here? Send us removal request.
cloudshiftco · 4 years ago
Text
How to Send Journald Logs From CoreOS to Remote Logging Server ?
https://cloudshift.co/gnu-linux/coreos/how-to-send-journald-logs-from-coreos-to-remote-logging-server/
How to Send Journald Logs From CoreOS to Remote Logging Server ?
CoreOS is an operating system that goes beyond the ordinary. When you need to send the journald logs to remote server, it will not be so simple but it is not too hard too.
First of all you can configure the rsyslogd but it will not send the journald logs. Journald daemon logs the events and outputs as binary file.  Only solution is to be able to read that journald via journalctl command line utility.  So this means we can not configure rsyslogd for sending journald logs to the remote logging server( Elasticsearch, Splunk, Graylog, etc… )
First of all we need to create a systemd configuration file for sending the logs to the remote.
# vi /etc/systemd/system/sentjournaldlogs.service Description=Sent Journald Logs to Remote Logging Service After=systemd-journald.service Requires=systemd-journald.service [Service] ExecStart=/bin/sh -c "journalctl -f | ncat -u RemoteServerIP RemotePort" TimeoutStartSec=0 Restart=on-failure RestartSec=5s [Install] WantedBy=multi-user.target
You need to change RemoteServerIP and  RemotePort  with your remote logging server’s IP address and service port.
If you are using or the remote logging server is listening on standard ports that will be 514. If you look closely to the ncat command there is -u argument which specifies that the connection will use UDP.  If you want to use TCP then please delete -u argument.
# systemctl daemon-reload # systemctl enable sentjournaldlogs.service # systemctl start sentjournaldlogs.service # systemctl status sentjournaldlogs.service
We need to reload systemd daemon and start the service.  That’s all.
0 notes
cloudshiftco · 4 years ago
Text
How To Create a Cronjob on CoreOS ?
https://cloudshift.co/uncategorized/how-to-create-a-cronjob-on-coreos/
How To Create a Cronjob on CoreOS ?
Nowadays, cause of the features of CoreOS we have started to use it on our environments.
It is even more popular after the Red Hat has purchased it.  ıt is a little bit different operating system also known as immutable operating system. It has no package manager and cron utility.  So I ll explain other details on another post but today I am going to explain the details of that how can we enable cronjob on CoreOs .
As I mentioned there is no cron utility on CoreOS.  So only thing that we can do is to configure the systemd services.
First of all let s assume I have a script which needs to be executed everytime. So only one systemd configuration s enough to succeed.
# vi /scripts/executedbystsemd.sh !#/bin/bash echo "This command is executed by systemd"
  # vi /etc/systemd/system/runningeverytime.service [Unit] Description=This service is running everytime [Service] Type=oneshot ExecStart=bash /scripts/executedbysystemd.sh [Install] WantedBy=multi-user.target
1 note · View note