Need help with writing a perl script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help with writing a perl script
# 8  
Old 11-19-2008
well now i'm getting nothing as an output...

my ShowQueues_leaiprod.sh full results are:

Code:
[root@leaiprod1 scripts]# ./ShowQueues_leaiprod.sh
Found active server: tcp://leaiprod1:7222
Found active server: tcp://leaiprod1:7222
$TMP$.EAI-ENG.37F54896B7BB34C7890D.1391 0       0
$TMP$.EAI-ENG.37F54896B7BB34C78A59.360604       0       0
$TMP$.EAI-ENG.37F54896B7BB34C78C67.1376 0       0
$TMP$.EAI-ENG.37F54896B7BB34C78CD7.360607       0       0
$TMP$.EAI-ENG.37F54896B7BB34C78D4D.1392 0       0
$TMP$.EAI-ENG.37F54896B7BB34C78DBB.360605       0       0
$TMP$.EAI-ENG.37F54896B7BB34C78E04.1377 0       0
$TMP$.EAI-ENG.37F54896B7BB34C78E64.360608       0       0
$TMP$.EAI-ENG.37F54896B7BB34C78F5E.360606       0       0
$TMP$.EAI-ENG.37F54896B7BB34C791AA.1393 0       0
$TMP$.EAI-ENG.37F54896B7BB34C7928B.1378 0       0
$TMP$.EAI-ENG.37F54896B7BB34C793E7.360609       0       0
$TMP$.EAI-ENG.37F54896B7BB34C79468.1394 0       0
$TMP$.EAI-ENG.37F54896B7BB34C795BE.1379 0       0
$TMP$.EAI-ENG.37F54896B7BB34C79729.1395 0       0
$TMP$.EAI-ENG.37F54896B7BB34C7986E.360607       0       0
$TMP$.EAI-ENG.37F54896B7BB34C798D9.1380 0       0
$TMP$.EAI-ENG.37F54896B7BB34C79912.1381 0       0
$TMP$.EAI-ENG.37F54896B7BB34C79A19.1382 0       0
$TMP$.EAI-ENG.37F54896B7BB34C79B05.1396 0       0
$TMP$.EAI-ENG.37F54896B7BB34C79B76.360610       0       0
$TMP$.EAI-ENG.37F54896B7BB34C79D2E.360608       0       0
$TMP$.EAI-ENG.37F54896B7BB34C79DC2.1397 0       0
$TMP$.EAI-ENG.37F54896B7BB34C79EB8.1383 0       0
$TMP$.EAI-ENG.37F54896B7BB34C79EBD.1398 0       0
$TMP$.EAI-ENG.37F54896B7BB34C7A030.360611       0       0
$TMP$.EAI-ENG.37F54896B7BB34C7A09F.360609       0       0
$TMP$.EAI-ENG.37F54896B7BB34C7A1F1.360612       0       0
$TMP$.EAI-ENG.37F54896B7BB34C7A3B8.1384 0       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6B88423.71103    1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6C2E4EA.83094    1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6C84629.85201    1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6C847B7.85252    1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6D0D2D5.95808    1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6DA87F9.108648   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6DA8FCD.108678   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6DA9EC7.108689   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6DA9F11.108665   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6DABDDD.108716   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6DAFA1F.108785   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6DB41DE.108872   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6DFE4C6.113398   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6EB46A5.125050   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6EC9538.126486   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6EF48CB.128633   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6EF4FEC.128663   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6EF5034.128642   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6F8051D.141157   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F6F925F9.141442   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F705B755.156893   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F705DA32.156898   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70D2D07.165954   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70D2D1A.165955   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70D2D23.165899   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70D2D42.165956   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70D2D5C.165957   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70E0845.167481   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70E79A9.167992   1       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB015.4188934  0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB017.160655   0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB018.5819927  0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB09F.160663   0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0A3.8151106  0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0A4.5819945  0       0
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0AA.4188944  0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0AB.160664   0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0AC.8151109  0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0AD.8151110  0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0AF.8151111  0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0B0.1        0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0B2.268823   0       1
$TMP$.EMS-LEAIPROD.3F7248C0AD9F70EB0B4.2        0       1
$sys.admin      0       0
$sys.lookup     0       0
$sys.undelivered        0       0
>       0       0
application.log 0       2
application.log.converter       13      0
eai.log.process.activity        0       2
eai.log.process.data    5       20
eai_inspection.start_test       0       1
pl-it_prod.A.EngSystem.V.CD     0       1
pl-it_prod.A.EngSystem.V.CD.EAI_Eng-BWEAIEng-1.DynamicMain      0       1
pl-it_prod.A.EngSystem.V.CD.EAI_Eng-BWEAIEng-1.DynamicMain.Reply        0       1
pl-it_prod.A.EngSystem.V.CD.EAI_Eng-BWEAIEng-2.DynamicMain      0       1
pl-it_prod.A.EngSystem.V.CD.EAI_Eng-BWEAIEng-2.DynamicMain.Reply        0       1
pl-it_prod.A.Orchest.V.CD       0       1
pl-it_prod.A.Orchest.V.CD.Orchest-BWOrch1-1.DynamicMain 0       1
pl-it_prod.A.Orchest.V.CD.Orchest-BWOrch1-1.DynamicMain.Reply   0       1
pl-it_prod.A.Orchest.V.CD.Orchest-BWOrch1-2.DynamicMain 0       1
pl-it_prod.A.Orchest.V.CD.Orchest-BWOrch1-2.DynamicMain.Reply   0       1
pl-it_prod.A.ShavitTuxedo.V.CD  0       1
pl-it_prod.A.ShavitTuxedo.V.CD.ShavitTuxedo-BWTux-1.DynamicMain 0       1
pl-it_prod.A.ShavitTuxedo.V.CD.ShavitTuxedo-BWTux-1.DynamicMain.Reply   0       1
pl-it_prod.A.ShavitTuxedo.V.CD.ShavitTuxedo-BWTux-2.DynamicMain 0       1
pl-it_prod.A.ShavitTuxedo.V.CD.ShavitTuxedo-BWTux-2.DynamicMain.Reply   0       1
pl-it_prod.AD.LDAP.V.CD.LDAPUserAuthGroups      0       4
pl-it_prod.AD.LDAP.V.CD.LDAP_ADInetOrgPerson    0       4
pl-it_prod.AD.LDAP.V.CD.LDAP_Bind       0       4
pl-it_prod.AD.LDAP.V.CD.LDAP_Groups     0       2
pl-it_prod.AD.LDAP.V.CD.LDAP_InetOrgPerson      0       2
pl-it_prod.AD.LDAP.V.CD.LDAP_Workstation        0       2
pl-it_prod.Columbus.Columbus-BWColumbus-1.admin 0       1
pl-it_prod.EAI_Eng.EAI_Eng-BWEAIEng-1.admin     0       1
pl-it_prod.EAI_Eng.EAI_Eng-BWEAIEng-2.admin     0       1
pl-it_prod.GW.Async     0       2
pl-it_prod.GW.Publish   0       2
pl-it_prod.GW.Sync      0       2
pl-it_prod.GW.Sync.reply.SCPROD.Upd_Soc_List    0       1
pl-it_prod.Gateways-B2B.GW.Async.Reply.JMS      0       2
pl-it_prod.Gateways-NPG.GW.Async.Reply.JMS      0       2
pl-it_prod.Gateways-Pele.GW.Async.Reply.JMS     0       2
pl-it_prod.Gateways.GW.Async.Reply.JMS  0       2
pl-it_prod.LDAP.LDAP-BWLDAP-1.admin     0       1
pl-it_prod.LDAP.LDAP-BWLDAP-2.admin     0       1
pl-it_prod.LDAP.adldap.LDAP-AdActiveDir-10.exit 0       1
pl-it_prod.LDAP.adldap.LDAP-AdActiveDir-11.exit 0       1
pl-it_prod.LDAP.adldap.LDAP-AdActiveDir-20.exit 0       1
pl-it_prod.LDAP.adldap.LDAP-AdActiveDir-21.exit 0       1
pl-it_prod.LDAP.adldap.LDAP-AdLDAP-1.exit       0       1
pl-it_prod.LDAP.adldap.LDAP-AdLDAP-2.exit       0       1
pl-it_prod.LoadTester.End       0       1
pl-it_prod.LoadTester.Test.End  0       1
pl-it_prod.MaofDB.MaofDB-BWMaof-1.admin 0       1
pl-it_prod.MaofDB.MaofDB-BWMaof-2.admin 0       1
pl-it_prod.NPG.NPG-BWNPG-1.admin        0       1
pl-it_prod.NPG.NPG-BWNPG-2.admin        0       1
pl-it_prod.Orchest.Orchest-BWOrch1-1.admin      0       1
pl-it_prod.Orchest.Orchest-BWOrch1-2.admin      0       1
pl-it_prod.P.Archive.V.CD       0       2
pl-it_prod.P.Columbus.V.CD      0       2
pl-it_prod.P.EngSystem.V.CD     0       2
pl-it_prod.P.LDAP.V.CD  0       2
pl-it_prod.P.MaofDB.V.CD        0       2
pl-it_prod.P.NPG.V.CD   0       2
pl-it_prod.P.Orchest.V.CD       0       2
pl-it_prod.P.PTL.V.CD   0       2
pl-it_prod.P.ShavitTuxedo.V.CD  0       2
pl-it_prod.S.Archive.V.CD       0       2
pl-it_prod.S.Columbus.V.CD      0       2
pl-it_prod.S.EngSystem.V.CD     0       2
pl-it_prod.S.LDAP.V.CD  0       2
pl-it_prod.S.MaofDB.V.CD        0       2
pl-it_prod.S.NPG.V.CD   0       2
pl-it_prod.S.Orchest.V.CD       0       2
pl-it_prod.S.PTL.V.CD   0       2
pl-it_prod.S.ShavitTuxedo.V.CD  0       2
pl.processes.Add_User_Soc-Callback.in   0       0
pl.processes.Close_User_Soc-Callback.in 0       0
stam    0       11
umts.processes.Add_User_Soc-Callback.in 0       0
umts.processes.Close_User_Soc-Callback.in       0       0

Sorry for not mentioned it completely before....

Thnaks again Smilie
# 9  
Old 11-19-2008
Edit: Try to save the output from the ShowQueues_leaiprod.sh script to a file and then run the Perl code with that file.

Last edited by radoulov; 11-19-2008 at 11:42 AM..
# 10  
Old 11-20-2008
Quote:
Originally Posted by radoulov
Edit: Try to save the output from the ShowQueues_leaiprod.sh script to a file and then run the Perl code with that file.
OK did it and it seemed to work!

but i'm check the whole queues and not only the 7 qaueues the in the trashold file... and second thing i think the trashold check is not consodering the "-" (minus) option...

Code:
[root@leaiprod1 scripts]# ./temp2.pl

Checking queue: application.log ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      50

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -1

Checking queue: eai.log.process.activity ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      50

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -1

Checking queue: eai.log.process.data ...

        --> queue threshold mismatch:

        current status: 1
        threshold:      50

        --> listeners threshold mismatch:

        current status: 20
        threshold:      -1

Checking queue: pl-it_prod.A.EngSystem.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.EngSystem.V.CD.EAI_Eng-BWEAIEng-1.DynamicMain ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.EngSystem.V.CD.EAI_Eng-BWEAIEng-1.DynamicMain.Reply ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.EngSystem.V.CD.EAI_Eng-BWEAIEng-2.DynamicMain ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.EngSystem.V.CD.EAI_Eng-BWEAIEng-2.DynamicMain.Reply ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.Orchest.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.Orchest.V.CD.Orchest-BWOrch1-1.DynamicMain ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.Orchest.V.CD.Orchest-BWOrch1-1.DynamicMain.Reply ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.Orchest.V.CD.Orchest-BWOrch1-2.DynamicMain ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.Orchest.V.CD.Orchest-BWOrch1-2.DynamicMain.Reply ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.ShavitTuxedo.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.ShavitTuxedo.V.CD.ShavitTuxedo-BWTux-1.DynamicMain ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.ShavitTuxedo.V.CD.ShavitTuxedo-BWTux-1.DynamicMain.Reply ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.ShavitTuxedo.V.CD.ShavitTuxedo-BWTux-2.DynamicMain ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.A.ShavitTuxedo.V.CD.ShavitTuxedo-BWTux-2.DynamicMain.Reply ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.AD.LDAP.V.CD.LDAPUserAuthGroups ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 4
        threshold:      -1

