written by SystemAdmin)
relevance AIX OS.
Is it possoble to code relevance to check if a file x or dir a/b/c is a link?
If yes, could ypou please share the syntax.
written by SystemAdmin)
relevance AIX OS.
Is it possoble to code relevance to check if a file x or dir a/b/c is a link?
If yes, could ypou please share the syntax.
(imported comment written by SystemAdmin)
Clarification:
/x/y/z/dir2 is a soft link:
$ ls -l /x/y/z/dir2
lrwxrwxrwx 1 xx xxm 25 Feb 28 19:21 /x/y/z/dir2 -> /x/y/z/dir1
this is the directory
$ ls -ld /x/y/z/dir1
drwxr-xr-x 2 xx xxm 256 Feb 28 12:16 /x/y/z/dir1
I would like to find out how to code relevance to check if /x/y/z/dir2 soft link exists.
I found this in another posted question but it is not working for me:
Relevance expression is true value of symlink “/x/y/z/dir2” contains “/x/y/z/dir1”
(imported comment written by SystemAdmin)
I recreated your scenario on RH and Oracle. I don’t have AIX available at the moment but the following statements work for me on Both Oracle and RH.
q: exists symlink “/x/y/z/dir2”
a: True
q: value of symlink “/x/y/z/dir2”
a: /x/y/z/dir1
q: value of symlink “/x/y/z/dir2” = “/x/y/z/dir1”
a: True
According to the documentation this should also work on AIX since TEM 7.0. Does an ls -al in /x/y/z/ directory show both dir1 and dir2 with dir2 being a symlink?
(imported comment written by SystemAdmin)
Hi Jimmie, I appreciate your reply so much and thank you… I am testing it… so far no success but I may need to wait longer because my TEM console is so slow.
To answer your question:
$ pwd
/x/y/z
$ ls -la|grep ^d|grep dir
drwxr-xr-x 2 xx xxm 256 Feb 28 12:16 dir1
$ ls -l /x/y/z/dir2
lrwxrwxrwx 1 xx xxm 25 Feb 28 19:21 /x/y/z/dir2 -> /x/y/z/dir1
$ cd /x/y/z/dir2
$ pwd
/x/y/z/dir2
The link was created via
ln -sf /x/y/z/dir1 /x/y/z/dir2
For security reason I replaced the actual values with x/y/z
(imported comment written by SystemAdmin)
No problem. I actually created /x/y/z/dir1 and /x/y/z/dir2. I only used ln -s to create the link in Linux.
Most importantly you don’t have to wait for your console to test. There is a debugger on each *NIX client to test relevance. You can find it here:
/opt/BESClient/bin/qna (On RH at least)
There is also an xqna if you prefer a graphical version
(imported comment written by SystemAdmin)
More details on the *NIX debugger:
(imported comment written by SystemAdmin)
Below relevance does not work (as far as symlink to be true). But if I remove the check for the symlink and have the computer only that my action script will become relevant and executes successfuly (the task (sh code) checks for the existence of the symlink and does what I need). But I want to have relevance as well.
this is what I have:
(version of client >= “6.0.0.0”) AND ((exists true whose (if true then (exists (computer name) whose (it as string as lowercase contains “xxxx” as lowercase)) else false)) AND (exists true whose (if true then (value of symlink “/x/y/z/dir2” = “/x/y/z/dir1”) else false)))
I removed sensitive info and replaced it with x/y/z.
P.S.
Thanks as well for Jimmie’ reply and I followed on qna; on the computer which I test the qna does not work.
Could not load program ./qna:
Dependent module libBEScrypto_1_0_0_1.so could not be loaded.
Could not load module libBEScrypto_1_0_0_1.so.
System error: No such file or directory
(imported comment written by SystemAdmin)
Last minute. It worked, the tem console is sooooo sloooow to reflect updates/and showing in effect applicable computers count (even though I refresh it often).
(imported comment written by SystemAdmin)
Here’s some info on the library issue you are having and how to fix it: