Display long SLURM QoS names - slurm

I am trying to find out a way to display long QoS names in SLURM (bigger than 9 characters). I have created a QoS with the following command
sacctmgr add qos verylongname
But when using sacctmgr show qos format=name i get the following:
$ sacctmgr show qos format=name
Name
----------
verylongn+
As you can see the name is clipped after 9 characters. Is there a way to find out the full name of the SLURM QoS item?
For example, suppose you forget the long name but want to delete a QoS item, unless specifying it's full name the operation can't be done.
$ sacctmgr delete -i qos verylongn+
Nothing deleted
$ sacctmgr delete -i qos verylongname
Deleting QOS(s)...
verylongname

The format parameter accepts an optional argument specifying the width of the column:
sacctmgr show qos format=name%-40
The % sign indicates the width specifier, the - means "justify left" and 40 is the width in chars of the column.

Related

What is the format of azure monitor metric alert conditions in Azure CLI?

The documentation for az monitor metrics alert create does not explain the format used for --conditon parameter. Seems to me the value ends up being passed as allOf argument to constructor of MetricAlertSingleResourceMultipleMetricCriteria class as seen in the Azure CLI source for metric_alert.py. However this would mean this is a list of MetricCritieria, but the documentation examples are as follows:
--condition "total transactions > 5 where ResponseType includes Success"
--condition "avg SuccessE2ELatency > 250 where ApiName includes GetBlob or PutBlob"
which doesn't look like a valid format for the list[MetricCritieria]
The detailed format description is given upon calling with the -h flag:
PS> az monitor metrics alert create -h
Command
az monitor metrics alert create : Create a metric-based alert rule.
Arguments
--condition [Required] : The condition which triggers the rule.
Usage: --conditon {avg,min,max,total,count} [NAMESPACE.]METRIC {=,!=,>,>=,<,<=} THRESHOLD
[where DIMENSION {includes,excludes} VALUE [or VALUE ...]
[and DIMENSION {includes,excludes} VALUE [or VALUE ...] ...]]
Dimensions can be queried by adding the 'where' keyword and multiple dimensions can be
queried by combining them with the 'and' keyword.
Values for METRIC, DIMENSION and appropriate THRESHOLD values can be obtained from `az
monitor metrics list-definition` command.
Multiple conditons can be specified by using more than one `--condition` argument.
If you have a custom metrics which contains dot '.' or colon ':' then it is not so easy and I did not find any documentation. Fortunately what I found was a metric condition parser rule where you can read how the condition should look like.
So for example my metric is called Ori.EventHub:DeliveryTime, so the condition switch should look like:
az monitor metrics alert create --condition "avg Azure.ApplicationInsights.'Ori.EventHub:DeliveryTime' > 100" .

Find the max value of TTL in DNS Wireshark

I have pcap file which contains many DNS request and responses and i want to find the max value of ttl field from all of these packets for example:
If my pcap packets are the following:
DNS response ttl 1045
DNS response ttl 202
DNS response ttl 45
DNS response ttl 162
DNS response ttl 398
I want to find out how to recieve the value 1045 or even the packet itself.
It's all new to me so please try to explain carefully.
thanks for the helpers
To find the maximum TTL among packets from your pcap file, you could add a new TTL column and sort by this column.
To do this, you can right click on one of the column's name (e.g., Source), go to Column Preferences..., click the + sign at the bottom of the new window, and complete the new row that appeared with a title and dns.resp.ttl as the Fields option.
If you go back to the main Wireshark window, you should have a new column, which you can use to sort packets.
You can also accomplish this by using command-line tools, which I find to be faster and simpler, and depending on your needs, can also be scripted. For example:
tshark -r file.pcap -Y dns.resp.ttl -T fields -e dns.resp.ttl -E aggregator=/s | sort -nr | head -1
This command:
Utilizes the Wireshark command-line companion capture tool tshark to read the given file, filtering only for those packets containing a dns.resp.ttl field and then writing only that field to stdout, which is then piped to sort
sort is then instructed to conduct a reverse numeric sort (so highest-to-lowest value instead of the default lowest-to-highest) and pipe that output to head
head -1 will then display only the 1st line of output (instead of the default 10 lines), which will be the largest value ... probably*.
Refer to the tshark man page for more details about the options I used, such as -Y and -e, and to the sort and head man pages for more details about those commands.
*You should know that it's possible for some DNS packets to contain more than one occurrence of the dns.resp.ttl field, so this command may not always give you the largest overall value if the largest value happens to be contained within a packet with multiple occurrences of that field and where it isn't the first occurrence. This is also true for the Wireshark solution though. In other words, when you sort the column from high-to-low, the largest value may not necessarily be the first one if a packet contains multiple occurrences of the field because the sort only takes into account the value of the first occurrence.

