Welcome, Guest. Please Login.
04/19/24 at 02:21:13
News:
Home Help Search Login


Pages: 1 2 
Send Topic Print
DBA Report-to-Web (Read 11748 times)
GasGiant
Administrator
*****


How can I help?

Posts: 1523
Gender: male
Re: DBA Report-to-Web
Reply #15 - 08/28/07 at 07:59:01
 
The site has been having DNS problems since yesterday. Hopefully it will be fixed soon.
Back to top
 
 


Email WWW GasGiant GasGiant 31012781 swordworlder swordworlder   IP Logged
kkmfg
Senior Member
****


Ghost of the code

Posts: 411
Gender: male
Re: DBA Report-to-Web
Reply #16 - 08/28/07 at 10:37:12
 
Quote from GasGiant on 08/28/07 at 07:59:01:
The site has been having DNS problems since yesterday. Hopefully it will be fixed soon.

 
Yeah the DNS host is still messed up but probably later today the wiki will move to it's rightful home at the same provider that is hosting the other ISTech sites. This should make it faster and have better uptime.
Back to top
 
 

Collin
K & K Manufacturing, Inc

EvoERP Version 1-22-10 SP3
5 User Workgroup Pervasive 10
Email WWW   IP Logged
GasGiant
Administrator
*****


How can I help?

Posts: 1523
Gender: male
Re: DBA Report-to-Web
Reply #17 - 10/19/07 at 06:21:57
 
I'm moving into new territory and thought that I would pick the ample brains on this board.
 
I've been hosting my data mining web application on a little WinXP box on my desk. Soon the app will move to our new Intranet server. I have never set up an ODBC client on a Linux machine before and was wondering if others have and what pitfalls there might be. This will be my chance to get it right so that it will not be an unknown factor when it comes time to configure the new web server in January.
Back to top
 
 


Email WWW GasGiant GasGiant 31012781 swordworlder swordworlder   IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 785
Gender: male
Re: DBA Report-to-Web
Reply #18 - 10/19/07 at 14:26:04
 
Our Intranet site runs on Ubuntu Server 7.10
I have documented the entire installation process.
 
Currently our Intranet is use as:
 
- Web Server - Apache/PHP5
- Pervasive client - Pervasive.SQL-Client-8.70 (Pervasive Server runs on Windows 2003)
- Windows File Server - Samba Server/Client
- Dataserver - Mysql
 
Currently, I am working on script to email information from/and to DBA Users, Customer, Supplies.  
Sort of  "Notification Feature".
 
Regards,
 
Kelloggs
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 785
Gender: male
Re: DBA Report-to-Web
Reply #19 - 11/23/07 at 11:49:07
 
Here is a very simple but functional way to send notices to users
 
Server: Ubuntu
Email Server: sendmail
 
1.- You need to install lynx
sudo apt-get install lynx  
 
2.- Create your query. I use mysql_connect because I transfer data from Pervasive to MySQL. But you can modify it to odbc_connect()
 
This simple php script will do "something" everytime if find a record.
 
<?
//conneccion
mysql_connect("localhost", "root", "")  or die("Unable to connect to SQL server");
//sql script
$sql="SELECT EID, SONUM, CUSNME, PCODE, PDESC FROM uni_ship_email WHERE ESTATUS='N'";
 
$result = mysql_db_query("umcnet", $sql) or die("Unable to select Database");
$row = mysql_num_rows($result);
while ($row = mysql_fetch_array($result)) {
$EID=$row["EID"];
$SONUM=$row["SONUM"];
$CUSNME=$row["CUSNME"];
$PCODE=$row["PCODE"];
 
//-------------------------EMAIL IT
$to = "john_doe@home.com";
$from_header = "UNI Ship/Rec Server";
$subject = "UNI SHP/REC NEW ITEM RECVD. SO: ".$SONUM;
$body = "A New Item has been received.\n\nSO Number: ".$SONUM."\n\nSKU: ".$PCODE;
mail($to, $subject, $body, $from_header);
 
//-------------------------UPDATE RECORD
$sq = "UPDATE uni_ship_email SET ESTATUS='Y' WHERE EID=$EID";  
mysql_db_query("umcnet", $sq) or die("Unable to select Database");
}
mysql_close();
?>
 
3.- Add a Cron Job
 
open /var/spool/cron/crontabs/root
add the following line
 
0,15,30,45 * * * * lynx -dump  http://intranet/uni/SHIP/send_email.php    
 
where "http://intranet/uni/SHIP/send_email.php" is the path to your script on your website.
 
 
Done!!
 
It will send an email whenever finds a record  
 
 
Regards,
 
Kelloggs
 
 
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
kkmfg
Senior Member
****


Ghost of the code

Posts: 411
Gender: male
Re: DBA Report-to-Web
Reply #20 - 11/26/07 at 07:45:11
 
Quote from Kelloggs on 11/23/07 at 11:49:07:


0,15,30,45 * * * * lynx -dump http://intranet/uni/SHIP/send_email.php

where "http://intranet/uni/SHIP/send_email.php" is the path to your script on your website.


 
Umm... If you are running the server and/or able to install cron jobs then why not just:
 
0,15,30,45 * * * * php /var/www/uni/SHIP/send_email.php
 
That cuts lynx right out of it. PHP works fine all by itself.
Back to top
 
 

Collin
K & K Manufacturing, Inc

EvoERP Version 1-22-10 SP3
5 User Workgroup Pervasive 10
Email WWW   IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 785
Gender: male
Re: DBA Report-to-Web
Reply #21 - 11/26/07 at 07:59:29
 
if php is setup as an apache module it will not work.  
It will work only if php is Compiled as CGI
 
Regards,
 
Kelloggs
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
kkmfg
Senior Member
****


Ghost of the code

Posts: 411
Gender: male
Re: DBA Report-to-Web
Reply #22 - 11/26/07 at 09:54:31
 
Quote from Kelloggs on 11/26/07 at 07:59:29:
if php is setup as an apache module it will not work.
It will work only if php is Compiled as CGI

Regards,

Kelloggs

 
I do it all of the time. PHP should have both it's command line version and it's apache module both installed. I use PHP as a module on our server but I sometimes run the PHP scripts locally with the command line PHP. It works just fine.
Back to top
 
 

Collin
K & K Manufacturing, Inc

EvoERP Version 1-22-10 SP3
5 User Workgroup Pervasive 10
Email WWW   IP Logged
Pages: 1 2 
Send Topic Print