FreePBX 2.10 odbc storage - asterisk

I would like to store voicemessages over odbc to mysql database.
Is app_voicemail compiled with odbc storage support?
This question cause setup in:
- "FreePBX 2.11" ask me to enable file-storage or odbc-storage'
- "FreePBX 2.10" same question is not asked.
Maybe cause support only 'file-storage'?
When i leave a message in vocalmail, in the log there is no trace of 'sql insert'.
In all examples that I've seen, where is the sql statement to insert in the table the row of voicemessage?
ODBC DSN Settings
-----------------
Name: asterisk
DSN: asterisk-connector
Last connection attempt: 1970-01-01 01:00:00
Pooled: No
Connected: Yes
-----------------
root#pbx:~ $ isql asterisk root passw0rd
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
-----------------
/etc/asterisk/func_odbc.conf
[SQL]
dsn=asterisk-connector
readsql=${ARG1}
-----------------
/etc/asterisk/res_odbc.conf
[asterisk]
enabled => yes
dsn => asterisk-connector
username => root
password => passw0rd
pooling => no
limit => 1
pre-connect => yes
-----------------
/etc/odbc.ini
[asterisk-connector]
Driver = MySQL
Description = MySQL connection to .asterisk. database
Server = localhost
Port = 3306
User = root
Password = --------
Database = asterisk
Option = 3
Socket = /var/lib/mysql/mysql.sock
-----------------
/etc/asterisk/voicemail.conf
odbcstorage=asterisk
odbctable=voicemessages
-----------------

ODBC storage depend from asterisk module. Asterisk have be compiled with voicemail-odbc enabled
It have very small relation with freepbx web. It should work if module present and configured.

Related

How can I define local dependencies between roles in a collection in ansible?