Is it possible to change a job ID to something human-readable?

I'd like to send myself a text when a job is finished. I understand how to change the job name so that the .o and .e files have the appropriate name. But I'm not sure if there's a way to change the job ID from a string of numbers to a specified key so I know which job it is. I usually have a lot of different jobs going at once, so it's difficult to remember all the different job ID numbers. Is there a way in the .pbs script to change the job ID so that when I get the message I can see which job it is rather than just a string of numbers?
If you are using Torque and add the -N flag, then you can add a name to the job. It will still use the numeric portion of the job id as part of the output and error filenames, but this allows you to add something to help you distinguish among your jobs. For example:
$ echo ls | qsub -N whatevernameyouplease

Linux shell script to remove 2 day old frozen emails from exim queue

I want to put shell script under the cron job which will do following:
1) Removes 2 days old email messages which are in the Exim queue and are bounced/frozen messages, which won't be delivered. Script must not remove messages which are legitimate and are just waiting their time to be delivered.
2) Removes messages which are from invalid sender like null or <> and / or sent to invalid recipient nobody or <>
Thanks a lot.
exiqgrep is your friend! You can easily find queue items matching certain criteria and pipe the found message-id:s to a remove command. E.g:
exiqgrep -z -o 172800 -i | xargs -r exim -Mrm
which translates as follows: find queue items (exiqgrep) that are frozen (-z) and older than two days (-o 172800) and output their message id:s (-i) to xargs that runs only if getting any input (-r) telling exim to remove (-Mrm) the items with given message id:s.
Null (or <>) senders are certainly not invalid! Bounces and other (non-)delivery reports are typically sent from a null address in order to avoid infinite loops in case the bounce is not deliverable. However if you have lots of these on the queue and they stay there for long (e.g. if you are trying to bounce spam sent from fake addresses) you can certainly clean them up too. For example:
exiqgrep -o 86400 -f '<>' -i | xargs -r exim -Mrm
which finds queue items older than one day with a null sender and deletes them.
EDIT: you could also set the following option in your exim.conf to automatically remove frozen bounces after two days:
ignore_bounce_errors_after = 2d

Stack multiple libnotify popups

Does anybody know how i can get multiple popups sent via notify-send to appear on screen at once.
With:
$ notify-send 'Message One' 'Body One' & notify-send 'Message Two' 'Body Two' & notify-send 'Message Three' 'Body Three'
Each one waits for the previous popup in the queue to expire before being shown, i'm trying to get all three to cascade down the screen asap.
Man says:
OPTIONS
-u, --urgency=LEVEL Specifies the urgency level (low, normal, critical).
-t, --expire-time=TIME
Specifies the timeout in milliseconds at which to expire the notification.
-i, --icon=ICON[,ICON...]
Specifies an icon filename or stock icon to display.
-c, --category=TYPE[,TYPE...]
Specifies the notification category.
Help options:
-?, --help
Show this help message
-h, --hint=TYPE:NAME:VALUE
Specifies basic extra data to pass. Valid types are int, double, string and byte.
Setting the urgency to critical makes no difference.
TIA
I know it's an old question, but I ran into it while searching for related stuff in Google, so I will post an answer anyways.
Like tlvince said, it's your notification daemon's fault and you're probably running Canonical's notify-osd. Replace it with Gnome's notification-daemon and you will get the behavior your want.
These pages might help:
http://www.webupd8.org/2011/05/how-to-use-standard-gnome-notification.html
http://ubuntuforums.org/showthread.php?t=1663840
I believe it's the responsibility of the notification-daemon you are running as to what the behaviour should be. For example, in xfce4-notifyd, all three notifications are displayed at once, overlapping each other (since it doesn't support stacking).
Since your running Ubuntu 9.04, your notification-daemon is most likely notifyOSD. Try taking a look through its documentation.

Resources