Checking queue: pl-it_prod.AD.LDAP.V.CD.LDAP_ADInetOrgPerson ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 4
        threshold:      -1

Checking queue: pl-it_prod.AD.LDAP.V.CD.LDAP_Bind ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 4
        threshold:      -1

Checking queue: pl-it_prod.AD.LDAP.V.CD.LDAP_Groups ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -1

Checking queue: pl-it_prod.AD.LDAP.V.CD.LDAP_InetOrgPerson ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -1

Checking queue: pl-it_prod.AD.LDAP.V.CD.LDAP_Workstation ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      100

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -1

Checking queue: pl-it_prod.GW.Sync.reply.SCPROD.Upd_Soc_List ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      500

        --> listeners threshold mismatch:

        current status: 1
        threshold:      -1

Checking queue: pl-it_prod.Gateways-B2B.GW.Async.Reply.JMS ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -1

Checking queue: pl-it_prod.Gateways-NPG.GW.Async.Reply.JMS ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -1

Checking queue: pl-it_prod.Gateways-Pele.GW.Async.Reply.JMS ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -1

Checking queue: pl-it_prod.Gateways.GW.Async.Reply.JMS ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -1

Checking queue: pl-it_prod.P.Archive.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.P.Columbus.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.P.EngSystem.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.P.LDAP.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.P.MaofDB.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.P.NPG.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.P.Orchest.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.P.PTL.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.P.ShavitTuxedo.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.S.Archive.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.S.Columbus.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.S.EngSystem.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.S.LDAP.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.S.MaofDB.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.S.NPG.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.S.Orchest.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.S.PTL.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

