zabbix trigger on ssh logins: Invalid parameter "/1/expression": incorrect expression starting from - zabbix

Im trying to set a trigger on zabbix to alert me on ssh logins on a template.
I have created an item SSH login with log[/var/log/auth.log,"Accepted .*",,,skip,\0]
This is my expression for the trigger:
Linux by Zabbix agent active:log[/var/log/auth.log,"Accepted .*",,,skip,\0].change()
I have followed the docs here https://www.zabbix.com/documentation/5.2/en/manual/config/triggers/expression
I get the error message :
Invalid parameter "/1/expression": incorrect expression starting from "{Linux by Zabbix agent active:log[/var/log/auth.log,"Accepted .*",,,skip,\0].change()}>0".
I have tried with braces {}, with change(>0), with brace and >0 after ({Linux by Zabbix agent active:log[/var/log/auth.log,"Accepted .*",,,skip,\0].change()}>0)
Any hints on how to do that?
Thanks

Related

Value for 'configPath' when running checkForServerUpgrade on AWS RDS

To prepare my upgrade from mysql 5.7 to mysql 8, I want to run the upgrade utility checker. Here's what I did so far:
installed mysqlsh on my machine
started mysqlsh
executed util.checkForServerUpgrade targeting the server that I want to upgrade
Here's the exact command that I used in step 3:
util.checkForServerUpgrade('root#my-remote-host:3306', { "password":"my-password" })
This runs fine but some checks are not executed because I don't provide the configPath parameter. For example, here's a warning that I get:
14) Removed system variables for error logging to the system log configuration
To run this check requires full path to MySQL server configuration file to be specified at 'configPath' key of options dictionary
More information:
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-13.html#mysqld-8-0-13-logging
Anybody knows the value that I should provide for the configPath parameter?
I've tried to do the same using the command util.checkForServerUpgrade defining the configPath, without success. I then tried to run the same command directly from outside the mysqlsh shell, with success:
mysqlsh -- util check-for-server-upgrade root#localhost --target-version=8.0.13 --output-format=JSON --config-path=/etc/mysql/my.cnf
and it worked. To be noted that when I've tried to run from mysqlsh in the session root#localhost the command:
util.checkForServerUpgrade({"configPath":"/etc/mysql/my.cnf"})
mysqlsh replied with:
"Util.checkForServerUpgrade: Argument #1: Invalid values in connection options: configPath (ArgumentError)"
Try putting in the connection string, for example,
util.checkForServerUpgrade('root#localhost',{'configPath': '/etc/my.cnf'})
This worked for me, but without the connection string it doesn't.

Cannot acces instance using compute ssh : "ERROR: [....putty.exe] exited with return code [1]

Here's my problem :
I would like to connect to a gcp instance. When I run the Google Cloud SDK shell as an administrator with the command :
gcloud compute ssh my_instance --zone=europe-west1-b -- -L=8081:locahost:8081
..I get this error : ERROR (gcloud.compute.ssh) [..../putty.exe] exited with return code [1]
My instance is running with the metadata enable-oslogin as TRUE, as the project.
Do you have an idea of what is the problem ?
When using -- in the command, you are passing SSH flags after the dashes and not gcloud command flags. To explain, gcloud compute ssh is a thin wrapper around the ssh(1) command that takes care of authentication and the translation of the instance name into an IP address.
In this case, -- is equivalent to --ssh-flag as per this SDK reference. It seems that putty is outputting an error that is not passed into the command line (SDK shell). The actual error should be visible in the dialog window before putty exits.
I have tried the command myself on Windows and the exact error was unknown option "L=8081:localhost:8081". The SSH flag is not accepted as you have an = sign there (typo).
According to linuxcommand.org manual, the flag should be in this format:
-L [bind_address:]port:host:hostport
Hence, you should run the command like this:
gcloud compute ssh my_instance --zone=europe-west1-b -- -L 8081:locahost:8081
Note also that you may have to create a firewall rule to allow Ingress to the instance on port 8081.

