Re: [PacketFence-users] maintenance script with remote database

2016-09-29 Thread Louis Munro

> On Sep 29, 2016, at 4:41 AM, Morris, Andi  wrote:
> 
> Yes, I have now commented out the DB dump from the main script and am running 
> that separately. As mentioned, this means that if I want the script to clean 
> up the tables, and optimise I still need the mariadb daemon to be running on 
> the packetfence server. I was basically wondering whether this is a required 
> check in this situation.


Hi Andy,
The check that looks for the pid file of the database is only meant to prevent 
the script from needlessly running on servers where packetfence is running but 
the database is not hosted locally.

The cleanup and optimize commands can be run remotely from the PacketFence 
server to the database server.
The data will not be transferred and so there is no problem with those commands.

The log4perl errors are because you don't have log4perl installed on the 
database server.

Regards,
--
Louis Munro
lmu...@inverse.ca   ::  www.inverse.ca 
 
+1.514.447.4918 x125  :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu ) and 
PacketFence (www.packetfence.org )

--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users


Re: [PacketFence-users] maintenance script with remote database

2016-09-29 Thread Morris, Andi
Hi Louis,
The error was to do with calls for log4perl.pm coming from the 
databasecleaner.pl script. I can get the exact error if you need it.

Yes, I have now commented out the DB dump from the main script and am running 
that separately. As mentioned, this means that if I want the script to clean up 
the tables, and optimise I still need the mariadb daemon to be running on the 
packetfence server. I was basically wondering whether this is a required check 
in this situation.

Cheers,
Andi

From: Louis Munro [mailto:lmu...@inverse.ca]
Sent: 28 September 2016 17:44
To: packetfence-users@lists.sourceforge.net
Subject: Re: [PacketFence-users] maintenance script with remote database


On Sep 28, 2016, at 11:55 AM, Morris, Andi 
<amor...@cardiffmet.ac.uk<mailto:amor...@cardiffmet.ac.uk>> wrote:

Apologies, I mean the database cleaner script being run remotely, not the 
optimisation.



What was the error?
Of course, if you run the database backup script on another server you will 
need to copy to database-cleaner script and all it's dependencies to it.

It may be simpler to edit the backup script to only run the cleaner and not 
dump the database and then run it from the PF server.


Regards,
--
Louis Munro
lmu...@inverse.ca<mailto:lmu...@inverse.ca>  ::  
www.inverse.ca<http://www.inverse.ca>
+1.514.447.4918 x125  :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu<http://www.sogo.nu>) and 
PacketFence (www.packetfence.org<http://www.packetfence.org>)

--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users


Re: [PacketFence-users] maintenance script with remote database

2016-09-28 Thread Louis Munro

> On Sep 28, 2016, at 11:55 AM, Morris, Andi  wrote:
> 
> Apologies, I mean the database cleaner script being run remotely, not the 
> optimisation.



What was the error?
Of course, if you run the database backup script on another server you will 
need to copy to database-cleaner script and all it's dependencies to it.

It may be simpler to edit the backup script to only run the cleaner and not 
dump the database and then run it from the PF server.


Regards,
--
Louis Munro
lmu...@inverse.ca   ::  www.inverse.ca 
 
+1.514.447.4918 x125  :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu ) and 
PacketFence (www.packetfence.org )

--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users


Re: [PacketFence-users] maintenance script with remote database

2016-09-28 Thread Morris, Andi
Apologies, I mean the database cleaner script being run remotely, not the 
optimisation.

From: Morris, Andi
Sent: 28 September 2016 16:52
To: 'packetfence-users@lists.sourceforge.net' 
<packetfence-users@lists.sourceforge.net>
Subject: RE: [PacketFence-users] maintenance script with remote database

Hi Louis,
I’ve edited the script with the variables and the backup works fine on the DB 
server, it’s the optimisation that isn’t. However, presuming that running the 
optimisation commands doesn’t dump the database locally first that should be ok 
to run from the pf app server I guess. Although that does still mean I need to 
have mariadb running on the packetfence server.

I’ll keep playing with the script remotely to see what I can do.

Cheers,
Andi

From: Louis Munro [mailto:lmu...@inverse.ca]
Sent: 28 September 2016 16:02
To: 
packetfence-users@lists.sourceforge.net<mailto:packetfence-users@lists.sourceforge.net>
Subject: Re: [PacketFence-users] maintenance script with remote database


On Sep 28, 2016, at 10:34 AM, Morris, Andi 
<amor...@cardiffmet.ac.uk<mailto:amor...@cardiffmet.ac.uk>> wrote:

