convert a MS Windows vb script to a Linux –ash shell script
$30-250 USD
Terminado
Publicado hace alrededor de 9 años
$30-250 USD
Pagado a la entrega
I need to convert a MS Windows getalarms vb script to a Linux –ash shell script.
Using the –ash shell, This script will need to open a file named “event-XXXXX” file located in the “/tmp/alarms” folder, parse it and send an email using mutt. The Linux shell scrip will need to reference a “[login to view URL]” file the contains email address to be sent to.
I would also like the script file to be modified in the ‘** Get the Zone section to us a “[login to view URL]” file where the zones can be named outside of the script.
The email sent can look something like this:
Hello, Your Alarm System has Alarms
Alarm Time: 17:48:52,08-22-2013
Alarm Message: 1234181100334440
Account Number: 1234
Event Qualifier: New Event or Opening
Event Code: 100
Zone: 444
Partition Number: 33
This is an automated E-mail, Do not reply.
I did the script. How can i send it to you? The begin of the script is here:
#/bin/ash
# Petrasl
error() {
echo $1
echo '
--- [login to view URL] ------------------------------
# Emails separated by space
ToEmail="emails goes here"
--- [login to view URL] ------------------------------
# Alarm zones file Format: azXXX="Any message", where X is AlphaNumeric value
az000="-INFORMATION"
az001="-Not Identifyed"
az002="-FRONT DOOR" # some commens could be here too
'
exit 1
}
# Main setup
App_Name="[login to view URL]"
FromEmail="Email [login to view URL]"
EmailSubject="You have a New Event"
# Qualifiers and events also could be moved to external file
q1="New Opening"
q3="New Closing"
q6="Previously reported event still present"
# Looking for config files
[[ ! -f [login to view URL] ]] && error "No [login to view URL] file found" || . [login to view URL]
[[ ! -f [login to view URL] ]] && error "No [login to view URL] file found" || . [login to view URL]
[[ -z $ToEmail ]] && error "Incorect [login to view URL] file"
# Setting up mutt
cat>.muttrc<<EOF
set from = "$FromEmail"
set realname = "$App_Name"
EOF
alarm() {
# explode the string
message=${1}
account=${1:0:4}
Data3=${1:5:2}
qualifier=${1:7:1}
event=${1:8:3}
partition=${1:11:2}
zone=${1:13:3}
Data8=${1:16:1}
$30 USD en 1 día
5,0 (7 comentarios)
3,0
3,0
7 freelancers están ofertando un promedio de $72 USD por este trabajo
Hello,
I have wronte many script for shell in linux. Most of the time I write for
Bash, but I can do it for ASH too.
The modification you ask, will be done too.
Thanks.
Hi, im good with linux shell scripts and im confident that i can doo this. i have read your job description and identified that the script would require alot of filtering of text from a file - which im good at along with validation
N/B: For me to do this project you must create a milestone for the working request and please also stick to the job description
Hello. More 20 years programming experience.
do you accept another script language except shell? perl, python for example.
Regards.
---------------------------------------------------------------------------------------------------------------------------------------------------
We are a dedicated Team of Linux SME/Senior Linux Admin/Senior Principal Infrastructure Engineer/Network Admin. We can work on this project and deliver to your satisfaction within timeline with data accuracy and quality for lower bid. Resume can be forwarded up on request.