Authentication error in freeradius server

I have installed freeradius server on Ubuntu-14.04, when I try take radtest on server using, radtest -x bob root123 127.0.0.1 1812 testing123
I get following error when I run freeradius -X,
[sql] User bob not found
++[sql] returns notfound >++[expiration] returns noop >++[logintime] returns noop >[pap] WARNING! No "known good" password found for the user. >Authentication may fail because of this. >++[pap] returns noop >ERROR: No authenticate method (Auth-Type) found for the request: >Rejecting the user >Failed to authenticate the user >Using Post-Auth-Type Reject
I have added user in users file, bob Cleartext-Password := "root123"
In eap.conf file, default_eap_type = peap
Still getting an error, can anyone help me to resolve my issue?
Have you enabled the text-file as a valid source for your users?
The error message seems like you just enabled sql but not the
#
# Read the 'users' file
files
in the sites-enabled/default (and innter-tunnel)
Hopefully this fixes your problem

emacs and mysql on windows 7

I have been using emacs for writing programs and recently I want to execute SQL queries through it , I run the following commands and get the following error:
M-x sql-Mysql
then I just press return and then
user:
password:
database:
server:
and I get the error
" unable to locate sql program mysql "
I have searched for two continuous days and got the suggestions to edit .emacs file but of no use. I am using windows 7.
My init file looks like this :
(setq sql-connection-alist
'((pool-a
(sql-product 'mysql)
(sql-server "1.2.3.4")
(sql-user "me")
(sql-password "mypassword")
(sql-database "thedb")
(sql-port 3306))
(pool-b
(sql-product 'mysql)
(sql-server "1.2.3.4")
(sql-user "me")
(sql-password "mypassword")
(sql-database "thedb")
(sql-port 3307))))
(defun sql-connect-preset (name)
"Connect to a predefined SQL connection listed in `sql-connection-alist'"
(eval `(let ,(cdr (assoc name sql-connection-alist))
(flet ((sql-get-login (&rest what)))
(sql-product-interactive sql-product)))))
(defun sql-pool-a ()
(interactive)
(sql-connect-preset 'pool-a))
well,i think,it does not need to put that code in my init file so i erased all that.in fact i need not put any thing in the init file for mysql to run.i just filled in the appropriate details in the following fields:
user:root
password:which i have created during mysql installation
database:i left this field blank
server:localhost
then no problem occurred and i could run the sql commands as usual as i would in a normal mysql command window.what i made out from it that server as 'localhost' and user as 'root' are the main parameters and should work in probably all the cases(if you are running mysql server on your system through emacs. password to be filled is the password entered during the time of installation.

Not Able to stop Mysql

I want to stop mysql inorder to start it in rescue mode to retrieve my mysql password but its showing my me an error message and won't stop.
service mysql stop
OUTPUT:
stop: Rejected send message, 1 matched rules; type="method_call",
sender=":1.131" (uid=1000 pid=7640 comm="stop mysql ")
interface="com.ubuntu.Upstart0_6.Job" member="Stop" error
name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart"
(uid=0 pid=1 comm="/sbin/init")
output of
etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the
service(8) utility, e.g. service mysql stop
Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
stop: Rejected send message, 1 matched rules; type="method_call",
sender=":1.129" (uid=1000 pid=7246 comm="stop mysql ")
interface="com.ubuntu.Upstart0_6.Job" member="Stop" error
name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart"
(uid=0 pid=1 comm="/sbin/init") subhransu#subhransu-Inspiron-1545:~$
service mysql stop stop: Rejected send message, 1 matched rules;
type="method_call", sender=":1.130" (uid=1000 pid=7400 comm="stop
mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error
name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart"
(uid=0 pid=1 comm="/sbin/init")
Try:
sudo service mysql stop
You have to be root to start and stop mysql server.
If you are not root, you must be a sudo-able user, you must use the command sudo and you must know your sudo-password.