Jump to content
Sign in to follow this  
joywrite_007

Automated Script Untuk Aix

Recommended Posts

Masalah

Setiap pagi aku kena datang kerja sebelum pukul 9 untuk "Up"kan server AIX dkat ofis aku..Masalahnya...yang pegang kunci ofis merangkap kepada exec. aku selalu datang lambat..Aku pun kekadang boring gak pasal nak buat S.O.D sekurang-kurangnya 15 minit..nak tunggu server tu "Shutdown"&"reboot" dalam 15 minit....Jadi aku terpk nak buat satu script yang boleh buat automated login& hantar beberapa command string dkat server tu..

Peralatan
terminal dungu wyse60
terminal dungu ibm3151
Dell Desktop
IBM server(AIX)

Perisian
NetTerm Client
telnet client

Penyelesaian:

So far aku dah buat research dkat google,kalau nak buat automated script untuk telnet memang agak mustahil pasal sekurang-kurangnya aku kena gunakan third party script (perl,php,expect)untuk execute&hantar data dkat server tu.Lagipun aku memang kurang mahir sket kalau bab2 php&perl ni..dkat bawah ni contoh autobatch script yang aku cuba untuk mengautomatedkan loginnya

TELNET batchfile
@echo off
cls
title automated
echo "M.I.S SWP"
echo "
echo "
echo"
START TELNET 190.120.x.x
root
hahaha

//bile dah execute batch file ni..tak boleh nak send "username"&"password"

NetTerm Script

expect 60 "username:"
output "root^M"
expect 60 "password:"
output "hahaha^M"
expect 60 "$"
output "cd /home^M"
output "ls -ail^M"
output"cp haha.txt haha.txt"

//Bile aku gunakkan script function dkat NetTerm,boleh send "username"&"password",tapi masalahnya aku tak boleh nak execute multiple script dalam satu session.

Aku pun baru gak dengan *nix family ni..harap-harap ade "otai" dkat sini yang boleh bagi "clue" dkat aku..TQ

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...