DreamOn Technical Blog

Author: DreamOn (Page 1 of 3)

Script to get Zenworks 11 Agent registration status

This script wil run the command line management interface for the Novell ZENworks Adaptive Agent that is installed on managed devices with the option security-location (sl) and  output the info in a message box.

I have written this script to implement in a installer script to wait until the agent is registered in de ZenWorks Server.

Dim WshShell, oExec, strText, strId, strName, strStream
Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Exec("zac sl")

Do While oExec.StdOut.AtEndOfStream <> True
strStream = trim(oExec.StdOut.ReadLine)

Select Case left(strStream,3)
Case "The"
If strstream = "The current security location is unknown." Then
strStatus = "No Location"
End If
Case "Id:"
strStatus = "Current Security Location:"
strId = strStream
Case "Nam"
strName= strStream
End Select

Loop

If strStatus = "Current Security Location:" Then
strText = strStatus & vbcrlf & strId & vbcrlf & strName
Else
strText = "The current security location is unknown."
End If

wscript.echo strText

More Console commands for Zenworks11 can be found here:
http://www.novell.com/documentation/zenworks11/pdfdoc/zen11_utils/zen11_utils.pdf

Setting up a SMSGateway part1

At work we have a little SMS gateway to send us a warning when a critical event is monitored by the server monitoring system. It’s a Windows XP machine with some old smsgateway software on it and a nokia 3310 connected with a data cable to the com port.

The system works like this:

  • A critical event is triggered on the monitoring server
  • The monitoring server sends an e-mail to the administrators sms mailbox
  • The SMS Gateway checks the sms mailboxes of every sms mailbox if there is a mail the smsgateway will send the e-mail as sms to the administrators mobile phone.

This system worked very well until a couple of months ago ….
The old software stopped to check the mailboxes and we had to manually restart the soft to get it working again for some hours when it stopped again. Not a good solution for an alert system.

So we needed a new system …

Continue reading

Linux WGET and APT-GET through a proxy

I always need to search how to solve the issue to get wget and apt-get working through a proxy server, therefore I’m posting it here.

On the prompt enter:

export http_proxy="http://<proxy server hostname>:<port>/" 

Replace <proxy server hostname> with the hostname of the proxyserver (eg: mickey.localdomain.local)
Replace <port> with the port the proxy uses (most common is port 8080)

If you need to login to your proxy use:

export http_proxy="http://<user>:<password>@<proxy server hostname>:<port>/" 

Replace <username> with your username
Replace <password> with your password

You can also set a proxy for ftp, gopher and wais
Here are some examples:

http_proxy="http://your.proxy.server:8080/";   export http_proxy
ftp_proxy="http://your.proxy.server:8080/";    export ftp_proxy
gopher_proxy="http://your.proxy.server:8080/"; export gopher_proxy
wais_proxy="http://your.proxy.server:8080/";   export wais_proxy

If you need to connect to host without connecting through the proxy you can use the no_proxy variable
eg:

export no_proxy="192.168.0.1,localdomain"

This will set an exception for 192.168.0.1 and the local domain named:localdomain

After a logoff or reboot the settings you just did will be forgotten to solve this you can enter the commands in the file /etc/profile.

 

Another way is to put everything in a script and run that script at login.

Install vmwaretools on SLES 11

This is a short step by step to install the vmware tools on SLES 11

Install gcc compiler

yast2 -i gcc

Install kernel headers

yast2 -i kernel-source

Mount the cdrom drive.
(In the vmware client select the virtual machine, select guest and select install vmware tools)

Make sure you have mounted the VMware tools virtual cd from the host before moving on.

mount /dev/cdrom /mnt/

Extract VMware tools to the tmp directory:

tar -C /tmp -zxvf /mnt/VMwareTools-x.x.x.tar.gz

Unmount the virtual cd:

umount /mnt

Make sure you run the following command from the Console, don’t try to run it using SSH because the network will be restarted and the installation will fail.

