DreamOn Technical Blog

Month: May 2012

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.

© 2024 BioliZards.be

Theme by Anders NorenUp ↑