I have a question about dependencies between roles in a collection.
In general, I am concerned if it is possible to define dependencies between roles in a collection - local dependencies like a relative path.
I would like to implement scenarios:
roleB depends on roleA
default scenario of roleC should use roleA in prepare.yml to set up the environment
or
default scenario of roleC should use roleA in converge.yml
I would like to get these dependencies as local dependencies.
For case 2, I tried to use the requriments.yml file
with the appropriate entry in molecule.yml
---
dependency:
name: galaxy
driver:
name: docker
platforms:
.. ...
provisioner:
name: ansible
# env:
# ANSIBLE_ROLES_PATH: "../../roles"
playbooks:
prepare: prepare.yml
config_options:
defaults:
remote_user: ansible
dependency:
name: galaxy
options:
ignore-certs: True
ignore-errors: True
requirements-file: requirements.yml
verifier:
name: ansible
But unfortunately I can't solve the error:
ERROR [1m[0;34mUsing /etc/ansible/ansible.cfg as config file[1m[0m
Starting galaxy role install process
- downloading role from file://../../tool-box
[1m[0;31m [ERROR]: failed to download the file: <urlopen error [Errno 2] No such file or[1m[0m
[1m[0;31mdirectory: '/../tool-box'>[1m[0m
[1m[1;35m[WARNING]: - tool-box was NOT installed successfully.[1m[0m
[1m[0;31mERROR! - you can use --ignore-errors to skip failed roles and finish processing the list.[1m[0m
Structure of collection with roles:
mynamespace
|
|-- mycollection
|
| --roles
|
| -- roleA --
| |--molecule
| |
| |--default
|
| -- roleB --
| |--molecule
| |
| |--default
|
| -- roleC --
| |--molecule
| |
| |--default
Thank you.
Update:
See request issue in ansible/galaxy:
https://github.com/ansible/galaxy/issues/2719
I added this because I don't think there is such functionality.

Connecting to Teradata with R through DBI and ODBC

I connect to Teradata using the Teradata SQL Assistant. The connection parameters consist of a server address and a driver (server info changed for privacy reasons), as shown below:
Name: my_teradata_connection
Teradata Server Info: 00.11.22.333
Data Source: Teradata Database ODBC Driver 16.20
UID: My_User_ID
PWD: My_PWD
I am trying to use R to connect to Teradata, using the DBI and odbc packages.
con <- DBI::dbConnect(odbc::odbc(),
Driver = "[your driver's name]",
Host = "[your server's path]",
DBCName = "[IP Address or Alias]"
UID = rstudioapi::askForPassword("Database user"),
PWD = rstudioapi::askForPassword("Database password"))
It seems obvious the Driver should be Teradata Database ODBC Driver 16.20. But where do I put the Teradata Server Info that we'll say is 00.11.22.333? Should it populate the Host or the DBCName arguments? And whichever one it does not populate, what will go there?
Usually, in most DB-APIs including ODBC connections server and host are synonymous keywords where you will not see both together but only one (of course with exceptions). Specifically, per odbc documentation, dbConnect maintains the optional server argument:
dbConnect(
drv,
dsn = NULL,
...,
timezone = "UTC",
timezone_out = "UTC",
encoding = "",
bigint = c("integer64", "integer", "numeric", "character"),
timeout = 10,
driver = NULL,
server = NULL,
database = NULL,
uid = NULL,
pwd = NULL,
dbms.name = NULL,
.connection_string = NULL
)
However, the ... indicates additional ODBC driver keywords that would be specific to corresponding driver, here being Terdata ODBC driver.
... Additional ODBC keywords, these will be joined with the other arguments to
form the final connection string
And from ODBC Driver for Teradata 16.20 documentation, Driver and DBCName are required keywords.DBCName appears to be synonymous to server or host given the IP address or alias indication.
DBCName = <IP-addr-or-alias>
| Keyword/Synonym | Description |
|-------------------------------------------------------------|-----------------------------------------------------------------------------------------|
| Driver=<driver-path> | [Required] The full path to the ODBC Driver for Teradata shared objects… |
| Description=<data-source-desc> | [Optional] Descriptive text about the data source. |
| DBCName=<IP-addr-or-alias> | [Required] The IP address or FQDN (fully qualified domain name) of the Teradata server… |
| Username=<name> or UID=<name> | [Optional] The default username for logging onto a Teradata server system. |
| Password=<password> | [Optional] The password required for the default Username. |
| DefaultDatabase=<database-name> Or Database=<database-name> | [Optional] The default database associated with the specified data source… |
| UPTMode | Default = NOTSET… |
Therefore in R, use the DBCName only. Below adds in the optional Database keyword.
# KEYWORD APPROACH
con <- DBI::dbConnect(odbc::odbc(),
Driver = "Teradata Database ODBC Driver 16.20",
DBCName = "00.11.22.333",
Database = "myDatabase",
UID = rstudioapi::askForPassword("Database user"),
PWD = rstudioapi::askForPassword("Database password"))
# CONNECTION STRING APPROACH
con_str = "Driver={Teradata Database ODBC Driver 16.20};DBCName=00.11.22.333;Database=myDatabase;"
con <- DBI::dbConnect(odbc::odbc(),
.connection_string = con_str,
UID = rstudioapi::askForPassword("Database user"),
PWD = rstudioapi::askForPassword("Database password")

Error!: SQLSTATE[42000] [1226] ‘max_user_connections’ resource (current value: 30), but max_user_connections is configured to 1000

Visitors get a Mysql error when a mysql user has exceeded the max_user_connections, returning the current value as 30, but max_connections and max_user_connections are set to 1000. When the problem occurs, the CPU reaches almost 98 %.
On mysql error logs we received a lot of access denied errors from another user, around 5000 denied connections. My problem is not why the PHP script takes all these connections, but to know why the configured variables, max_user_connections and max_connections are not applied. Those are configured to 1000, but the error message returns 30. How it is possible ?
I activated log_warnings=2, to get more information, but we don't get an extra information. Any idea why this behavior ? or How to audit mysql to find the source of this problem ?
The error message received is :
Error!: SQLSTATE[42000] [1226] User ‘some_user’ has exceeded the ‘max_user_connections’ resource (current value: 30)
select ##session.max_user_connections, ##global.max_connections;
+--------------------------------+--------------------------+
| ##session.max_user_connections | ##global.max_connections |
+--------------------------------+--------------------------+
| 1000 | 1000 |
+--------------------------------+--------------------------+`
show global variables like '%connections%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| extra_max_connections | 1 |
| max_connections | 1000 |
| max_user_connections | 1000 |
+-----------------------+-------+
show status like '%connected%';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Threads_connected | 4 |
+-------------------+-------+
select user,max_user_connections from mysql.user where host='localhost'\G
user: some_user
max_user_connections: 0
user: another_user
max_user_connections: 0`
The error seems to be :
Error: 1226 SQLSTATE: 42000 (ER_USER_LIMIT_REACHED)
Message: User '%s' has exceeded the '%s' resource (current value: %ld)
and not :
Error: 1203 SQLSTATE: 42000 (ER_TOO_MANY_USER_CONNECTIONS)
Message: User %s already has more than 'max_user_connections' active connections
We are using MariaDB, version :
select version();
+------------------------+
| version() |
+------------------------+
| 5.5.44-MariaDB-cll-lve |
+------------------------+
Solution :
You can reproduce the error with the following command :
mysqlslap -a --concurrency=500 --number-of-queries 5000 --iterations=500 --engine=innodb --debug-info -utest -p
The problem was caused by Governor, we have Cloudlinux installaed on the server, but this option was set OFF by default, but in this server was set to abusers. If the CPU is higher that 400 Gobernor set the max_user_connections for the user at 30.
You can check the logs on /var/log/dbgovernor-restrict.log
The solution si to set correctly this value or set off
dbctl --lve-mode off
/etc/container/mysql-governor.xml
<lve use="abuser"></lve>
<restrict level1="60s" level2="15m" level3="1h" level4="1d"
timeout="1h" log="/var/log/dbgovernor-restrict.log"
user_max_connections="30"></restrict>
<statistic mode="on"></statistic>
<default>
<limit name="cpu" current="400" short="380" mid="350" long="300">
</limit>

An unexpected error occurred with tcp plugin

I made a simple logstash configuration:
tcp.conf
input {
tcp {
port => 22
type => syslog
}
}
filter {
if [type] == "syslog" {
grok {
match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{#timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
syslog_pri { }
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss" ]
}
}
}
output {
stdout { codec => rubydebug }
}
running the configuration:
bin/logstash -f tcp.conf
executing this command:
telnet localhost 22
I get this error:
Using milestone 2 input plugin 'tcp'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}
Using milestone 1 filter plugin 'syslog_pri'. This plugin should work, but would benefit from use by folks like you. Please let us know if you find bugs or have suggestions on how to improve this plugin. For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}
+---------------------------------------------------------+
| An unexpected error occurred. This is probably a bug. |
| You can find help with this problem in a few places: |
| |
| * chat: #logstash IRC channel on freenode irc. |
| IRC via the web: http://goo.gl/TI4Ro |
| * email: logstash-users#googlegroups.com |
| * bug system: https://logstash.jira.com/ |
| |
+---------------------------------------------------------+
The error reported is:
Permission denied - bind(2)
I am doing this configuration fallow the Syslog example
"Permission denied - bind" means that logstash can't attach itself to the listed port.
Often, this is because you're running logstash as a non-privileged user who cannot access ports numbered below 1024.
In your case, you're trying to connect to port 22. As the ssh/scp/sftp port, this seems like an odd place to look for log files.

Oracle dataguard is not working properly because a FAL[client]

I had two databases, a primary and secondary and a configured dataguard between both, i restarted the suse linux but when starting up databases, the replication is not being done, i think i took the wrong way to startup the standby database....no it is just mounted, i have a gap not posibble to be detected at standby gap table, and a 'no FAL server specified' problem at standby database, what could be wrong?
From Primary:
System parameters with non-default values:
processes = 1200
nls_date_format = "MM/DD/YYYY HH24:MI:SS"
memory_target = 8000M
memory_max_target = 8G
control_files = "/oracle/app/oradata/ora11g/control01.ctl"
control_files = "/oracle/app/oradata/ora11g/control02.ctl"
control_files = "/oracle/app/oradata/ora11g/control03.ctl"
db_block_size = 8192
compatible = "11.1.0.0.0"
log_archive_start = TRUE
log_archive_dest_1 = "LOCATION=/home/oracle/archive"
log_archive_format = "%t_%s_%r.dbf"
db_recovery_file_dest = "/oracle/app/flash_recovery_area"
db_recovery_file_dest_size= 2G
undo_tablespace = "UNDOTBS1"
sec_case_sensitive_logon = FALSE
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=ora11gXDB)"
local_listener = ""
remote_listener = ""
session_cached_cursors = 450
cursor_sharing = "FORCE"
audit_file_dest = "/oracle/app/admin/ora11g/adump"
audit_trail = "NONE"
db_name = "ora11g"
open_cursors = 300
diagnostic_dest = "/oracle/app"
From standby database alert log:
Thu Feb 13 17:16:02 2014
Starting ORACLE instance (normal)
LICENSE_MAX_SESSION = 0
LICENSE_SESSIONS_WARNING = 0
Picked latch-free SCN scheme 3
Autotune of undo retention is turned on.
IMODE=BR
ILAT =145
LICENSE_MAX_USERS = 0
SYS auditing is disabled
Starting up ORACLE RDBMS Version: 11.1.0.7.0.
Using parameter settings in server-side spfile
/oracle/app/product/11g/db/dbs/spfileora11g.ora
System parameters with non-default values:
processes = 1200
nls_date_format = "MM/DD/YYYY HH24:MI:SS"
memory_target = 8000M
memory_max_target = 8G
control_files = "/oracle/app/oradata/ora11g/control01.ctl"
control_files = "/oracle/app/oradata/ora11g/control02.ctl"
control_files = "/oracle/app/oradata/ora11g/control03.ctl"
db_block_size = 8192
compatible = "11.1.0.0.0"
log_archive_start = TRUE
log_archive_dest_1 = "LOCATION=/home/oracle/archive"
log_archive_format = "%t_%s_%r.dbf"
db_recovery_file_dest = "/oracle/app/flash_recovery_area"
db_recovery_file_dest_size= 2G
undo_tablespace = "UNDOTBS1"
sec_case_sensitive_logon = FALSE
remote_login_passwordfile= "EXCLUSIVE"
db_domain = ""
dispatchers = "(PROTOCOL=TCP) (SERVICE=ora11gXDB)"
local_listener = ""
remote_listener = ""
session_cached_cursors = 450
cursor_sharing = "FORCE"
audit_file_dest = "/oracle/app/admin/ora11g/adump"
audit_trail = "NONE"
db_name = "ora11g"
open_cursors = 300
diagnostic_dest = "/oracle/app"
Deprecated system parameters with specified values:
log_archive_start
End of deprecated system parameter listing
Thu Feb 13 17:16:04 2014
.
.
.
starting up 1 dispatcher(s) for network address '(ADDRESS=(PARTIAL=YES) (PROTOCOL=TCP))'...
Thu Feb 13 17:16:04 2014
MMNL started with pid=15, OS id=10039
starting up 1 shared server(s) ...
ORACLE_BASE from environment = /oracle/app
Thu Feb 13 17:16:04 2014
ALTER DATABASE MOUNT
Setting recovery target incarnation to 2
ARCH: STARTING ARCH PROCESSES
Thu Feb 13 17:16:09 2014
ARC0 started with pid=19, OS id=10272
Thu Feb 13 17:16:09 2014
ARC1 started with pid=20, OS id=10274
Thu Feb 13 17:16:09 2014
ARC2 started with pid=21, OS id=10276
ARC0: Archival started
ARC1: Archival started
ARC2: Archival started
Thu Feb 13 17:16:09 2014
ARC3 started with pid=22, OS id=10278
ARC3: Archival started
ARCH: STARTING ARCH PROCESSES COMPLETE
ARC0: Becoming the 'no FAL' ARCH
ARC0: Becoming the 'no SRL' ARCH
ARC0: Thread not mounted
ARC1: Becoming the heartbeat ARCH
ARC2: Thread not mounted
ARC1: Thread not mounted
ARC3: Thread not mounted
Successful mount of redo thread 1, with mount id 4235628820
Physical Standby Database mounted.
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
FAL[client]: Error fetching gap sequence, no FAL server specified
Primary
SQL> select max(sequence#) from v$log_history;
MAX(SEQUENCE#)
--------------
1606
SQL> SELECT name FROM v$archived_log WHERE thread# = 1 AND dest_id = 1 AND sequence# BETWEEN 1591 and 1606;
/home/oracle/archive/1_1606_792822090.dbf
16 rows selected.
SQL> SELECT GROUP#, BYTES FROM V$LOG;
GROUP# BYTES
---------- ----------
1 52428800
2 52428800
3 52428800
Secondary
SQL> select max(sequence#) from v$log_history;
MAX(SEQUENCE#)
--------------
1591
SQL>select process, thread#, sequence#, status from v$managed_standby where process='MRP0';
no rows selected
SQL> SELECT GROUP#, BYTES FROM V$STANDBY_LOG;
no rows selected
You need to set to parameters in the init file or spfile(sqlplus)
In the Primary database :
FAL_SERVER='standby_database'
FAL_CLIENT='primary_database'
In the standby database :
FAL_SERVER='primary_database'
FAL_CLIENT='standby_database'
These two parameters are needed for fetching archived log files (FAL mean Fetch ArchiveLog).
Hope that i help you.
Kind
This question is 5 years old but I feel it hasn't been completely answered yet.
First how does oracle resolves the gap:
The MRP process is the one triggering the request for a GAP.
That process is turned on like so:
Without standby redo logs:
alter database recover managed standby database disconnect;
With standby redo:
alter database recover managed standby database using current logfile disconnect;
If you have only one standby database for your primary database, then fal_server and fal_client parameters actually don't need to be configured.
If the fal_server is missing, oracle will grab that information from log_archive_dest_n.
This means that log_archive_dest_2 needs to be configured also on the standby database.
So how to solve a GAP resolution issue:
Make sure log_archive_dest_n is setup in both primary and standby
Make sure that there's no typo in the "service" value of
log_archive_dest_n.
Make sure that the service value references a valid tns entry in tnsnames.ora
Make sure that the same password file is used on all nodes of your primary and standby cluster.
Make sure you can connect with sqlplus "sys/syspassword#primary as sysdba" and sqlplus "sys/syspassword#standby as sysdba" from both primary and standby.List item
The MRP process sends a GAP resolution requests every so often. If you want to get it immediately in order to make sure it works:
SQL>alter database recover managed standby database cancel;
SQL>alter database recover managed standby database using current logfile;
(use standby redo logs, it applies logs faster on standby)
fal_server and fal_client parameters actually exists if you want to setup a cascaded standby setup.
Primary DB A sends archived logs to standby B
If standby B becomes primary then send archived logs to standby C.
FAL behavior on 11.2 (Doc ID 1394472.1)
From 11.2 no need to mention FAL_CLIENT primary will take it from
log_archive_dest_n (remote destination standby from where it received
the FAL request) service.
FAL_SERVER And FAL_CLIENT Settings For Cascaded Standby (Doc ID 358767.1)

Resources