Hi Louis,
That makes sense, but in practice I get errors when running this on a server 
that hasn’t had packetfence installed as there are calls to log4perl.pm files 
in the database-clearner.pl script.


You would need to edit it to fill in some variables, like the db name, username 
and password.
Don't be afraid to play with the script.
There's nothing really fancy in there.


Out of interest, what’s the danger of running this script from a packetfence 
server against a remote db server? Is it likely to cause an issue?


The issue is that it would have to copy the database over the network and dump 
the copy on the server you are running it from.
While that is doable, it is not really recommended.
You might end up saturating the link between those two servers during the dump.

Regards,
--
Louis Munro
lmu...@inverse.ca<mailto:lmu...@inverse.ca>  ::  
www.inverse.ca<http://www.inverse.ca>
+1.514.447.4918 x125  :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu<http://www.sogo.nu>) and 
PacketFence (www.packetfence.org<http://www.packetfence.org>)

--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net<mailto:PacketFence-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/packetfence-users
--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users


Re: [PacketFence-users] maintenance script with remote database

2016-09-28 Thread Morris, Andi
Hi Louis,
I’ve edited the script with the variables and the backup works fine on the DB 
server, it’s the optimisation that isn’t. However, presuming that running the 
optimisation commands doesn’t dump the database locally first that should be ok 
to run from the pf app server I guess. Although that does still mean I need to 
have mariadb running on the packetfence server.

I’ll keep playing with the script remotely to see what I can do.

Cheers,
Andi

From: Louis Munro [mailto:lmu...@inverse.ca]
Sent: 28 September 2016 16:02
To: packetfence-users@lists.sourceforge.net
Subject: Re: [PacketFence-users] maintenance script with remote database


On Sep 28, 2016, at 10:34 AM, Morris, Andi 
<amor...@cardiffmet.ac.uk<mailto:amor...@cardiffmet.ac.uk>> wrote:

Hi Louis,
That makes sense, but in practice I get errors when running this on a server 
that hasn’t had packetfence installed as there are calls to log4perl.pm files 
in the database-clearner.pl script.


You would need to edit it to fill in some variables, like the db name, username 
and password.
Don't be afraid to play with the script.
There's nothing really fancy in there.



Out of interest, what’s the danger of running this script from a packetfence 
server against a remote db server? Is it likely to cause an issue?


The issue is that it would have to copy the database over the network and dump 
the copy on the server you are running it from.
While that is doable, it is not really recommended.
You might end up saturating the link between those two servers during the dump.

Regards,
--
Louis Munro
lmu...@inverse.ca<mailto:lmu...@inverse.ca>  ::  
www.inverse.ca<http://www.inverse.ca>
+1.514.447.4918 x125  :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu<http://www.sogo.nu>) and 
PacketFence (www.packetfence.org<http://www.packetfence.org>)

--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net<mailto:PacketFence-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/packetfence-users
--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users


Re: [PacketFence-users] maintenance script with remote database

2016-09-28 Thread Louis Munro
On Sep 28, 2016, at 10:34 AM, Morris, Andi  wrote:Hi Louis,That makes sense, but in practice I get errors when running this on a server that hasn’t had packetfence installed as there are calls to log4perl.pm files in the database-clearner.pl script. You would need to edit it to fill in some variables, like the db name, username and password.Don't be afraid to play with the script. There's nothing really fancy in there.Out of interest, what’s the danger of running this script from a packetfence server against a remote db server? Is it likely to cause an issue?The issue is that it would have to copy the database over the network and dump the copy on the server you are running it from.While that is doable, it is not really recommended.You might end up saturating the link between those two servers during the dump.
Regards,--Louis Munrolmu...@inverse.ca  ::  www.inverse.ca +1.514.447.4918 x125  :: +1 (866) 353-6153 x125Inverse inc. :: Leaders behind SOGo (www.sogo.nu) and PacketFence (www.packetfence.org)


--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users


Re: [PacketFence-users] maintenance script with remote database

2016-09-28 Thread Morris, Andi
Hi Louis,
That makes sense, but in practice I get errors when running this on a server 
that hasn’t had packetfence installed as there are calls to log4perl.pm files 
in the database-clearner.pl script.

Out of interest, what’s the danger of running this script from a packetfence 
server against a remote db server? Is it likely to cause an issue?

Cheers,
Andi

From: Louis Munro [mailto:lmu...@inverse.ca]
Sent: 28 September 2016 14:26
To: packetfence-users@lists.sourceforge.net
Subject: Re: [PacketFence-users] maintenance script with remote database

Hi Andi,

The script will run but not backup the database if it's not running locally.
That is what the check for the `hostname`.pid does.

It will only backup the PF files that are present locally in that case.

I suggest you run that script on the database server itself.

The script does not send an email on it's own.
Cron may send one, depending on how it's configured.

Makes sense?


On Sep 27, 2016, at 9:14 AM, Morris, Andi 
<amor...@cardiffmet.ac.uk<mailto:amor...@cardiffmet.ac.uk>> wrote:

Hi,
An update to this. It does seem to work well if the packetfence server is also 
running the mariadb service. Mine wasn’t as there’s no need for it if the 
database is on a remote server. Starting it meant that I could run the 
maintenance job and see the backups being created, aswell as the optimisation 
being run.

Would you like me to log this as an issue on github?

On a related note, I can see that issue 1415 
https://github.com/inverse-inc/packetfence/issues/1415 mentions an email that 
is generated when this script is run. I’ve never had that email. Is it 
something that should be sent to the user designated for PF alerts? If not, is 
there scope for this to be added as an option?

Cheers,
Andi


Regards,
--
Louis Munro
lmu...@inverse.ca<mailto:lmu...@inverse.ca>  ::  
www.inverse.ca<http://www.inverse.ca>
+1.514.447.4918 x125  :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu<http://www.sogo.nu>) and 
PacketFence (www.packetfence.org<http://www.packetfence.org>)

--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users


Re: [PacketFence-users] maintenance script with remote database

2016-09-28 Thread Louis Munro
Hi Andi,

The script will run but not backup the database if it's not running locally.
That is what the check for the `hostname`.pid does. 

It will only backup the PF files that are present locally in that case.

I suggest you run that script on the database server itself.

The script does not send an email on it's own.
Cron may send one, depending on how it's configured.

Makes sense?


> On Sep 27, 2016, at 9:14 AM, Morris, Andi  wrote:
> 
> Hi,
> An update to this. It does seem to work well if the packetfence server is 
> also running the mariadb service. Mine wasn’t as there’s no need for it if 
> the database is on a remote server. Starting it meant that I could run the 
> maintenance job and see the backups being created, aswell as the optimisation 
> being run.
>  
> Would you like me to log this as an issue on github?
>  
> On a related note, I can see that issue 1415 
> https://github.com/inverse-inc/packetfence/issues/1415 
>  mentions an email 
> that is generated when this script is run. I’ve never had that email. Is it 
> something that should be sent to the user designated for PF alerts? If not, 
> is there scope for this to be added as an option?
>  
> Cheers,
> Andi
> 

Regards,
--
Louis Munro
lmu...@inverse.ca   ::  www.inverse.ca 
 
+1.514.447.4918 x125  :: +1 (866) 353-6153 x125
Inverse inc. :: Leaders behind SOGo (www.sogo.nu ) and 
PacketFence (www.packetfence.org )

--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users


Re: [PacketFence-users] maintenance script with remote database

2016-09-27 Thread Morris, Andi
Hi,
An update to this. It does seem to work well if the packetfence server is also 
running the mariadb service. Mine wasn't as there's no need for it if the 
database is on a remote server. Starting it meant that I could run the 
maintenance job and see the backups being created, aswell as the optimisation 
being run.

Would you like me to log this as an issue on github?

On a related note, I can see that issue 1415 
https://github.com/inverse-inc/packetfence/issues/1415 mentions an email that 
is generated when this script is run. I've never had that email. Is it 
something that should be sent to the user designated for PF alerts? If not, is 
there scope for this to be added as an option?

Cheers,
Andi

From: Morris, Andi [mailto:amor...@cardiffmet.ac.uk]
Sent: 21 September 2016 10:16
To: packetfence-users@lists.sourceforge.net
Subject: [PacketFence-users] maintenance script with remote database

Hi all,
I've recently moved to a setup which has a remote database server, and I was 
wondering whether the regular addons/database-backup-and-maintenance.sh file 
will still run from the packetfence server to the remote DB server. I can see 
the flags inside the script calling for the database hostname, so I assume it 
does, however when I scheduled it to run last night I didn't get a DB dump 
saved, whereas I did get the files dump, so I'm also concerned that the table 
optimisation wouldn't run, and these are likely to get pretty large if not.

Cheers,
Andi
--
___
PacketFence-users mailing list
PacketFence-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/packetfence-users