cd /tmp/vmware-tools-distrib
./vmware-install.pl

Accept the defaults for every question. Make sure you’re located inside the vmware-tools-distrib folder when executing the vmware-install.pl script or the installation will fail.

If during the setup you didn’t let the vmware-config-tools script run, run it:

/usr/bin/vmware-config-tools.pl

To finish the installation and start the virtual machine with VMware tools installed, reboot the virtual machine:

reboot

Install vmware tools on debian 6 (lenny)

Install kernel headers and some tools used to install VMware tools:

apt-get install binutils cpp gcc make psmisc linux-headers-$(uname -r) libglib2.0-0

Mount the cdrom drive. Make sure you have mounted the VMware tools virtual cd from the host before moving on.

mount /dev/cdrom /mnt/

Extract VMware tools to the tmp directory:

tar -C /tmp -zxvf /mnt/VMwareTools-x.x.x.tar.gz

Unmount the virtual cd:

umount /mnt

Make sure you run the following command from the Console, don’t try to run it using SSH because the network will be restarted and the installation will fail.

cd /tmp/vmware-tools-distrib
./vmware-install.pl

Accept the defaults for every question. Make sure you’re located inside the vmware-tools-distrib folder when executing the vmware-install.pl script or the installation will fail.

If during the setup you didn’t let the vmware-config-tools script run, run it:

/usr/bin/vmware-config-tools.pl

To finish the installation and start the virtual machine with VMware tools installed, reboot the virtual machine:

reboot

WordPress Down :-S

Hi guys,

I’m sorry for the long downtime.
I had to move my hosting to another provider and didn’t go as well as I thought it would :-S

One tip for you all do an export of you’re wordpress from time to time.
Now I had to rebuild my wordpress site from scratch with some sql imports for the content and file transfers for the photo’s, documents, plugins and themes.

But enough said the site is back up and I have a new post coming up …

VBscript: Check OS Version Information and Detect 32-bit or 64-bit Windows

A little script to check the version of the OS

Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
    Wscript.Echo "Boot Device: " & objOperatingSystem.BootDevice
    Wscript.Echo "Build Number: " & objOperatingSystem.BuildNumber
    Wscript.Echo "Build Type: " & objOperatingSystem.BuildType
    Wscript.Echo "Caption: " & objOperatingSystem.Caption
    Wscript.Echo "Code Set: " & objOperatingSystem.CodeSet
    Wscript.Echo "Country Code: " & objOperatingSystem.CountryCode
    Wscript.Echo "Debug: " & objOperatingSystem.Debug
    Wscript.Echo "Encryption Level: " & objOperatingSystem.EncryptionLevel
    dtmConvertedDate.Value = objOperatingSystem.InstallDate
    dtmInstallDate = dtmConvertedDate.GetVarDate
    Wscript.Echo "Install Date: " & dtmInstallDate
    Wscript.Echo "Licensed Users: " & _
        objOperatingSystem.NumberOfLicensedUsers
    Wscript.Echo "Organization: " & objOperatingSystem.Organization
    Wscript.Echo "OS Language: " & objOperatingSystem.OSLanguage
    Wscript.Echo "OS Product Suite: " & objOperatingSystem.OSProductSuite
    Wscript.Echo "OS Type: " & objOperatingSystem.OSType
    Wscript.Echo "Primary: " & objOperatingSystem.Primary
    Wscript.Echo "Registered User: " & objOperatingSystem.RegisteredUser
    Wscript.Echo "Serial Number: " & objOperatingSystem.SerialNumber
    Wscript.Echo "Version: " & objOperatingSystem.Version
Next

Detect 32-bit or 64-bit Windows

There are 2 options here

Set WshShell = CreateObject("WScript.Shell")

OsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")

If OsType = "x86" then
wscript.echo & "Windows 32bit system detected"
elseif OsType = "AMD64" then
wscript.echo & "Windows 64bit system detected"
end if