Checking queue: pl-it_prod.S.ShavitTuxedo.V.CD ...

        --> queue threshold mismatch:

        current status: 0
        threshold:      10

        --> listeners threshold mismatch:

        current status: 2
        threshold:      -2

thanks a million!
# 11  
Old 11-20-2008
Quote:
Originally Posted by eliraza6
OK did it and it seemed to work!

but i'm check the whole queues and not only the 7 qaueues the in the trashold file...
I need to scroll all the queues in order to check for matching in the thresholds file, but of course I can remove the message "checking queue ... " for the non-matching queues.


Quote:
and second thing i think the trashold check is not consodering the "-" (minus) option...
It's because, as I said, I don't understand what exactly you have to do with it. Could you clarify? What should be the action if you have for example:

threshold -1 and current state 1

or

threshold -1 and currenct state -1

etc.
# 12  
Old 11-20-2008
Looking at the code again, I'm already printing only the matching ones (using regular expressions) ... So, that's another point to clarify:

If you have a queue named pl-it_prod.A.* in the thresholds file, should I check every queue that matches that regex or no? Should I check pl-it_prod.AD.LDAP.V.CD.LDAP_Groups?
# 13  
Old 11-20-2008
Quote:
Originally Posted by radoulov
Looking at the code again, I'm already printing only the matching ones (using regular expressions) ... So, that's another point to clarify:

If you have a queue named pl-it_prod.A.* in the thresholds file, should I check every queue that matches that regex or no? Should I check pl-it_prod.AD.LDAP.V.CD.LDAP_Groups?
Yeah that's OK the the checking should be by regex like it is (thanks to you Smilie )

About the clarification:

Actually we have 2 queues for every queue name:
1. number of tasks waiting in the queue.
2. number of listeners that handling that queue.

Most of the times i need to check that i dont have over X tasks waiting & no "less" than Y listeners that are handling the queue.

The diagnosis of what should be check with "less" is by the symbol "-" (minus)...

for example:
"pl-it_prod.GW.>" "10" "-2" "" ""

the queue "pl-it_prod.GW.>" should have no more than 10 tasks waiting and no less than 2 listeners handling the queue.
# 14  
Old 11-20-2008
Try this:
Code:
#! /usr/bin/env perl


use warnings;
use strict;

my ($Thresholds_f, $Queue) = 
  ('/users/tibprod/scripts/EMS_Queue_List_leaiprod.ls', 
   '/users/tibprod/scripts/ShowQueues_leaiprod.sh|');
my %Thresholds_h;

open TH, '<', $Thresholds_f  or die "$Thresholds_f: $!\n";
  
while (<TH>) {
  tr/"//d;
  my @Fields = split /\s+/;
  $Thresholds_h{$Fields[0]} = [@Fields[1,2]];
  }

close TH;  


open QUEUE, $Queue or die "$Queue: $!\n";

