Syslog 2.1 - Doesn't show any register

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Syslog 2.1 - Doesn't show any register

Post by rsanchezre »

Hi,
I'm running cacti 1.1.6 and syslog plugin 2.1. When i try to see some syslog register (Syslog tab - System logs), it doesn't show me any of them.

I made the following,

- I've check that the syslog plugin was installed correctly.
- I've set up the config.php correcty.
- I've checked that syslog messages are comming from devices and they are inserted into syslog_incomming table of MySQL.
- I've checked that syslog_host table is filling up.
- I've not have error messages in cacti logs.

So, I'd apprecite if you could tell me what can i see to resolve my issue
Regards.
Rodrigo
Last edited by rsanchezre on Fri May 19, 2017 9:44 am, edited 1 time in total.
rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Re: Syslog 2.1 - Doesn't show any register

Post by rsanchezre »

As additional information, i added alert roules and when i go to Alert Logs tab, registers are shown me correctly
Alert Logs.PNG
Alert Logs.PNG (32.38 KiB) Viewed 3224 times
but as I said, when i go to system logs tab (same period), does not shown any thing and should show something
system logs.png
system logs.png (22.66 KiB) Viewed 3224 times
Well, I'd appreciate some help
Regards
rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Re: Syslog 2.1 - Doesn't show any register

Post by rsanchezre »

Could some one healp me??
Regards
itkroplis
Posts: 20
Joined: Sun Jun 04, 2017 6:25 am

Re: Syslog 2.1 - Doesn't show any register

Post by itkroplis »

Show syslog-ng conf, syslog config.php
rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Re: Syslog 2.1 - Doesn't show any register

Post by rsanchezre »

Hi Itkroplis,

Thanks for answer....
Here you have both configurations

this is sylog-ng config file

source s_all {
udp(ip("0.0.0.0") port(514));
};

destination d_mysql {
sql(
type(mysql)
host("localhost") username("cactiuser") password("XXXXXXXX")
database("syslog")
table("syslog_incoming")
columns("facility_id","priority_id","programn","date","time","host","message")
values("$FACILITY_NUM","$LEVEL_NUM","$PROGRAM","$YEAR-$MONTH-$DAY","$HOUR:$MIN:$SEC","$HOST_FROM","$MSG")
);
};

destination remotos { file("/var/log/BST-$YEAR$MONTH$R_syslog.log"); };

log {
source(s_all);
destination(d_mysql);
destination(remotos);
};




and this is config.php (/usr/share/cacti/site/plugins/syslog)

*/

global $config, $database_type, $database_default, $database_hostname;
global $database_username, $database_password, $database_port;

/* revert if you dont use the Cacti database */
$use_cacti_db = false;

if (!$use_cacti_db) {
$syslogdb_type = 'mysql';
$syslogdb_default = 'syslog';
$syslogdb_hostname = 'localhost';
$syslogdb_username = 'cactiuser';
$syslogdb_password = 'XXXXXXXX';
$syslogdb_port = 3306;
}else{
$syslogdb_type = $database_type;
$syslogdb_default = $database_default;
$syslogdb_hostname = $database_hostname;
$syslogdb_username = $database_username;
$syslogdb_password = $database_password;
$syslogdb_port = $database_port;
}

/* field in the incomming table */
$syslog_incoming_config['dateField'] = 'date';
$syslog_incoming_config['timeField'] = 'time';
$syslog_incoming_config['priorityField'] = 'priority_id';
$syslog_incoming_config['facilityField'] = 'facility_id';
$syslog_incoming_config['hostField'] = 'host_id';
$syslog_incoming_config['textField'] = 'message';
$syslog_incoming_config['id'] = 'seq';

?>


Regards.
rcsmota
Posts: 7
Joined: Fri Sep 08, 2017 6:38 am

Re: Syslog 2.1 - Doesn't show any register

Post by rcsmota »

Hi;

Your syslog_incomming table is on syslog data base or cacti data base?
User avatar
Pucho
Cacti User
Posts: 185
Joined: Wed Jul 20, 2016 8:00 pm

Re: Syslog 2.1 - Doesn't show any register

Post by Pucho »

rsanchezre wrote: destination d_mysql {
sql(
type(mysql)
host("localhost") username("cactiuser") password("XXXXXXXX")
database("syslog")
table("syslog_incoming")
columns("facility_id","priority_id","programn","date","time","host","message")
values("$FACILITY_NUM","$LEVEL_NUM","$PROGRAM","$YEAR-$MONTH-$DAY","$HOUR:$MIN:$SEC","$HOST_FROM","$MSG")
);
};

You've got a typo in there that might be causing your syslog-ng to fail the query to the database.

programn != program

Code: Select all

MariaDB [cacti]> describe syslog_incoming;
+-------------+---------------------+------+-----+---------+----------------+
| Field       | Type                | Null | Key | Default | Extra          |
+-------------+---------------------+------+-----+---------+----------------+
| facility_id | int(10) unsigned    | YES  |     | NULL    |                |
| priority_id | int(10) unsigned    | YES  |     | NULL    |                |
| program     | varchar(40)         | YES  | MUL | NULL    |                |
| date        | date                | YES  |     | NULL    |                |
| time        | time                | YES  |     | NULL    |                |
| host        | varchar(64)         | YES  |     | NULL    |                |
| message     | varchar(1024)       | NO   |     |         |                |
| seq         | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| status      | tinyint(4)          | NO   | MUL | 0       |                |
+-------------+---------------------+------+-----+---------+----------------+
Cacti - 1.2.15
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets
rsanchezre
Posts: 10
Joined: Wed Oct 10, 2012 12:32 pm

Re: Syslog 2.1 - Doesn't show any register

Post by rsanchezre »

Thanks Pucho for help me to find my mistake. I've fixed this parameter and now is working fine.
Thanks again.
Regards
Rodrigo
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests