azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

command: az monitor alert-rules list -g 'Your_group' | grep operator produces mostly null operators

Open jefffall opened this issue 9 years ago • 7 comments

Description

Outline the issue here:

This is very bad.

I have all these alert-rules defined via the Web GUI

az monitor alert-rules list -g our_group'' | grep name "name": "CPU Greater Than Rule", "name": "Critical All Processor Time", "name": "CriticalCPUIdleTime", "name": "CriticalCPUIdleTime-2", "name": "CriticalCPUPercent", "name": "CriticalMemoryUsed", "name": "CriticalProcesssorSystemTime", "name": "CriticalProcesssorUserTime", "name": "CrticalTotalLowDiskFreeSpace", "name": "Disk Percentage Free", "name": "Disk Read Bytes", "name": "Disk Write Bytes", "name": "Disk Write Operations Sec", "name": "LogDiskTotAvgtReadQueueLength", "name": "LogicalDiskLTotalFreeMegabytes", "name": "LogicalDiskLTotPercentFreeSpace", "name": "LogicalDiskTotalAvgtDisksecRead", "name": "LogicalDiskTotalAvgtQueueLength", "name": "LogicalDiskTotalDiskBytessec", "name": "LogicalDiskTotalDiskReadssec", "name": "LogicalDiskTotalDiskTransferssec", "name": "LogicalDiskTotalPercentDiskTime", "name": "LogicalDiskTotalPercentIdleTime", "name": "LogicalDiskTotalWritessec", "name": "LogicalPercentTotalDiskWriteTime", "name": "LogicalTotalAvgtDisksecTransfer", "name": "LogicalTotalAvgtDisksecWrite", "name": "LogicalTotalDiskReadBytessec", "name": "LogicalTotalDiskWriteBytessec", "name": "LogicalTotalPercentDiskReadTime", "name": "LogTotAvgDiskWriteQueueLength", "name": "Memory Available Bytes", "name": "MemoryAvailable Bytes", "name": "MemoryCacheBytes", "name": "MemoryCommittedBytes", "name": "MemoryPageFaultssec", "name": "MemoryPagesPerSec", "name": "MemoryPool PagedBytes", "name": "MemoryPoolNonpagedBytes", "name": "NetInterPacketsOutboundErrors", "name": "NetInterPacketsReceivedErrors", "name": "Network In", "name": "Network InterfaceBytesSentsec", "name": "Network InterfacePacketssec", "name": "Network Out", "name": "NetworkInterfaceBytesReceivedsec", "name": "NetworkInterfaceBytesTotalsec", "name": "NetworkInterfacePacketsSentsec", "name": "NetworkInterPacketsReceivedsec", "name": "Percentage CPU", "name": "ProcessorTotalPercentUser Time", "name": "ProcessTotalThread Count", "name": "ProcessTotalWorkingSet", "name": "ProcessTotalWorkingSetPrivate", "name": "ProcTotalFrequency", "name": "ProcTotalHandleCount", "name": "ProcTotalPercentPrivilegedTime", "name": "System Up Time", "name": "SystemContext SwitchesPerSec", "name": "SystemProcesses", "name": "SystemProcQueueLength", "name": "Total Percent Processor Time", "name": "WarningAll ProcessorTime", "name": "WarningMemoryUsed", "name": "WarningProcesssorSystemTime", "name": "WarningProcesssorUserTime", "name": "WarningSwapMemory", "name": "WarningTotalLowDiskFreeSpace",

I try to list the JSON to see the rule and check out the operator. The operator is mostly 'null'

And in the Azure GUI on the webpage - there are no null operators.

c5256381% az monitor alert-rules list -g 'our_group' | grep operator "operator": null, "operator": null, "operator": "LessThan", "operator": "LessThan", "operator": null, "operator": null, "operator": null, "operator": null, "operator": "LessThan", "operator": "LessThan", "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": "LessThan", "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": null, "operator": "LessThan",

Would be great if this was fixed.


Environment summary

Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
Answer here:

curl -L https://aka.ms/InstallAzureCli | bash

CLI Version: What version of the CLI and modules are installed? (Use az --version)
Answer here:

az --version azure-cli (2.0.5)

acr (2.0.3) acs (2.0.5) appservice (0.1.5) batch (2.0.3) cdn (0.0.1) cloud (2.0.2) cognitiveservices (0.1.1) command-modules-nspkg (2.0.0) component (2.0.3) configure (2.0.5) core (2.0.5) dla (0.0.5) dls (0.0.5) documentdb (0.1.5) feedback (2.0.2) find (0.2.2) interactive (0.3.0) iot (0.1.5) keyvault (2.0.3) lab (0.0.4) monitor (0.0.3) network (2.0.5) nspkg (3.0.0) profile (2.0.4) redis (0.2.2) resource (2.0.5) role (2.0.3) sf (1.0.0) sql (2.0.2) storage (2.0.5) vm (2.0.5)

Python (Darwin) 2.7.10 (default, Feb 6 2017, 23:53:20) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]

Python location '/Users/c5256381/lib/azure-cli/bin/python'

OS Version: What OS and version are you using?
Answer here:

MacOS 10.12.4 Sierra

Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here:

csh

jefffall avatar May 09 '17 02:05 jefffall

Hi @jefffall, I ran into this same issue while working on the overhauled alert commands. After creating an alert rule, the object returned has "null" as the operator. I believe this may be a service-side issue.

cc/ @johnkemnetz

tjprescott avatar May 09 '17 15:05 tjprescott

This is a service bug. I created an issue in the REST API specs since that has the most visibility with the service team. https://github.com/Azure/azure-rest-api-specs/issues/1211

tjprescott avatar May 10 '17 18:05 tjprescott

Thank you Travis !!!!

On May 10, 2017, at 11:57 AM, Travis Prescott [email protected] wrote:

This is a service bug. I created an issue in the REST API specs since that has the most visibility with the service team. Azure/azure-rest-api-specs#1211

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jefffall avatar May 10 '17 19:05 jefffall

Also, I've observed this only occurs when the operation is "GreaterThan". For the other operators, this value returns normally. So, if >= makes sense for your case, I would encourage you to use that until the service fixes the bug.

tjprescott avatar May 17 '17 16:05 tjprescott

This has been fixed in the service. Please re-open if the issue persists.

tjprescott avatar Mar 30 '18 20:03 tjprescott

That took a year :-)

On Mar 30, 2018, at 4:53 PM, Travis Prescott [email protected] wrote:

Closed #3262.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

jefffall avatar Mar 30 '18 20:03 jefffall

Well I think it was fixed a while ago, but I just now saw this issue still open :D

tjprescott avatar Mar 30 '18 21:03 tjprescott