A simpler and more correcter way would be

wscript.echo GetObject("winmgmts:root\cimv2:Win32_Processor='cpu0'").AddressWidth

Putting this together in an Html Application (HTA) makes:

<html>
<head>
<title>Outlook ReProfiling ...</title>

<HTA:APPLICATION
ID="objHTAOutlReProfiling"
APPLICATIONNAME="OutlReProfiling"
SCROLL="no"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
>
</head>

<style type="text/css">
div.centered{
display:block;
position:absolute;
top:5%;
left:10%;
width:80%;
}
</style>

<body>
<div id=DataAreaNL>
</div>
</doby>
<SCRIPT Language="VBScript">
Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colOperatingSystems
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Boot Device: " & objOperatingSystem.BootDevice & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Build Number: " & objOperatingSystem.BuildNumber & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Build Type: " & objOperatingSystem.BuildType & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Caption: " & objOperatingSystem.Caption & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Code Set: " & objOperatingSystem.CodeSet & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Country Code: " & objOperatingSystem.CountryCode & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Debug: " & objOperatingSystem.Debug & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Encryption Level: " & objOperatingSystem.EncryptionLevel & "<br>"
dtmConvertedDate.Value = objOperatingSystem.InstallDate
dtmInstallDate = dtmConvertedDate.GetVarDate
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Install Date: " & dtmInstallDate  & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Licensed Users: " & _
objOperatingSystem.NumberOfLicensedUsers & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Organization: " & objOperatingSystem.Organization & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"OS Language: " & objOperatingSystem.OSLanguage & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"OS Product Suite: " & objOperatingSystem.OSProductSuite & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"OS Type: " & objOperatingSystem.OSType & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Primary: " & objOperatingSystem.Primary & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Registered User: " & objOperatingSystem.RegisteredUser & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Serial Number: " & objOperatingSystem.SerialNumber & "<br>"
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML &"Version: " & objOperatingSystem.Version & "<br>"
Next

Set WshShell = CreateObject("WScript.Shell")

OsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")

If OsType = "x86" then
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML & "Windows 32bit system detected" & "<BR>"
elseif OsType = "AMD64" then
DataAreaNL.InnerHTML=DataAreaNL.InnerHTML & "Windows 64bit system detected" & "<BR>"
end if

DataAreaNL.InnerHTML=DataAreaNL.InnerHTML & GetObject("winmgmts:root\cimv2:Win32_Processor='cpu0'").AddressWidth & "<BR>"

</SCRIPT>
</html>

Just received some new toys part 2

The third order also came in.
These are almost all the parts for the quadcopter.

More info about the arducopter (arduino based quadcopter)

http://code.google.com/p/arducopter/wiki/ArduCopter

Just received some new toys

I was thinking about doing some electronic projects for some time now.
So this year I got myself some presents.
Today the first 2 packages arrived 🙂

I bought some parts to build a UAV quadcopter and some parts to start playing with arduino.

Here are some pictures of the unpacking:

Now still waiting for my quadcopter parts ….

HomeLab: DNS step 2: Setting up a BIND slave DNS server on SLES

DNS will be a major service in our network and must be up and running 100% To accomplish this we will install a secondary DNS server (slave).

The purpose of a slave name server is to share the load with the master server, or handle the entire load if the master server is down. A slave name server loads its data over the network from another name server usually the master name server, but it can load from another slave name server too.
This process is called a zone transfer.

For the installation of a slave dns we need a second virtual machine:

  • 1 vCPU
  • 512 MB Ram
  • Harddisk – 10GB
  • Network to your operational lan (ip: 172.30.1.3)
  • OS SLES 11 (64-bit)
We need to install the bind package on this server to, and do an initial configuration of the server. Continue reading
« Older posts

© 2024 BioliZards.be

Theme by Anders NorenUp ↑