Hello Guest

Author Topic: Cron job emails  (Read 1208 times)

0 Members and 1 Guest are viewing this topic.

Offline luke.sipple

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Cron job emails
« on: March 06, 2015, 06:40:32 AM »
I am currently using Gmail to forward e-mail from Pandora FMS to our work e-mail accounts.  The gmail is getting spammed with cron job e-mails that are trying to send to root@xxxx@gmail.com.  Not even a valid e-mail address.  Where is this configured?  Because my alerting is working fine...

thanks!
-Luke

Offline antonio.s

  • Administrator
  • Smart member
  • *****
  • Posts: 278
  • Karma: 2
    • View Profile
Re: Cron job emails
« Reply #1 on: March 06, 2015, 07:53:24 AM »
Hello Luke,
If you have no alerts configured to send this e-mails, it could be due to some cron task that is running on your linux system, maybe on /etc/cron.d, cron.hourly, crontab...
Pandora doesn't send any e-mail or sets up the cronjobs by default if it is not configured manually.

Regards,
Antonio.

Offline luke.sipple

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Cron job emails
« Reply #2 on: March 07, 2015, 05:42:29 AM »
But it's referencing Pandora DB maintenance.  See below:

/etc/cron.hourly/pandora_db:


Pandora FMS DB Tool 5.1SP1RC1 PS141008 Copyright (c) 2004-2009 Artica ST
This program is Free Software, licensed under the terms of GPL License v2
You can download latest versions and documentation at http://www.pandorafms.org

Pandora DB now initialized and running (PURGE=45 days, COMPACT=0 days, STEP=1) .

 
  • Pandora FMS Enterprise module not available.


Starting at 2015-03-07 07:01:02
07:01:02 [PURGE] No data to purge in tagente_datos.
07:01:02 [PURGE] Deleting old export data from tserver_export_data

07:01:02 [PURGE] No data in tagente_datos_log4x.
07:01:02 [PURGE] No data to purge in tagente_datos_string.
07:01:02 [PURGE] Deleting old event data at tevento table (More than 7 days)....
07:01:02 [PURGE] Deleting old audit data (More than 15 days).
07:01:02 [PURGE] Deleting old SNMP traps data (More than 7 days).
07:01:02 [PURGE] Deleting old GID data (More than 7 days).
07:01:02 [PURGE] Deleting pending delete modules (data table).
07:01:02 [PURGE] Deleting pending delete modules (status, module table).
07:01:02 [PURGE] Deleting old access data (More than 24hr)
07:01:02 [PURGE] Agent access deletion progress %1
07:01:02 [PURGE] Agent access deletion progress %2
07:01:02 [PURGE] Agent access deletion progress %3
07:01:02 [PURGE] Agent access deletion progress %4
07:01:02 [PURGE] Agent access deletion progress %5
07:01:02 [PURGE] Agent access deletion progress %6
07:01:02 [PURGE] Agent access deletion progress %7
07:01:02 [PURGE] Agent access deletion progress %8
07:01:02 [PURGE] Agent access deletion progress %9
07:01:02 [PURGE] Agent access deletion progress %10

Offline antonio.s

  • Administrator
  • Smart member
  • *****
  • Posts: 278
  • Karma: 2
    • View Profile
Re: Cron job emails
« Reply #3 on: March 09, 2015, 09:15:13 AM »
Yes, this is the db purgation script, but it doesn't send any e-mail by default when it is executed.

Regards,
Antonio.

Offline marceamx

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
    • View Profile
Re: Cron job emails
« Reply #4 on: March 21, 2017, 08:30:45 AM »
I solved it with:

When cron starts a process, it captures any output that reaches stdout and stderr, and sends that in an email. To prevent these emails, you can re-direct the stdout and stderr, either to a logfile that you monitor, or /dev/null, if you don't care.

Edit pandora_db in /etc/cron.hourly

#!/bin/bash
perl /usr/share/pandora_server/util/pandora_db.pl /etc/pandora/pandora_server.conf 2>&1 > /dev/null

When cron starts a process, it captures any output that reaches stdout and stderr, and sends that in an email. To prevent these emails, you can re-direct the stdout and stderr, either to a logfile that you monitor, or /dev/null, if you don't care.