while (<QUEUE>) {
  next unless /\w+\s+/;
  my $Flag = 0;
  my @Fields = split /\s+/;
  while (my($Key, $Ref) = each %Thresholds_h) {
    my @Values = @$Ref;
    if ($Fields[0] =~ /^$Key$/) {
      if (($Values[0] =~ s/^"*-//) && $Fields[1] < $Values[0]) {
        print "\n$Fields[0] ...".
        "\n\n\t--> task threshold exceeded: \n\n\tcurrent status: ",
        $Fields[1], "\n\tthreshold:      ", $Values[0], "\n";
        $Flag++
        }
      if ($Fields[1] > $Values[0]) {
        printf "\n$Fields[0] ..." unless $Flag;
        print "\n\n\t--> task threshold exceeded: \n\n\tcurrent status: ",
        $Fields[1], "\n\tthreshold:      ", $Values[0], "\n";
        $Flag++
        }      
      if (($Values[1] =~ s/^"*-//) && $Fields[2] < $Values[1]) {
         printf "\n$Fields[0] ..." unless $Flag;
         print "\n\t--> listeners threshold exceeded: \n\n\tcurrent status: ",
        $Fields[2], "\n\tthreshold:      ", $Values[1], "\n";
        $Flag++
        }
      if ($Fields[2] > $Values[1]) {
        printf "\n$Fields[0] ..." unless $Flag;
        print "\n\n\t--> listeners threshold exceeded: \n\n\tcurrent status: ",
        $Fields[1], "\n\tthreshold:      ", $Values[0], "\n";
        }      
      }
    }
  }  
  
close QUEUE;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Writing xml from excel sheet .xls using perl script

Hi all. I am working on the below requirement of generating .xml file from .xls file which i have , can someone please help me or in writing the perl script for the same: The xls file format is as below which has two columns and number of rows are not fixed: Fixlet Name ... (12 Replies)
Discussion started by: omkar.jadhav
12 Replies

2. Shell Programming and Scripting

Need help in writing perl script

Hi, I am new to perl. I am trying to write a small perl script for search and replace in a file : ======================================================== #!/usr/bin/perl my $searchStr = "register_inst\.write_t\("; my $replaceStr = "model\.fc_block\."; open(FILE,"temp.sv") ||... (2 Replies)
Discussion started by: chettyravi
2 Replies

3. UNIX for Dummies Questions & Answers

Writing an HTML file in perl

I'm writing a perl script that writes an html file. use Tie::File; my ($dir) = @ARGV; open (HTML,">","$dir/file.html") || die $!; #-----Building HTML file--------------------------- print HTML "<!DOCTYPE html> <html> <head> <title>Output</title> <link... (3 Replies)
Discussion started by: jrymer
3 Replies

4. Shell Programming and Scripting

Perl script for Calling a function and writing all its contents to a file

I have a function which does awk proceessing sub mergeDescription { system (q@awk -F'~' ' NR == FNR { A = $1 B = $2 C = $0 next } { n = split ( C, V, "~" ) if... (3 Replies)
Discussion started by: crypto87
3 Replies

5. Programming

REQUIRE HELP IN WRITING A PERL SCRIPT

Hi everyone I am a beginner in perl and I am trying to write a perl script. Basically I want to separate gene entries from phenotype entries in a text file which contains huge number of records and copy them in a separate file. The gene entries will have * symbol after the line FIELD TI. A... (7 Replies)
Discussion started by: kaav06
7 Replies

6. Shell Programming and Scripting

Writing a Perl Script that processes multiple files

I want to write a Perl script that manipulates multiple files. In the directory, I have files 250.*chr$.ped where * is from 1 to 1000 and $ is from 1-22 for a total of 22 x 10,000 = 22,000 files. I want to write a script that only manipulates files 250.1chr*.ped where * is from 1 to 22.... (10 Replies)
Discussion started by: evelibertine
10 Replies

7. UNIX for Dummies Questions & Answers

help in writing perl module

Hi i have written a perl script which was then converted to perl module by me. it works as expected. but i have to put it on many servers so i want to build a package for it. i dont know how to do that. just to check i copied perl module in "lib" directory which is working. ( directly copied... (1 Reply)
Discussion started by: zedex
1 Replies

8. Shell Programming and Scripting

help for a perl script - writing to a data file

Hi, Here is my problem.. i have 2 files (file1, file2).. i have wrote the last two lines and first 4 lines of "file2" into two different variables .. say.. my $firstrec = `head -4 $file2`; my $lastrec = `tail -2 $file2`; and i write the rest of the file2 to a tmpfile and cat it with head... (2 Replies)
Discussion started by: meghana
2 Replies

9. UNIX for Dummies Questions & Answers

Perl Unix Script Writing

Hi Folks, I posted a few days ago, thanks for the responses. My original question was for renaming files of sort 3p2325294.dgn in a directory containing multiple files. I need to drop the first 2 characters and the last in a unix script using Perl. How does it differ from using the Unix... (1 Reply)
Discussion started by: Dinkster
1 Replies

10. Shell Programming and Scripting

Writing perl module

Hi, I'd like to create perl functions in separate file from my scripts. Does somebody know if it's possible to create and use a perl module without compiling it ? Thanks. (4 Replies)
Discussion started by: jo_aze
4 Replies
Login or Register to Ask a Question