Commodore
Commodore
978 views

Need to monitor size of a file in AIX....

Hi guys,

 

i have one windows OVO server 8.16 and i added one AIX node

Now i want to monitore size of a file from /home/script .

if the size of script file excide 200MB i need a alert .
how can i do this in Measurement threshold policy without using script's.

what options are i need to select in Measurement threshold policy and where i need to give the file location......

help me on this guys...

 

NOTE: i cheked in OSSPI policies, those are using script for predefined location..
i dont have much knowledge in scripting...

 

thanks

santhosh

0 Likes
10 Replies
Fleet Admiral Fleet Admiral
Fleet Admiral

Hello Santosh,

 

There is no default policy in this case, so you will have to use the script and MT policy in order to acheive the same.

 

HTH

-KAKA-

Absent Member.. Absent Member..
Absent Member..

Hi santhosh,

 

I would use something like this. This is very basic and could be tweaked to use script-parameters and so on. But I'll leave that to you to figure out! 🙂

 

#!/usr/bin/perl
use strict;
use warnings;

my $file = "/home/script/file.txt";
my $filesize = -s "$file";
# Maximum allowed size in bytes
my $threshold = 1000;
if ($filesize >= $threshold) {
	$Rule->Status(1);
	$Session->Value("MsgTxt","File $file is $filesize bytes (maximum allowed size is $threshold bytes)");
} else {
	$Rule->Status(0);
}

 

 


 


Commodore
Commodore

Thank you jim and KAKA

@jim that was a nice solution for my question

and i have one more problem

i need to monitor an AIX node service from a Windows management server.

is it possible? if it is possible, how ?

 

NOTE : i tried using service/process policy, but while fetching service details from AIX node its showing some WMI error(i think it because of different OS platform). pls give some idea on this tooo......

 

thanks

santhosh

0 Likes
Fleet Admiral Fleet Admiral
Fleet Admiral

Hello Santosh,

 

You should have open another thread for this as this is different from the subject of your orignal post and may not bring attention of other forum users. however i will answer your question here.

 

i need to monitor an AIX node service from a Windows management server.

is it possible? if it is possible, how ?

 

>>>>> Yes it is possible and This does not matter that you are using OMW or OMU. you can monitor AIX services from OMW. Windows here just means that OM as a apllication running on Windows server.

 

NOTE : i tried using service/process policy, but while fetching service details from AIX node its showing some WMI error(i think it because of different OS platform). pls give some idea on this tooo......

>>>>> This is because that you can fetch the services from the node only if it is Windows. for UNIX you can put the service name in the input box where it ask for service which you can get by running ps -eaf on the AIX node and remember to put <*> in the parameter.

 

HTH

-KAKA- 

Commodore
Commodore

Hi kaka,

 

i want to monitor "gstctl" service status  from the location /oracle/dbhome/bin/gsdctl, using the command "/oracle/dbhome/bin/gsdctl stat".

if the service is down stat the i need a critical alert.

how can i do this in service/process policy..

is anyother way to do this.....

help me on this kaka

 

Note: i created service/perocess policy (below screen shot) but i am getting error alert stating that "the policy uses VB script it is not supported in UNIX node" and also i get another error alert stating same VB error

 

 

you specify about parameter <*> . where i need to give this parameter ?

 

 

0 Likes
Commodore
Commodore

HI KAKA_2

 

FYI.....

i checked the ps -eaf on the AIX node there is no process is running in the name of "gsdctl",

GSDCTL is a service ......

help me on this kaka and all......

0 Likes
Fleet Admiral Fleet Admiral
Fleet Admiral

What is the output of lssrc -a?

 

-KAKA-

0 Likes
Commodore
Commodore

Hi kaka,

 

Attached is the output of "lssrc -a" . what is the use of this command ?

 

FYI

i created a tool in OMW to check the gsdctl service is running or not using the command

"/oracle/dbhome/bin/gsdctl stat", i got the output as "GSD is running on the local node". 

if i give the command "gsdctl stat" without full path in the tool it will show the error message of "Command not found"

so from the above path only i can check the gsdctl service status...

please note this....

 

 

Thanks,

santhosh

 

 

0 Likes
Fleet Admiral Fleet Admiral
Fleet Admiral

Hello Santosh,

 

Attached is the output of "lssrc -a" . what is the use of this command ?

>> I was expecting this service to be listed here but it is not and this may be reason that you can not monitor it using service/process monitoring policy.

 

now only solution is left using an shell script.

 

I also have no AIX machine here to test the script.

 

-KAKA-

 

 

 

 

 

Commodore
Commodore

Hi KAKA,

 

Thanks for your replies 

i will try to do this by script....

if u found any script ,post it 

 

Thanks to all others.

 

Thanks,

santhosh

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.