Page 1 of 1 1
Topic Options
#167640 - 2006-09-14 08:00 AM SQL action during start & stop
Schuliebug Offline
Hey THIS is FUN
*****

Registered: 2002-01-18
Posts: 379
Loc: Netherlands
Hi everybody,

I'm looking at a way to log the status of a machine into a SQL database. I would like to insert an entry into the SQL database when starting the machine and remove that same enttry when stopping the machine. I tried this using startup & shutdown scripts via a GPO, but that doesn't work becuase the IP stack isn't up at that moment.

I do know how to enter entries into a SQL database, i already have some inventory tool in place (inventory client and a control gui), but these are working at logon and logoff and i would like to check the machine settings apart from the user settings.


(this question is also posted on KiXforms.org)
_________________________
Kind regards,

Top
#167641 - 2006-09-14 01:33 PM Re: SQL action during start & stop
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Well, I do not have experience building connections to SQL server, but maybe these links can help:
ODBCSQL
ConnectionStrings.com

Top
#167642 - 2006-09-14 01:59 PM Re: SQL action during start & stop
Schuliebug Offline
Hey THIS is FUN
*****

Registered: 2002-01-18
Posts: 379
Loc: Netherlands
Solved it! The scripts used a function library on a share which was not available at startup. I now that function library is on the local harddisk and use uit from there. Now my inventory runs fine:
  • @ Machine startup: machine inventory runs and machine entry in activeuser table
  • @ user logon: user inventory and entry insert in activeuser table changed from 'not logged on' to username
  • @user logoff: entry in activeuser table changed from username to 'not logged on'
  • @ Machine shutdown: machine entry removed from activeuser table
_________________________
Kind regards,

Top
#167643 - 2006-09-14 02:02 PM Re: SQL action during start & stop
private_meta Offline
Getting the hang of it

Registered: 2006-07-27
Posts: 80
Loc: Austria
If it's a normal SQL Server from Microsoft, all you need is the right Connection Connection String
($DSN = "Driver={SQL Server};Server=servername;Database=dbname;Uid=userid;Pwd=password;")

and the UDF DBCommand()
_________________________
-=If you absolutly believe you can make up talent with hard work, there is no limit to what you can't achieve.=-

Top
#167644 - 2006-09-14 04:08 PM Re: SQL action during start & stop
Schuliebug Offline
Hey THIS is FUN
*****

Registered: 2002-01-18
Posts: 379
Loc: Netherlands
Correct, only.... The UDF should be located locally and not on something like @LDrive+'udffile'....
_________________________
Kind regards,

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1636 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.054 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org